Re: filesystem inside a file using loop device.

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

 



Hi...

2009/1/5 Paraneetharan Chandrasekaran <paraneetharanc@xxxxxxxxx>:
> Hi Mulyadi,
>          These are the sequence of commands i used..
>
> dd if=/dev/zero of=./fsimage.img bs=1k count=10000
> /sbin/losetup /dev/loop0 ./fsimage.img
> /sbin/mke2fs /de/loop0 10000
> mkdir mntpoint
> mount /dev/loop0 ./mntpoint
> cd mntpoint
> vim newfile
> /* entered some contents, saved and exited*/
> cd ..
> rm fsimage.img
> cd mntpoint
> /* I am now able to change to this directory ! */
> cat newfile
> /* the contents are here without any change ! */

I think, by directly doing "rm <image file>" without first detaching
the loop device from the backing file, it still makes  /dev/loop
associated with the disk blocks. In other word, backing file inode is
not needed in this context, because that's replaced by /dev/loop
metadata (or inode). That's why you can still access the directories
and the files and their contents.

These are all my humble interpretation on how VFS works...CMIIW people

regards,

Mulyadi.

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux