# HELP What is rootfs entry in /etc/mtab - SOLVED

## Moriah

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!    :Very Happy: 

----------

## salahx

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.

----------

## Moriah

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?

----------

## cach0rr0

 *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'

```

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

----------

## Moriah

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.    :Cool: 

----------

## cach0rr0

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  :Wink:  )

----------

## Moriah

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.    :Cool: 

After I get the login prompt, I remove the usb stick I booted from.

----------

