On Sat, Apr 19, 2014 at 8:54 PM, Peter Humphrey <pe...@prh.myzen.co.uk> wrote:
> On Saturday 19 Apr 2014 07:43:18 Walter Dnes wrote:
>>   I've got another thread going called...
>> "Strange behaviour with LILO on new install on old laptop".  Before I
>> file a bug report, I want to check first whether it's my fault.  Can
>> people here do me a favour?  If you have a Gentoo install CD or USB key
>> handy, and are willing to reboot, can you please do the following...
>>
>> 1) boot from the install ISO
>> 2) chroot to a running environment
>> 3) list the output from the 2 commands
>>  mount
>>  cat /etc/mtab
>>
>>   I'm getting absolutely no output at all from those 2 commands in the
>> install chroot.  That screws up the lilo ebuild install process.  I want
>> to check whether blank /etc/mtab is my fault or not.
>
> The installation handbook used to include a command to write /etc/mtab in the
> chroot by grepping the host mtab, but it's been removed and I haven't been
> able to find it. Meanwhile, I think it's standard behaviour for mtab not to be
> populated during the installation process.
>
> So I'd also be interested to hear from anyone who knows what mtab should
> contain.
>

/etc/mtab is practically outdated. It's supposed to contain the list
of currently
mounted filesystems and the corresponding options, to be updated by the mount
command when doing changes. You'll notice, of course, that this doesn't at all
sound anything like most of the files in /etc - that's because the
list of filesystems
in a modern Linux changes a lot more frequently than the original
Unixes. Instead
of a config file, /etc/mtab essentially holds system state, which is something
that is more appropriate for /var or /proc or /sys.

And that's what /etc/mtab today should contain. Linux automatically updates
/proc/self/mounts to hold what /etc/mtab used to hold, and a modern /etc/mtab
should essentially just be a symlink to that.

But of course, legacy. So the mount command will fail to function properly
if you are, for example, in a read-only filesystem, or in a chroot, or otherwise
in some situation where /etc/mtab was not updated by the mount command to
match the contents of /proc/self/mounts.

-- 
This email is:    [ ] actionable   [x] fyi        [ ] social
Response needed:  [ ] yes          [x] up to you  [ ] no
Time-sensitive:   [ ] immediate    [ ] soon       [x] none

Reply via email to