[lfs-support] What Is "The" LFS Partition?

Henrik /KaarPoSoft henrik at kaarposoft.dk
Tue Nov 6 12:48:31 PST 2012

On 11/06/12 21:21, Feuerbacher, Alan wrote:

> Ok, so mounting IS a lot more than just a way of looking at things. It's doing something *physically*. That clears up a lot.
>>> Why does one have to create a directory with that name before
>>> executing the "mount" command?
>> The system has to know where to attach the data structures in the file
>> tree.  You could create a script to do a 'mkdir -p <mountpoint>;
>> mount...', but that's overkill.
> Now I'm confused again. I thought that creating a directory actually writes data into a place on a hard disk that the kernel allocates for the directory. Something about inodes, if I remember right. But if that's so, and a filesystem is not yet mounted, where does that data get written? It looks like the cart is before the horse.
> Specifically, if you want to do "mount /dev/sda5 /mnt/lfs", but you have to create the directory "/mnt/lfs" BEFORE you do the mount, then where does the inode information about "/mnt/lfs" get written? I'm sure I'm missing some details.
In the beginning, you just have the root filesystem.

As any filesystem, it is "just" a map from paths to content.

When you create the directory /mnt/lfs, this writes something to the disk.

[ as it is a directory it does not touch inodes, but that's besides the 
point ]

So now you have a root filesystem (/) saying that "/mnt/lfs" is a directory,
(You could create files in there if you wanted)

When you say "mout /dev/whatever /mnt/lfs" it just creates some 
structure in the kenel,
telling he kernel to access some data on your /dev/whatever, when you 
access /mnt/lfs/foobar.

So, after the mount, the kernel has some new data,
but neither your root filesystem, nor /dev/whatever has any data written 
on it.


More information about the lfs-support mailing list