On Monday 25 Jul 2011 12:18:34 YoYo Siska wrote:
> On Mon, Jul 25, 2011 at 11:40:55AM +0100, Mick wrote:

> > I never understood properly how the mount --bind/rbind works.  I
> > understand that the original partition content becomes visible on a
> > second partition, but I'm not at all sure what happens when the space on
> > the first partition runs out?
> 
> Not "on a second partition" but under another "mount point" i.e. another
> path... When you try to access a file by its filename, the kernel takes
> the absolute file name, compares it to all the moutend "mount points",
> takes the best match and tries to find (create)  the file in that
>  filesystem/partition...
> 
> Lets say you do something like:
> 
> mount /dev/sda1 /  (well... you don't actually do this... ;)
> mount /dev/sda2 /mnt/sda2
> mount --bind /mnt/sda2/bigtmp  /tmp
> 
> Then path "/home/yoyo/something" is accessing file "home/yoyo/something"
> on partition sda1.
> 
> The path "/mnt/sda2/somedir/somefile" is accessing file "somedir/somefile"
> on partion sda2.
> 
> The path "/tmp/somedir/somefile" is accessing file
> "bigtmp/somdir/somefile" on partition sda2.
> 
> 
> The files (and free space) under /mnt/sda2  and /tmp are actually on
> partition sda2, everything else is on sda1...
> 
> 
> So if sda1 runs out of space (by writing to other places than /mnt/sda2
> and /tmp), it doesn't in any any way affect /mnt/sda2 and /tmp which
> have their free space from sda2. Conversely if you fill up sda2 by
> writing to /tmp, your "system" partition still has free space ;)
> 
> 
> yoyo

I think I got it.  Thanks!
-- 
Regards,
Mick

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to