# two root entries in /proc/mounts, neither in fstab?

## drwook

hey guys,

Well this has confused me, at the top of /proc/mounts (and /etc/mtab) I've got this;

 *Quote:*   

> 
> 
> rootfs / rootfs rw 0 0
> 
> /dev/root / reiserfs rw,noatime 0 0
> ...

 

I don't recall making one, but /dev/root appears to be a symlink to /dev/hdc3 (the actual root partition for the system).  Not sure if this may be udev upgrade weirdness?  (or outside chance openrc/baselayout-2, but I can't see it if it is...)

my /etc/fstab starts ;

 *Quote:*   

> 
> 
> /dev/hdc6               /boot           ext2            noauto,noatime         1 1
> 
> /dev/hdc3               /               reiserfs        noatime                0 0
> ...

 

but /proc/mounts has no mention of hdc3 at all....?

Maybe I'm being stupid and having a bad day, but if so can someone point out what's going on here?  :Smile: 

----------

## Cazzantonio

I have the same problem, but it is an opernc/baselayout-2 issue since it happened after that upgrade.

It isn't an udev issue since a similar installation with same udev and stable baselayout doesn't have two root mounted.

----------

## enito

Hi, any way for fix this? i tryed manualy edit mtab and delete dupped / and setup correctly, but when you reboot , all back again, duped entry...thx

----------

## Dairinin

Looks like a new "feature" to me. Had to change "/dev/sdb6" to "/dev/root" in cacti data source.

----------

## uzz75

I don't think it's from udev

# cd /etc/udev/

# grep rootfs * -R

----------

## Dairinin

It's here:

/lib64/udev/write_root_link_rule

called from /lib/rcscripts/addons/udev-start.sh

----------

## enito

and how we can disable this new feature?

greets

----------

## ABCDwp

The actual change is that baselayout-2/openrc copies /proc/mounts onto /etc/mtab during boot - it does so, so that the mount table in /etc/mtab is correct (/proc/mounts is what the kernel actually mounted - not what you thought you mounted).  The /dev/root symlink is so that things make a little more sense to the average end-user, but is unneeded - the kernel will call the initramfs "rootfs" and the root=/dev/XYZ parameter "/dev/root" no matter what you do (IIRC).

----------

## drwook

 *ABCDwp wrote:*   

> The actual change is that baselayout-2/openrc copies /proc/mounts onto /etc/mtab during boot - it does so, so that the mount table in /etc/mtab is correct (/proc/mounts is what the kernel actually mounted - not what you thought you mounted).  The /dev/root symlink is so that things make a little more sense to the average end-user, but is unneeded - the kernel will call the initramfs "rootfs" and the root=/dev/XYZ parameter "/dev/root" no matter what you do (IIRC).

 

hmm.  No initramfs here so can't quite see why there's a 'double mount' on /.  I won't have much of a chance to dig until the weekend but I'll check it out then....

----------

## The Unknown

This is not new, I have stable systems with the old baselayout and its the exact same.

Your not really double mounting root either. This quote is from some kernel documentation

 *Quote:*   

> 
> 
> 70	What is rootfs?
> 
> 71	---------------
> ...

 

And the /dev/root symlink is the same as well, my guess is its the same reason as why they provide /dev/cdrom symlinks etc.

----------

## Quaoar

but this "feature" definitely hit me with baselayou2/openrc - never had this before  and I still don't have it on the baselayout1-machines.

----------

## mv

I had googled about this quite a while ago. From my memory, these were the results:

baselayout-1 was once artificially modified to remove rootfs.

openrc wants to be more conformal to the standard (e.g. it should not run only under gentoo) and since some scripts out there rely on /dev/root, openrc makes no attempt to "hide" this filesystem.

----------

## Cazzantonio

I understand that this rootfs, mounted "below" the standard /dev/root, is something that the kernel does independently of openrc.

/proc/mounts lists correctly this rootfs with or without openrc. What openrc does is exactly copying all entries from /proc/mounts in /etc/mtab, so that's why this rootfs appears with baselayout-2.

What I don't really understand is what this rootfs really is. During the boot process root get mounted readonly and then remounted rw. This rootfs isn't the first mount of the root filesystem, since it is mounted rw. Also the rw remount should be made with "mount -o remount", which won't mount /dev/root above the old mount.

rootfs is present in ubuntu too so it isn't something gentoo-specific.

Can anyone explain me what rootfs is and what is there for?

----------

## Desintegr

Another problem : options in /etc/fstab are not respected :

/etc/fstab :

```

[...]

/dev/sda2      /         xfs      noatime,nodiratime,logbufs=8      0 0

/dev/sda6      /home      xfs      noatime,nodiratime,logbufs=8      0 0

[...]
```

mount :

```

rootfs on / type rootfs (rw)

/dev/root on / type xfs (rw,noatime,nodiratime,noquota)

[...]

/dev/sda6 on /home type xfs (rw,noatime,nodiratime,logbufs=8)

[...]
```

The logbufs=8 option is ignored for /.

----------

## ABCDwp

 *Desintegr wrote:*   

> The logbufs=8 option is ignored for /.

 

What happens if you try to mount -oremount,logbufs=8 /?  (If there is an error, then you will have to change the mount options on the kernel command line - this has not changed from baselayout-1, it may only have appeared to work, while not actually doing anything).

----------

## Desintegr

Just after boot :

```
/dev/root on / type xfs (rw,noatime,nodiratime,noquota)
```

After mount -o remount / :

```
/dev/root on / type xfs (rw,noatime,nodiratime,logbufs=8)
```

It's ok because the option is already in the fstab.

After mount -oremount,logbufs=8 / :

```
/dev/root on / type xfs (rw,noatime,nodiratime,logbufs=8,logbufs=8)
```

The option appears twice because it is both in the fstab and in the command line.

----------

## BitJam

I've run into this too after upgrading to baselayout-2.  I don't mind the two / entries so much, what seems broken to me is that the device that is actually mounted at / no longer shows up in the output of df:

```
$ df -h

Filesystem            Size  Used Avail Use% Mounted on

rootfs                 31G   15G   15G  50% /

/dev/root              31G   15G   15G  50% /
```

I don't understand the purpose of hiding/obscuring this rather important information.  It seems like just a horrible idea.  I suppose I could process the output of df and run readlink on the first parameter but why make people go through all this effort?   IMO this is a big bug.

----------

## krinn

it's an old thing : https://forums.gentoo.org/viewtopic-p-6204542-highlight-rootfs.html#6204542

and the new openrc (it wasn't doing it by this time) now auto mount itself shm (you can check it with mount)

So if anyone wish to disable the rootfs he should hack sysfs to remove shm mount and this should remove rootfs (as this user was doing by this time, when openrc wasn't mounting shm, we were ask to add that in fstab)

shm			/dev/shm	tmpfs		nodev,nosuid,noexec	0 0

dunno if this work to just disable shm fs mount, AND, more dunno how your system will play if you do that.

as it's the new "standard" i can just tell you that you shouldn't disable it, as some new tools might use and expect its presence (and specially as it was add by kernel at first)

----------

## theBlackDragon

I've run into this as well now, so should I replace the direct link to my root partition with /dev/root ?

Right now I get this:

```
% df -h

rootfs                293G  121G  158G  44% /

/dev/sda3             293G  121G  158G  44% /
```

This seems to confuse phpsysinfo and Munin, both think I have 293G more space than I actually have which is a tad annoying.

They also seem to be mounted with different options:

```
% mount

rootfs on / type rootfs (rw)

/dev/sda3 on / type ext3 (rw,noatime,errors=continue,barrier=0,data=ordered)
```

Is there some proper documentation about this? I'm obviously confused and while my install still works properly the change causes annoying issues (as mentioned above)

----------

