Peter Humphrey wrote:
> Hello list,
>
> My little Celeron LAN server lives on /dev/sda5, with /boot on /dev/sda2. It's
> a UEFI system so /dev/sda2 is VFAT. Other partitions exist but they're not
> germane here.
>
> The poor wee thing takes about four hours to compile a kernel using both its
> cores, during which time I keep /boot mounted. I could leave mounting it until
> the 'make install' stage but I haven't done that so far.
>
> The machine also contains a small rescue system on /dev/sda4, which I maintain
> in a chroot under /mnt/rescue. Its kernel also takes four hours since I prefer
> to keep the two kernels identical (apart from a local '-rescue' suffix in that
> system).
>
> Now, my question is: is it safe for me to mount the boot partition on /boot
> and /mnt/rescue/boot simultaneously? The man page hints that it is, and I can
> see them both:
>
> $ cat /proc/mounts | grep boot
> /dev/sda2 /mnt/rescue/boot vfat
> rw,relatime,fmask=0022,dmask=0022,codepage=850,iocharset=iso8859-1,shortname=mixed,errors=remount-ro
> 0 0
> /dev/sda2 /boot vfat
> rw,relatime,fmask=0022,dmask=0022,codepage=850,iocharset=iso8859-1,shortname=mixed,errors=remount-ro
> 0 0
>
> The main system and the rescue system will each write files to its own /boot,
> but there shouldn't be any collisions because of course they all have
> different
> names.
>
> Ordinarily, there's no difficulty because the two systems don't usually need
> kernels compiled at the same time, but if I can run them concurrently
> overnight I ought to finish ahead.
>
> Has anyone any cautionary notes for me?
>
I tend to agree with the others. It is likely safe but bind mounting
may be safer.
The one thing you want to always avoid, mounting two file systems to the
same place. If I recall correctly, whatever you mount last is what the
system actually sees. The other is hidden underneath. Look at it like
two sheets of paper. You lay down one with writing on it then put a
second sheet of paper with writing on it on top of the first sheet. The
first sheet is there but I don't think the system can actually write to
it or even read it. The second sheet is covering up the first sheet.
Once you unmount whatever you mounted last, it shows up again.
I actually done that once ages ago by accident. The results of mount
and ls was weird to say the least. I was expecting one thing but got
something different. I can't recall how I managed to do that tho. That
was a long time ago so I think I got it right.
Dale
:-) :-)