- Pre-allocate img file (stuff.img) of the size you need (10M):
dd if=/dev/zero of=/tmp/stuff.img bs=1M count=10
- Setup a loop device:
losetup /dev/loop0 /tmp/stuff.img
- Create ext3 file system on loop device:
mkfs.ext3 /dev/loop0
- Mount it:
mount /dev/loop0 /mnt
- Unmount file system:
umount /mnt
- Delete loop device:
losetup -d /dev/loop0
No comments :
Post a Comment