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:
parent
c8f205d2c5
commit
3855baf8d9
@ -953,7 +953,24 @@ losetup [-o <offset>] [-r] <dev-path> <file-path>
|
|||||||
</pre></ul>
|
</pre></ul>
|
||||||
<p>
|
<p>
|
||||||
<b>Synopsis</b>.
|
<b>Synopsis</b>.
|
||||||
Setup the loop device at <dev-path> to access the file at <file-path> as a block device:
|
Setup the loop device at <dev-path> to access the file at <file-path> as a block device.
|
||||||
|
Example:
|
||||||
|
<ul><pre>
|
||||||
|
nsh> dd if=/dev/zero of=/tmp/image bs=512 count=512
|
||||||
|
nsh> ls -l /tmp
|
||||||
|
/tmp:
|
||||||
|
-rw-rw-rw- 262144 IMAGE
|
||||||
|
nsh> losetup /dev/loop0 /tmp/image
|
||||||
|
nsh> ls -l /dev
|
||||||
|
/dev:
|
||||||
|
brw-rw-rw- 0 loop0
|
||||||
|
nsh> mkfatfs /dev/loop0
|
||||||
|
nsh> mount -t vfat /dev/loop0 /mnt/example
|
||||||
|
nsh> ls -l /mnt
|
||||||
|
ls -l /mnt
|
||||||
|
/mnt:
|
||||||
|
drw-rw-rw- 0 example/
|
||||||
|
</pre></ul>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<a <p><b>Command Syntax 2:</b></p>
|
<a <p><b>Command Syntax 2:</b></p>
|
||||||
|
@ -341,6 +341,23 @@ o losetup [-d <dev-path>] | [[-o <offset>] [-r] <ldev-path> <file-path>]
|
|||||||
|
|
||||||
losetup [-o <offset>] [-r] <dev-path> <file-path>
|
losetup [-o <offset>] [-r] <dev-path> <file-path>
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
nsh> dd if=/dev/zero of=/tmp/image bs=512 count=512
|
||||||
|
nsh> ls -l /tmp
|
||||||
|
/tmp:
|
||||||
|
-rw-rw-rw- 262144 IMAGE
|
||||||
|
nsh> losetup /dev/loop0 /tmp/image
|
||||||
|
nsh> ls -l /dev
|
||||||
|
/dev:
|
||||||
|
brw-rw-rw- 0 loop0
|
||||||
|
nsh> mkfatfs /dev/loop0
|
||||||
|
nsh> mount -t vfat /dev/loop0 /mnt/example
|
||||||
|
nsh> ls -l /mnt
|
||||||
|
ls -l /mnt
|
||||||
|
/mnt:
|
||||||
|
drw-rw-rw- 0 example/
|
||||||
|
|
||||||
o ls [-lRs] <dir-path>
|
o ls [-lRs] <dir-path>
|
||||||
|
|
||||||
Show the contents of the directory at <dir-path>. NOTE:
|
Show the contents of the directory at <dir-path>. NOTE:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user