Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved]root partition not mounted respecting fstab options
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
Esmeraldo
n00b
n00b


Joined: 12 Jan 2009
Posts: 5

PostPosted: Wed Jun 10, 2015 2:19 pm    Post subject: [solved]root partition not mounted respecting fstab options Reply with quote

HI,

After an initial Gentoo installation on my arm board, i see that the main ext4 partition is mounted with weird options instead of the ones i've written in the /etc/fstab.

My arm board uses a microSD card instead of a hard disk, the entire OS is installed there. The microSD card is /dev/mmcblk0

my /etc/fstab:

Code:
# <fs>       <mountpoint>    <type>     <opts>                                                  <dump/pass>
/dev/mmcblk0p1       /       ext4      noatime,data=writeback,commit=600,errors=remount-ro       0       0


After booting into the system i see the root partition with totally different options:

Code:
# cat /proc/self/mounts

/dev/root    /    ext4    rw,relatime,stripe=1024    0 0
(...)


As you can see totally different mount options. 8O
I can confirm that this line works in Debian Jessie so i'm clueless...

What can i do to make Gentoo obey the fstab mount options?

Thanks for answering :(
_________________
ARM imx.6 dual core Cubox-i


Last edited by Esmeraldo on Sat Jun 13, 2015 7:32 am; edited 1 time in total
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7071

PostPosted: Wed Jun 10, 2015 3:41 pm    Post subject: Reply with quote

There's a limit to remounting with writeback, i don't know why/where this comes from.

So make sure your kernel is booting directly with the right options so it could remount it with them

See:
Code:
>umount /dev/sdd1
>mount /dev/sdd1 -n -t ext4
>mount | grep sdd1
/dev/sdd1 on /mnt/backup type ext4 (rw,noatime,data=ordered)
>LC_ALL=C mount /dev/sdd1 -n -t ext4 -o remount,rw,data=writeback
mount: /mnt/backup not mounted or bad option

       In some cases useful info is found in syslog - try
       dmesg | tail or so.
>LC_ALL=C mount /dev/sdd1 -n -t ext4 -o remount,rw,data=ordered
>umount /dev/sdd1
>LC_ALL=C mount /dev/sdd1 -n -t ext4 -o ro,data=writeback
>mount | grep sdd1
/dev/sdd1 on /mnt/backup type ext4 (ro,noatime,data=writeback)
>LC_ALL=C mount /dev/sdd1 -n -t ext4 -o remount,rw,data=writeback
>mount | grep sdd1
/dev/sdd1 on /mnt/backup type ext4 (rw,noatime,data=writeback)


Got it?
- You can always remount it with data=ordered the way you wish
- You can only remount it with data=writeback|journal if it was mount with it first

So you must pass the writeback as kernel parameter, so it will be mount with it, and later remount will works
Code:
   rootflags=   [KNL] Set root filesystem mount option string


You should have something like that:
Code:
dmesg | grep "command line"
[    0.000000] Kernel command line: clocksource=hpet root=/dev/sdb2 rootflags=data=writeback


However i remember an old bug suggesting it should be given thru tune2fs: (ah got it! eheh i'm amazing sometimes: https://bugs.gentoo.org/show_bug.cgi?id=249971#c3)
But the rootflags should works if you trust the manpage.

If you are wondering why it must be done like that, i shall remind you to reread my 1st phrase, you know the part next to the comma
If you are really wondering but how/why... The best answer is:
man mount wrote:
data={journal|ordered|writeback}
Specifies the journaling mode for file data. Metadata is always journaled. To use modes other than ordered on the root filesystem, pass the
mode to the kernel as boot parameter, e.g. rootflags=data=journal.
Back to top
View user's profile Send private message
Esmeraldo
n00b
n00b


Joined: 12 Jan 2009
Posts: 5

PostPosted: Wed Jun 10, 2015 3:48 pm    Post subject: Reply with quote

A bit of progress:

I've found that i must pass the "ro" kernel parameter instead of "rw" for proper mount the root partition with fstab options.

Updated U-boot script with "ro" instead of the "rw wich used to be":
Code:
setenv bootargs 'root=/dev/mmcblk0p1 rootfstype=ext4 [b]ro[/b] console=tty1 rootwait consoleblank=0 video=mxcfb0:dev=hdmi,1920x1080M@60,if=RGB24,bpp=32'
(...)


Now i can see that the root partition is mounted with SOME of the fstab options, but no all, and with some weird unwanted ones:

Code:
# cat /proc/self/mounts
/dev/root / ext4 rw,noatime,errors=remount-ro,commit=600,stripe=1024 0 0


correct: noatime, errors=remount-ro, commit=600
missing: data=writeback
unwanted: stripe=1024

Edit: it seems that you and me posted at the same time, Krinn. I'll test your info and give back results
Thank you for answering
_________________
ARM imx.6 dual core Cubox-i
Back to top
View user's profile Send private message
s4e8
Guru
Guru


Joined: 29 Jul 2006
Posts: 309

PostPosted: Thu Jun 11, 2015 8:48 am    Post subject: Reply with quote

You'd better set default mount options via tune2fs
tune2fs -e remount-ro -o journal_data_writeback /dev/mmcblk0p1
Back to top
View user's profile Send private message
Esmeraldo
n00b
n00b


Joined: 12 Jan 2009
Posts: 5

PostPosted: Sat Jun 13, 2015 7:31 am    Post subject: Reply with quote

oooops, i think i know why data write back does not work.

My ext4 filesystem was created with journaling disabled, following the wiki recipe in the website of my device.
Code:
mkfs.ext4 -O ^has_journal -E stride=2,stripe-width=1024 -b 4096 /dev/sdX1

So it seems that choosing a journaling mode for a partition with journaling disabled is... dumb
ooops ! :oops: :oops: :oops:

I feel sorry for making you wate your time :oops:
_________________
ARM imx.6 dual core Cubox-i
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