Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
HELP What is rootfs entry in /etc/mtab - SOLVED
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Moriah
Advocate
Advocate


Joined: 27 Mar 2004
Posts: 2386
Location: Kentucky

PostPosted: Sat May 07, 2011 4:08 am    Post subject: HELP What is rootfs entry in /etc/mtab - SOLVED Reply with quote

In the new baselayout conversion guide, it ends with:
Quote:

rootfs entry in /etc/mtab

Previously, the initial rootfs entry was removed from /etc/mtab, and only the real root / entry was present. The duplicate rootfs item was actually added back during shutdown. In OpenRC, both entries must be present for full support of initramfs and tmpfs-on-root. This also means that less writing is required during shutdown.

Since all my systems use initramfs, I need to understand just exactly what this "rootfs" item is all about. Since I never had to worry about it before, and now it saysz my systems won't boot without it, I would like a little more detailed explanation of just exactly what I have to do to get it to work with an initramfs.

Thanks! :D
_________________
The MyWord KJV Bible tool is at http://www.elilabs.com/~myword

Foghorn Leghorn is a Warner Bros. cartoon character.


Last edited by Moriah on Mon May 09, 2011 10:14 pm; edited 1 time in total
Back to top
View user's profile Send private message
salahx
Guru
Guru


Joined: 12 Mar 2005
Posts: 559

PostPosted: Sat May 07, 2011 4:23 am    Post subject: Reply with quote

See /Documentation/filesystems/ramfs-rootfs-initramfs.txt for the ugly details, but essentialy, is this

rootfs is a special instance of rootfs/tmpfs. Its where the the contents of the initramfs are dumped into. It always exists, there no way to disable it - because its essentially "free" anyway.

Furthermore, there's no way to unmount it, either. It would add more bloat adding code to consider the special case of no rootfs, so just cheaper just to never allow it be unmounted. One of the last things the initramfs code does is delete the contents of the rootfs, so we waste a single "struct inode" (53 bytes last time I checked)

So from now you'll see 2 root entries: one for the inital rootfs (in the initramfs) and one of the the real root. However now instead of baselayout hiding it for you you'll just have to ignore the line mentally.
Back to top
View user's profile Send private message
Moriah
Advocate
Advocate


Joined: 27 Mar 2004
Posts: 2386
Location: Kentucky

PostPosted: Sat May 07, 2011 5:19 am    Post subject: Reply with quote

But do I have to manually do anything to get the box to boot after the change-over? Do I have to edit a file or something?
_________________
The MyWord KJV Bible tool is at http://www.elilabs.com/~myword

Foghorn Leghorn is a Warner Bros. cartoon character.
Back to top
View user's profile Send private message
cach0rr0
Bodhisattva
Bodhisattva


Joined: 13 Nov 2008
Posts: 4123
Location: Houston, Republic of Texas

PostPosted: Sat May 07, 2011 6:05 am    Post subject: Reply with quote

Moriah wrote:
But do I have to manually do anything to get the box to boot after the change-over? Do I have to edit a file or something?


nope. mtab should be generated automagically

that explanation in the openrc migration guide isn't a suggestion of something you need to do, but rather an explanation of why something was done within openrc

Mainly because people are often confused by seeing two instances of root when typing 'mount'

Code:

ricker ~ # mount |grep root
rootfs on / type rootfs (rw)
/dev/mapper/root on / type ext3 (rw,noatime,commit=0)


running an initramfs here myself for that same purpose - root crypto - on two machines
_________________
Lost configuring your system?
dump lspci -n here | see Pappy's guide | Link Stash
Back to top
View user's profile Send private message
Moriah
Advocate
Advocate


Joined: 27 Mar 2004
Posts: 2386
Location: Kentucky

PostPosted: Sat May 07, 2011 6:43 am    Post subject: Reply with quote

I am running root crypto on my laptop, but I run root lvm on all my linux boxes so I can take a snapshot before the nightly backups. 8)
_________________
The MyWord KJV Bible tool is at http://www.elilabs.com/~myword

Foghorn Leghorn is a Warner Bros. cartoon character.
Back to top
View user's profile Send private message
cach0rr0
Bodhisattva
Bodhisattva


Joined: 13 Nov 2008
Posts: 4123
Location: Houston, Republic of Texas

PostPosted: Sat May 07, 2011 8:52 am    Post subject: Reply with quote

ah right. yeah, thankfully once you get the hang of writing an initramfs, the difference between the two is very minimal.
instead of a cryptsetup luksOpen, a vgscan/vgchange, all sorted.

the openrc migration should be totally painless for both. Very good automation there (except for one fella I helped a while back who forgot to run dispatch-conf after the update ;) )
_________________
Lost configuring your system?
dump lspci -n here | see Pappy's guide | Link Stash
Back to top
View user's profile Send private message
Moriah
Advocate
Advocate


Joined: 27 Mar 2004
Posts: 2386
Location: Kentucky

PostPosted: Mon May 09, 2011 4:56 pm    Post subject: Reply with quote

If you recall from my thread a year and a half ago, "Setting up a laptop with Pappy's Seeds", I boot my laptop from a usb stick. The laptop's internal SSD is fully encrypted at the /dev/sda level, and then lvm sits on top of that, without any partitions at all. The root filesystem is a logical device under lvm, so it can be snapshotted before backups, etc.

I run cryptsetup luksOpen *BEFORE* I run vgscan ; vgchange -a y so the whole disk is encrypted. 8)

After I get the login prompt, I remove the usb stick I booted from.
_________________
The MyWord KJV Bible tool is at http://www.elilabs.com/~myword

Foghorn Leghorn is a Warner Bros. cartoon character.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum