From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 47F90138A1F for ; Tue, 22 Apr 2014 11:30:07 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 78603E0929; Tue, 22 Apr 2014 11:30:00 +0000 (UTC) Received: from mail-la0-f67.google.com (mail-la0-f67.google.com [209.85.215.67]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 374BFE087F for ; Tue, 22 Apr 2014 11:29:59 +0000 (UTC) Received: by mail-la0-f67.google.com with SMTP id gl10so1485570lab.2 for ; Tue, 22 Apr 2014 04:29:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=kYqN/I8r3RzF1pEzDZmE8Pf/4bK43ntf30t/5W1liDg=; b=Na1suaBvQECc00AWinHpCHSJJCMJX+6GSkrsZ/C6jrQ0iPFT7Pe1vjVWcwVivIsT8S byQVCCJCla/vNNx81pvC0gsZvRVz4FI20QM0TPBX8awZP1SgHbGWh2LvvHZHjLR6ZUFZ jq353iPzeAnNupxNoDiLgwF6QvjRqAnmTG8YLcuS5SUo40yYzPr6+ILTUNTIzbRBKqPp sGTPNJHR9qzA+M9GmE3kmB7QqY4UC3HuKdOfDGzivsZEP29F2ND7pujEPlT3xPISiWMM z7x4/1Dkr1y2ovze5U+fOlcdAkdmZHV5Dv8YhKXtqLEY1orQ9xKJ8UcFoR2EdSTfCJIr s1GA== Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 X-Received: by 10.152.21.137 with SMTP id v9mr1465827lae.44.1398166197373; Tue, 22 Apr 2014 04:29:57 -0700 (PDT) Received: by 10.152.125.106 with HTTP; Tue, 22 Apr 2014 04:29:57 -0700 (PDT) In-Reply-To: <20140421234445.GA9433@waltdnes.org> References: <20140419114318.GC1084@waltdnes.org> <1568743.81bfSX6GRC@wstn> <20140421005556.38abbcf2@gentoo.org> <5301095.8kd1OTifEl@wstn> <20140421234445.GA9433@waltdnes.org> Date: Tue, 22 Apr 2014 07:29:57 -0400 Message-ID: Subject: Re: [gentoo-user] Output of "mount" and "cat /etc/mtab" inside install chroot? From: Tom H To: Gentoo User Content-Type: text/plain; charset=UTF-8 X-Archives-Salt: 5df863d5-8897-43d5-afae-ff29c3996777 X-Archives-Hash: e863b57950a8813ae920745b69d9b3eb On Mon, Apr 21, 2014 at 7:44 PM, Walter Dnes 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 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 ~ #