losetup example

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1244 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2008-11-15 19:17:55 +00:00
parent cb42609f95
commit 375e7b165f

View File

@ -953,7 +953,24 @@ losetup [-o <offset>] [-r] &lt;dev-path&gt; &lt;file-path&gt;
</pre></ul>
<p>
<b>Synopsis</b>.
Setup the loop device at &lt;dev-path&gt; to access the file at &lt;file-path&gt; as a block device:
Setup the loop device at &lt;dev-path&gt; to access the file at &lt;file-path&gt; as a block device.
Example:
<ul><pre>
nsh&gt; dd if=/dev/zero of=/tmp/image bs=512 count=512
nsh&gt; ls -l /tmp
/tmp:
-rw-rw-rw- 262144 IMAGE
nsh&gt; losetup /dev/loop0 /tmp/image
nsh&gt; ls -l /dev
/dev:
brw-rw-rw- 0 loop0
nsh&gt; mkfatfs /dev/loop0
nsh&gt; mount -t vfat /dev/loop0 /mnt/example
nsh&gt; ls -l /mnt
ls -l /mnt
/mnt:
drw-rw-rw- 0 example/
</pre></ul>
</p>
<a <p><b>Command Syntax 2:</b></p>