|
Linux HowTo's -
Beginner Linux HowTo's
|
|
Written by dexxtreme dexxtreme
|
|
Saturday, 24 May 2008 06:55 |
|
Sometimes you will need to create a virtual loopback device for whatever reason. One possible need would be for a temporary filesystem to do some quick testing, or maybe to set up a larger /tmp partition on a server where /tmp is too small. To initially create the loopback device, run:
# dd if=/dev/zero of=/usr/local/tmpfs bs=50M count=10
dd if=<file to read from> of=<file to write to> bs=<byte size> count=<count to loop>
# losetup /dev/loop0 /usr/local/tmpfs
losetup <loopback device> <file>
# mkfs -t ext3 /dev/loop0
mkfs -t <file system type> <file system>
# mount /dev/loop0 /path/to/dir
mount <file system> <dir to mount filesystem>
You should now have a 500MB loopback filesystem (minus the standard filesystem overhead) mounted under /path/to/dir. You can change the size of the device by modifying the "bs" and "count" arguments in the "dd" command. On every reboot,you will need to do the following to make the device available again:
# losetup /dev/loop0 /usr/local/tmpfs
# mount /dev/loop0 /path/to/dir
|
|
Last Updated ( Sunday, 25 May 2008 00:06 )
|