For a OS project, I am creating a ext2 file system image and mounting it. This means that I am writing out a 1 MB file with block information and then using it as the mount target.
For example, assume there is a file called base.img
:
fsck.ext2 base.img # checking my file system
mkdir mnt
sudo mount -o loop base.img mnt
After the mount is successful, what is happening internally? From my understanding, my base.img
simply initializes the image correctly. Internally, these are my questions:
- Is there now a drive partition with this file system?
- How are changes to the file system managed?
For the second, from my understanding, there exists a "mount table" and perhaps an ext2
module that Linux will use for further changes. Will these changes be reflected in base.img
or is there a new disk partition for it now?
My underlying question here is: how does this all work?