Gentoo Archives: gentoo-user

From: Mark David Dumlao <madumlao@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Output of "mount" and "cat /etc/mtab" inside install chroot?
Date: Sat, 19 Apr 2014 13:37:17
Message-Id: CAG2nJkPYTWzb0q4eAc4wNTA1io4C85LxTQtu1MbUD_xcPTsavg@mail.gmail.com
In Reply to: Re: [gentoo-user] Output of "mount" and "cat /etc/mtab" inside install chroot? by Peter Humphrey
1 On Sat, Apr 19, 2014 at 8:54 PM, Peter Humphrey <peter@××××××××××××.uk> wrote:
2 > On Saturday 19 Apr 2014 07:43:18 Walter Dnes wrote:
3 >> I've got another thread going called...
4 >> "Strange behaviour with LILO on new install on old laptop". Before I
5 >> file a bug report, I want to check first whether it's my fault. Can
6 >> people here do me a favour? If you have a Gentoo install CD or USB key
7 >> handy, and are willing to reboot, can you please do the following...
8 >>
9 >> 1) boot from the install ISO
10 >> 2) chroot to a running environment
11 >> 3) list the output from the 2 commands
12 >> mount
13 >> cat /etc/mtab
14 >>
15 >> I'm getting absolutely no output at all from those 2 commands in the
16 >> install chroot. That screws up the lilo ebuild install process. I want
17 >> to check whether blank /etc/mtab is my fault or not.
18 >
19 > The installation handbook used to include a command to write /etc/mtab in the
20 > chroot by grepping the host mtab, but it's been removed and I haven't been
21 > able to find it. Meanwhile, I think it's standard behaviour for mtab not to be
22 > populated during the installation process.
23 >
24 > So I'd also be interested to hear from anyone who knows what mtab should
25 > contain.
26 >
27
28 /etc/mtab is practically outdated. It's supposed to contain the list
29 of currently
30 mounted filesystems and the corresponding options, to be updated by the mount
31 command when doing changes. You'll notice, of course, that this doesn't at all
32 sound anything like most of the files in /etc - that's because the
33 list of filesystems
34 in a modern Linux changes a lot more frequently than the original
35 Unixes. Instead
36 of a config file, /etc/mtab essentially holds system state, which is something
37 that is more appropriate for /var or /proc or /sys.
38
39 And that's what /etc/mtab today should contain. Linux automatically updates
40 /proc/self/mounts to hold what /etc/mtab used to hold, and a modern /etc/mtab
41 should essentially just be a symlink to that.
42
43 But of course, legacy. So the mount command will fail to function properly
44 if you are, for example, in a read-only filesystem, or in a chroot, or otherwise
45 in some situation where /etc/mtab was not updated by the mount command to
46 match the contents of /proc/self/mounts.
47
48 --
49 This email is: [ ] actionable [x] fyi [ ] social
50 Response needed: [ ] yes [x] up to you [ ] no
51 Time-sensitive: [ ] immediate [ ] soon [x] none