snipt

Ctrl+h for KB shortcuts

Bash

loop mount an iso file

sudo mount -t iso9660 -o ro,loop=/dev/loop0 dvd.iso /media/dvd
https://snipt.net/embed/b49a63ff5cfcd0357a768907a4edd580/
https://snipt.net/raw/b49a63ff5cfcd0357a768907a4edd580/
b49a63ff5cfcd0357a768907a4edd580
bash
Bash
2
2016-09-23T00:46:55
True
False
False
/api/public/snipt/28182/
loop-mount-an-iso-file
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a>sudo mount -t iso9660 -o ro,loop<span class="o">=</span>/dev/loop0 dvd.iso /media/dvd </span></pre></div> </td></tr></table>
dvd, mount

Bash

Remount drive as RW

mount -o rw,remount -t yaffs2 /dev/block/mtdblock2 /system
https://snipt.net/embed/5274fd1e0be0602b4f88efcd11c54609/
https://snipt.net/raw/5274fd1e0be0602b4f88efcd11c54609/
5274fd1e0be0602b4f88efcd11c54609
bash
Bash
1
2016-09-17T23:30:05
True
False
False
/api/public/snipt/26567/
remount-drive-as-rw
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a>mount -o rw,remount -t yaffs2 /dev/block/mtdblock2 /system </span></pre></div> </td></tr></table>
android, mount

Bash

mount cd

mount -t iso9660 /dev/hdc /media/cdrom0
https://snipt.net/embed/0638295d8c9859e9b922b29c61f12d3f/
https://snipt.net/raw/0638295d8c9859e9b922b29c61f12d3f/
0638295d8c9859e9b922b29c61f12d3f
bash
Bash
1
2016-09-20T03:19:17
True
False
False
/api/public/snipt/20319/
mount-cd
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a>mount -t iso9660 /dev/hdc /media/cdrom0 </span></pre></div> </td></tr></table>
bash, mount

Bash

mount ftp using curlftpfs

1
2
3
4
5
curlftpfs ftp://user:password@host /mount/point

#unmount

fusermount -u /mount/point
https://snipt.net/embed/ed1b79a97092c136d3419f244f1315bd/
https://snipt.net/raw/ed1b79a97092c136d3419f244f1315bd/
ed1b79a97092c136d3419f244f1315bd
bash
Bash
5
2016-09-17T17:09:16
True
False
False
/api/public/snipt/11596/
mount-ftp-using-curlftpfs
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a>curlftpfs ftp://user:password@host /mount/point </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a><span class="c">#unmount</span> </span><span id="L-4"><a name="L-4"></a> </span><span id="L-5"><a name="L-5"></a>fusermount -u /mount/point </span></pre></div> </td></tr></table>
curlftpfs, ftp, mount

Bash

Manual Mounting on Mac

1
2
3
4
5
6
7
8
#! /bin/bash
# Mount a partition described in /etc/fstab
# For example fstab could contain the line
# LABEL=PARTITION_NAME none msdos rw,noauto
# See http://www.macosxhints.com/article.php?story=20090811124320441

dev_id=`diskutil list | awk '/PARTITION_NAME/{ print $6; }'`
[[ $dev_id ]] && diskutil mount $dev_id
https://snipt.net/embed/41a477bd5ce7ffad36df6c8f318b816b/
https://snipt.net/raw/41a477bd5ce7ffad36df6c8f318b816b/
41a477bd5ce7ffad36df6c8f318b816b
bash
Bash
8
2016-09-24T19:07:45
True
False
False
/api/public/snipt/7861/
manual-mounting-on-mac
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a> <a href="#L-7">7</a> <a href="#L-8">8</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="c">#! /bin/bash</span> </span><span id="L-2"><a name="L-2"></a><span class="c"># Mount a partition described in /etc/fstab</span> </span><span id="L-3"><a name="L-3"></a><span class="c"># For example fstab could contain the line</span> </span><span id="L-4"><a name="L-4"></a><span class="c"># LABEL=PARTITION_NAME none msdos rw,noauto</span> </span><span id="L-5"><a name="L-5"></a><span class="c"># See http://www.macosxhints.com/article.php?story=20090811124320441</span> </span><span id="L-6"><a name="L-6"></a> </span><span id="L-7"><a name="L-7"></a><span class="nv">dev_id</span><span class="o">=</span><span class="sb">`</span>diskutil list <span class="p">|</span> awk <span class="s1">&#39;/PARTITION_NAME/{ print $6; }&#39;</span><span class="sb">`</span> </span><span id="L-8"><a name="L-8"></a><span class="o">[[</span> <span class="nv">$dev_id</span> <span class="o">]]</span> <span class="o">&amp;&amp;</span> diskutil mount <span class="nv">$dev_id</span> </span></pre></div> </td></tr></table>
fstab, mac, mount

Text only

Update /etc/fstab with currently mounted devices

mv /etc/fstab /etc/fstab.old && mount|awk '{print $1, $3, $5, $6}'|sed s/\(//g|sed s/\)/' 0 0'/g >> /etc/fstab
https://snipt.net/embed/d5ef52cf9972641f0dba458efc5b5e87/
https://snipt.net/raw/d5ef52cf9972641f0dba458efc5b5e87/
d5ef52cf9972641f0dba458efc5b5e87
text
Text only
1
2016-09-24T22:19:30
True
False
False
/api/public/snipt/7471/
update-etcfstab-with-currently-mounted-devices
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a>mv /etc/fstab /etc/fstab.old &amp;&amp; mount|awk &#39;{print $1, $3, $5, $6}&#39;|sed s/\(//g|sed s/\)/&#39; 0 0&#39;/g &gt;&gt; /etc/fstab </span></pre></div> </td></tr></table>
awk, bash, fstab, mount, sed

Bash

Convert a DMG file to an IMG file then mount it

dmg2img -i <FILE.DMG> -o <FILE.IMG>
mount -t hfsplus -o loop <FILE.IMG> <MOUNTPOINT>
https://snipt.net/embed/16a422112a916fe52e06a0eb0fcd08f9/
https://snipt.net/raw/16a422112a916fe52e06a0eb0fcd08f9/
16a422112a916fe52e06a0eb0fcd08f9
bash
Bash
2
2016-09-21T16:48:00
True
False
False
/api/public/snipt/5315/
convert-a-dmg-file-to-an-img-file-then-mount-it
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a>dmg2img -i &lt;FILE.DMG&gt; -o &lt;FILE.IMG&gt; </span><span id="L-2"><a name="L-2"></a>mount -t hfsplus -o loop &lt;FILE.IMG&gt; &lt;MOUNTPOINT&gt; </span></pre></div> </td></tr></table>
bash, dmg, dmg2img, hfs, hfsplus, img, mount
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.