[lug] q: ramdisk /tmp & mount plain files

Zan Lynx zlynx at acm.org
Mon May 3 09:45:43 MDT 2010

On 5/2/10 11:22 AM, David Stearns wrote:

>> 2) how could i mount a plain binary file as a read/write filesystem?
>> that's assuming that one can do an mkfs on a plain file too.
>> context is that, i might backup an entire filesystem to a plain file
>> (eg: cat /dev/sda0>  /home/myhome/myfsbackup;
>> so now I wanna do a mount /home/myhome/myfsbackup /mymountpoint and be
>> able to access things backed up.)
> You should be able to
> `mount -oloop -t<fstype>  /home/myhome/myfsbackup /mymountpoint`
> That should do what you need.

I think that you need to use dd if=/dev/zero of=file bs=1024k count=[# 
of megs] to make the file before you can run mkfs on it. mkfs generally 
expects a file or device or partition to already have a size.

You may also be able to use dd with the skip option to make a sparse 
file and use that with mkfs.
Zan Lynx
zlynx at acm.org

"Knowledge is Power.  Power Corrupts.  Study Hard.  Be Evil."

More information about the LUG mailing list