Using Loopback Command

Loopback filesystem support allows a user to mount an ordinary file as if it were a device, such as /dev/hda1. This is useful for mounting a CD-ROM filesystem to populate and test before burning it to CDROM.

Use the dd command to create file large enough to contain the filesystem:

dd if=/dev/zero of=filesystem.img bs=1M count=20

Associate the new file with the loopback device:

losetup /dev/loop0 filesystem.img

Create a filesystem within the file:

mkfs -t ext2 /dev/loop0

Mount the filesystem:

mount /dev/loop0 mount point

About vicki

Welcome to the Sovereign Republic of Vickistan. I am the President here. Lucky me! No taxes or laws yet. Lucky you!
This entry was posted in Linux. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *