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