[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Making a file system image



Hello

Rus Foster (<rghf@fsck.me.uk>) wrote:

>  I'm basically wanting to create a file, format it then loop back
> mount it. Now for the life of me I can work out how to format a file. 

After you created the file, connect it to a loop device, e.g.:

losetup /dev/loop0 loopback-file

Then, you can format it using the loop-device:
mke2fs /dev/loop0
if you want to use ext2

You can then mount the device:
mount /dev/loop0 /mnt/loop-dir

or disconnect the file from the device:
losetup -d /dev/loop0

and then use the mount command with the file:
mount loopback-file /mnt/loop-dir -o loop

Please note: if you want to use encryption, you have to use the
encryption parameters with losetup before you make the file system.

best regrads
        Andreas Janssen

-- 
Andreas Janssen
andreas.janssen@bigfoot.com
PGP-Key-ID: 0xDC801674
Registered Linux User #267976



Reply to: