On Mon, Apr 21, 2014 at 7:44 PM, Walter Dnes <waltd...@waltdnes.org> wrote:
> On Mon, Apr 21, 2014 at 09:38:44AM +0100, Peter Humphrey wrote
>> On Monday 21 Apr 2014 00:55:56 yac wrote:
>>> On Sat, 19 Apr 2014 13:54:07 +0100
>>> Peter Humphrey <pe...@prh.myzen.co.uk> wrote:
>>>>
>>>> The installation handbook used to include a command to
>>>> write /etc/mtab in the chroot by grepping the host mtab
>>>
>>> It was part of grub-install, now grub legacy
>>>
>>> https://www.gentoo.org/doc/en/handbook/handbook-amd64.xml?part=1&chap=10#doc
>>> _chap4
>>
>> Yes, thanks, a couple of people posted what it says here the other
>> day. Now I'm puzzling over whether it's good advice.
>>
>> For instance, suppose I want to reinstall the chroot in which I keep
>> an image of my Atom box here on my workstation. Then /etc/mtab has:
>>         /dev/md5 / [...]
>> but once I chroot into /mnt/atom, where the image lives, that's wrong and
>> should be:
>>         /dev/mapper/vg7-atom / [...]
>> because vg7-atom is now the root of the file system.
>>
>> Does the handbook need an update? Or maybe it's right after all
>> because when grub runs its installer it's unconcerned with where
>> it's invoked from.
>>
>> [Wanders off stage-left, muttering and scratching his head...]
>
> *AFTER YOU CHROOT* what are the contents of /proc/self/mounts and
> /proc/mounts ?  Can you copy either of them into /etc/mtab and have the
> correct result?

I duped a Gentoo VM on my laptop, launched it, and looked at the
output of "grep ' / ' /proc/mounts" in the "/mnt" chroot after
mounting "/mnt/proc" before and after the chroot, which is
unsurprisingly the same.

What are you trying to find out?

I haven't used lilo for 12 years at least. Does it operate using
"/proc/self/mounts" or "/etc/mtab"? mount/umount, for example, use
"/etc/mtab". grub-install, AFAIR, uses "/proc/self/mountinfo" as well
as the
"/sys/devices/" hierarchy.

localhost ~ # mount /dev/vdb1 /mnt

localhost ~ # mount -t proc proc /mnt/proc

localhost ~ # chroot /mnt

localhost / # grep ' / ' /proc/mounts
rootfs / rootfs rw 0 0
/dev/disk/by-uuid/fe087ffc-ccb6-48ce-a8f7-a3a6d0fb20e3 / xfs
rw,relatime,attr2,inode64,noquota 0 0
/dev/vdb1 / xfs rw,relatime,attr2,inode64,noquota 0 0

localhost / # exit
exit

localhost ~ # umount /mnt/proc

localhost ~ # chroot /mnt

localhost / # mount -t proc proc /proc

localhost / # grep ' / ' /proc/mounts
rootfs / rootfs rw 0 0
/dev/disk/by-uuid/fe087ffc-ccb6-48ce-a8f7-a3a6d0fb20e3 / xfs
rw,relatime,attr2,inode64,noquota 0 0
/dev/vdb1 / xfs rw,relatime,attr2,inode64,noquota 0 0

localhost / # exit
exit

localhost ~ # xfs_admin -u /dev/vda1
UUID = fe087ffc-ccb6-48ce-a8f7-a3a6d0fb20e3

localhost ~ #

Reply via email to