Disk Partiotioning

John Summerfield debian at herakles.homelinux.org
Thu Dec 2 03:12:31 UTC 2004


On Thursday 02 December 2004 10:59, Gustavo Seabra wrote:
> How do I make a "filesystem in a file" ?

I'll answer first: mine's best:-)

dd if=/dev/zero of=bigfile count=0 seek=$((4*1024)) bs=$((1024*1024))
ls -Shosag bigfile
mke2fs -q -F bigfile
ls -Shossag bigfile
sudo mount -o loop bigfile /mnt

The last assumes you have sudo installed and configured.

You could, of course, mount it over /tmp and Bob's your uncle:-)

Be aware that this is a little more frail than a filesystem on a partition: 
you have two layers of stuff to write. It's good for
1) Short-term stuff
2) Throw-away stuff. Like /tmp.
3) ro stuff. Like /usr - just back it up each time you change it.
4) Self-education.

btw I created an ext2 filesystem like that, populated it and burned to to dvd.




-- 

Cheers
John Summerfield
tourist pics: http://environmental.disaster.cds.merseine.nu/




More information about the fedora-list mailing list