# fstab entries ignored for root partition [SOLVED]

## Laser556

I have a problem.

The mount options I have set for my root xfs partition in /etc/fstab are being ignored during boot and I can't think of a way to get them enabled.

Here's the entries in /etc/fstab:

```
/dev/md0      /boot      xfs      noatime      0 2

/dev/md1      none      swap      sw      0 0

/dev/md2      /      xfs      delaylog,noatime,nodiratime,logbufs=8   0 1

/dev/md3      /home      xfs      noatime,nodiratime,logbufs=8      0 2

/dev/cdrom5      /mnt/cdrom   auto      noauto,ro   0 0

#/dev/fd0      /mnt/floppy   auto      noauto      0 0

/dev/sdc2      /mnt/winC   ntfs-3g      rw,uid=1000,gid=1000   0 0

/dev/sdc3      /mnt/winD   ntfs-3g      rw,uid=1000,gid=1000   0 0

none           /var/tmp/portage tmpfs      nr_inodes=1M,size=2000M   0 0

```

This is the output of moun t after boot:

```
rootfs on / type rootfs (rw)

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

proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)

rc-svcdir on /lib64/rc/init.d type tmpfs (rw,nosuid,nodev,noexec,relatime,size=1024k,mode=755)

sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)

debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)

udev on /dev type tmpfs (rw,nosuid,relatime,size=10240k,mode=755)

fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)

devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620)

shm on /dev/shm type tmpfs (rw,nosuid,nodev,noexec,relatime)

/dev/md0 on /boot type xfs (rw,noatime)

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

/dev/sdc2 on /mnt/winC type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096,default_permissions)

/dev/sdc3 on /mnt/winD type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096,default_permissions)

none on /var/tmp/portage type tmpfs (rw,nr_inodes=1M,size=2000M)

binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)

gvfs-fuse-daemon on /home/lali/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=lali)

```

As you can see the logbufs=8 and delaylog options are nowhere to be found.

Doing a mount -o remount / doesn't help either.

mount shows the options as mounted but /proc/mounts doesn't and metadata performance shows no difference if I for example 

time a deletion of /usr/src/linux-2.6.34blabla as would be expected with the delaylog option.

All other partitions except / accept the options i put in /etc/fstab

Can someone please tell me what's going on? 

I have searched the forum but found no answers for this particular problem.

/LarsLast edited by Laser556 on Mon Nov 15, 2010 6:19 pm; edited 1 time in total

----------

## PuckPoltergeist

 *Laser556 wrote:*   

> I have a problem.
> 
> The mount options I have set for my root xfs partition in /etc/fstab are being ignored during boot and I can't think of a way to get them enabled.
> 
> Here's the entries in /etc/fstab:
> ...

 

I'm pretty sure /proc/mounts is wrong here. I've observed the same behavior with btrfs, the fstab-entries for / are silently ignored or at least partially ignored. For me it was the space_cache option that was ignored. I needed to do a remount for /. After this /proc/mounts still showed me the old entries but kernel log showed that the space cache was enabled. 

 *Quote:*   

> 
> 
> All other partitions except / accept the options i put in /etc/fstab
> 
> 

 

It seems to me that some mount options are filtered. The noatime and nodiratime are set for you. (btw. noatime implies nodiratime) I'm a little irritated where the noquota comes from. My system:

```

/dev/sda1               /               btrfs           space_cache,noatime             0 1

/dev/sda2               none            swap            sw              0 0

/dev/sda3               /home/          btrfs           noatime         0 0

...

```

/etc/mtab and /proc/mounts before remount

```

rootfs / rootfs rw 0 0

/dev/root / btrfs rw,noatime,noacl 0 0

proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0

rc-svcdir /lib/rc/init.d tmpfs rw,nosuid,nodev,noexec,relatime,size=1024k,mode=755 0 0

sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0

udev /dev tmpfs rw,nosuid,relatime,size=10240k,mode=755 0 0

devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620 0 0

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

/dev/sda3 /home btrfs rw,noatime 0 0

rpc_pipefs /var/lib/nfs/rpc_pipefs rpc_pipefs rw 0 0

```

```

rootfs / rootfs rw 0 0

/dev/root / btrfs rw,noatime,noacl 0 0

proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0

rc-svcdir /lib/rc/init.d tmpfs rw,nosuid,nodev,noexec,relatime,size=1024k,mode=755 0 0

sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0

udev /dev tmpfs rw,nosuid,relatime,size=10240k,mode=755 0 0

devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620 0 0

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

/dev/sda3 /home btrfs rw,noatime,noacl 0 0

rpc_pipefs /var/lib/nfs/rpc_pipefs rpc_pipefs rw,relatime 0 0

```

and after 'mount -o remount /'

```

rootfs / rootfs rw 0 0

/dev/root / btrfs rw,noatime,space_cache 0 0

proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0

rc-svcdir /lib/rc/init.d tmpfs rw,nosuid,nodev,noexec,relatime,size=1024k,mode=755 0 0

sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0

udev /dev tmpfs rw,nosuid,relatime,size=10240k,mode=755 0 0

devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620 0 0

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

/dev/sda3 /home btrfs rw,noatime 0 0

rpc_pipefs /var/lib/nfs/rpc_pipefs rpc_pipefs rw 0 0

```

```

rootfs / rootfs rw 0 0

/dev/root / btrfs rw,noatime,space_cache 0 0

proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0

rc-svcdir /lib/rc/init.d tmpfs rw,nosuid,nodev,noexec,relatime,size=1024k,mode=755 0 0

sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0

udev /dev tmpfs rw,nosuid,relatime,size=10240k,mode=755 0 0

devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620 0 0

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

/dev/sda3 /home btrfs rw,noatime 0 0

rpc_pipefs /var/lib/nfs/rpc_pipefs rpc_pipefs rw 0 0

```

and the last lines from dmesg:

```

btrfs: enabling disk space caching

btrfs: force clearing of disk cache

```

----------

## platojones

Root FS stuff should get passed from the kernel boot loader options.  Have a look at these kernel options and set them up as needed in grub.  Especially note the 'rootflags' option:

```

        ro              [KNL] Mount root device read-only on boot

        root=           [KNL] Root filesystem

        rootdelay=      [KNL] Delay (in seconds) to pause before attempting to

                        mount the root filesystem

        rootflags=      [KNL] Set root filesystem mount option string

        rootfstype=     [KNL] Set root filesystem type

        rootwait        [KNL] Wait (indefinitely) for root device to show up.

                        Useful for devices that are detected asynchronously

                        (e.g. USB and MMC devices).

        rw              [KNL] Mount root device read-write on boot

```

----------

## NeddySeagoon

Laser556,

/etc/fstab cannot be used to mount root as it can't be read until root is mounted, then its too late.

The entry for root is only used by rootfsck, to know how to check the rootfs on startup.

You need to pass the options to the kernel in grub.conf, on the kernel line.

----------

## Laser556

Thanks for the info!

Rootflags was the key  :Smile: 

I think we should change the text in Gentoo Handbook to reflect this.

I don't think its clearly described there.

----------

## NeddySeagoon

Laser556,

If you which to have the handbook changed, open a bug at bugs.gentoo.org. That will ensure it gets into the right developers work queue.

It doesn't mean you bug will be accepted - just that it will be considered.

----------

## PuckPoltergeist

 *NeddySeagoon wrote:*   

> Laser556,
> 
> /etc/fstab cannot be used to mount root as it can't be read until root is mounted, then its too late.
> 
> The entry for root is only used by rootfsck, to know how to check the rootfs on startup.
> ...

 

I've assumed that the fstab entries for rootfs are used when the fs is remounted rw. Some seem to be, e.g. the noatime.

----------

