jueves, 27 de mayo de 2010

Create a Loopback filesystem from a file. Linux

If you need to have a new filesystem to test some operations on the server or you want a more flexible way of performing snapshots other than volume management, you can use loopback filesystems.

First Step. Create the Loopback file
dd if=/dev/zero of=/apps/test/loop db=1024 count=30720
This will create a 30 Mb file.

Second Step. Create a Loopback device.
First of all we will type
losetup -a
to list the current used devices.
losetup /dev/loop0 /apps/test/loop

Third Step. Create and mount a device.
mkfs -t ext3 -m 1 -v /dev/loop0
mkdir /virt_drive
mount /dev/loop0 /virt_drive



No hay comentarios:

Publicar un comentario