Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 273803 - Adding "rootflags=data=journal" to boot flags doesn't enable full journaling for ext3
Summary: Adding "rootflags=data=journal" to boot flags doesn't enable full journaling ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: nm (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-12 01:49 UTC by Timothy Miller
Modified: 2010-01-01 17:47 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Handbook patch to describe usage of rootflags and real_rootflags for bootloader (hb-install-x86+amd64-bootloader.patch,692 bytes, patch)
2009-09-24 19:46 UTC, Mike Pagano
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Timothy Miller 2009-06-12 01:49:09 UTC
I've read several web pages that explain how to switch ext3 to data=journal mode on the root file system.  Such as this one:

http://www.gentoo.org/doc/en/articles/l-afig-p8.xml?style=printable
(Search for "rootflags".)

They explain that one method of enabling it involves adding "data=journal" to the mount flags in /etc/fstab AND adding "rootflags=data=journal" to the boot options in grub.conf.

For example:
    kernel /boot/kernel-genkernel-x86_64-2.6.29-gentoo-r4 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/md3 vga=0x307 video=vesafb:mtrr:3,ywrap domdadm rootflags=data=journal
And 
    /dev/md3                /               ext3            data=journal            0 1


When I did that, my system wouldn't mount the root file system read/write.  I came to realize that this was because the boot options "disagreed" with fstab.  What I found I had to do was chose the other option, which is to use tune2fs to add the data_journal flag.  Then it worked fine.

So, either I put rootflags=data=journal in the wrong place (where else can I put it), or the option doesn't work.  I don't know if this is a grub bug or a kernel bug, but the option is completely ignored.  Alternatively, if this is officially no longer supported, then perhaps it should be removed from the docs to avoid further confusion.


Reproducible: Always
Comment 1 Daniel Drake (RETIRED) gentoo-dev 2009-06-21 14:47:07 UTC
sounds like a bug in your initramfs (/linuxrc) -- when you use an initramfs, the usual root mounting code is not followed and instead it is up to the initramfs to implement things like rootflags= (or decide to ignore them). Which initramfs are you using?
Comment 2 Timothy Miller 2009-08-11 18:27:04 UTC
How do I TELL which intramfs I'm using?
Comment 3 John M. Drescher 2009-08-25 03:13:17 UTC
Does it have anything to do with this:

http://bugs.gentoo.org/122672

I found this bug here because using rootflags with a genkernel initramfs does not work for me. The bugreport suggests that real_rootflags is what I should use. However that was 2006 so things may have changed...
Comment 4 John M. Drescher 2009-08-25 03:21:37 UTC
I have verified that real_rootflags works while rootflags does not for genkernel compiled kernels. Well at least the one I am using and

jmd0 ~ # equery l genkernel
 * Searching for genkernel ...
[IP-] [  ] sys-kernel/genkernel-3.4.10-r2 (0)
Comment 5 Timothy Miller 2009-08-25 03:22:37 UTC
That's interesting.  I'd done quite a lot of googling to solve this problem, and I never saw that flag anywhere, and no one on IRC had a solution either.  If this flag is the answer, it's well hidden (alas, like so many others).
Comment 6 Timothy Miller 2009-08-25 03:27:15 UTC
So I guess I'd like to amend this bug report, stating that the bug actually resides here, in this document that is apparently wrong:

http://www.gentoo.org/doc/en/articles/l-afig-p8.xml?style=printable

It says:  "So, if you'd like to put your root filesystem into full data journaling mode, add rootflags=data=journal to your kernel boot options."

Which apparently isn't true.
Comment 7 John M. Drescher 2009-08-25 03:29:15 UTC
The bug report was the second google hit for realroot after this one. Anyways I
am booting with real_rootflags=data=writeback without data=writeback in my
/etc/fstab and it booted with / mounted as expected. I did have that in
/etc/fstab before I found the real_rootflags and I had the ro / like you. 
Comment 8 John M. Drescher 2009-08-25 03:30:42 UTC
(In reply to comment #6)
> So I guess I'd like to amend this bug report, stating that the bug actually
> resides here, in this document that is apparently wrong:
> 
> http://www.gentoo.org/doc/en/articles/l-afig-p8.xml?style=printable
> 
> It says:  "So, if you'd like to put your root filesystem into full data
> journaling mode, add rootflags=data=journal to your kernel boot options."
> 
> Which apparently isn't true.
> 

I believe this is true if you are not using the real_root kernel parameter. 
Comment 9 John M. Drescher 2009-08-25 03:34:10 UTC
(In reply to comment #7)
> The bug report was the second google hit for realroot after this one. 
>
I meant rootflags but now I can not find it in google. I am not sure what magic term I searched for but it was the second hit.. 
Comment 10 Timothy Miller 2009-08-25 13:38:18 UTC
(In reply to comment #8)
> (In reply to comment #6)
> > So I guess I'd like to amend this bug report, stating that the bug actually
> > resides here, in this document that is apparently wrong:
> > 
> > http://www.gentoo.org/doc/en/articles/l-afig-p8.xml?style=printable
> > 
> > It says:  "So, if you'd like to put your root filesystem into full data
> > journaling mode, add rootflags=data=journal to your kernel boot options."
> > 
> > Which apparently isn't true.
> > 
> 
> I believe this is true if you are not using the real_root kernel parameter. 
> 

Then why doesn't the gentoo documentation explain this?  We're told to use the real_root parameter:

http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=10

Quoting the page:

kernel /boot/kernel-genkernel-x86-2.6.24-gentoo-r5 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/sda3

The bug is in the documentation.  If you're using genkernel, then you'll get in trouble because the docs tell you to use real_root but neglect to tell you to use real_rootflags if you need any.

A defining characteristic of Gentoo is that most things have to be done manually, so users rely on complete documentation.  In fact, much of Gentoo just IS documentation.  We're not in an Ubuntu or MacOS world where things are automatic and have nice little GUIs that show us all the options.  We NEED this documentation just to function.  I know _I_ do because primarily I'm a chip designer and don't always like cramming my head with all of this sysadmin detail.

Keep in mind that I'm not blaming anyone in particular.  Considering how long this bug report has gone unanswered (Thank you Mr. Drescher!), it appears that even Gentoo devs don't know about the real_rootflags option.  If anyone's to blame, it's the grub devs for not documenting their stuff.  In any case, now that we know the answer, we need to make sure that the docs get fixed.  (I might fix it myself if I had access, although I'm not sure I want to open that can of worms.)
Comment 11 George Kadianakis (RETIRED) gentoo-dev 2009-08-28 20:44:28 UTC
Thanks for the report and the debugging, gentlemen!
I CC the Gentoo Documentation team, to see what's their opinion on the matter :)
Comment 12 Mike Pagano gentoo-dev 2009-09-24 17:17:13 UTC
Thanks, Timothy for finding this. You definitely need to use REAL_ROOTFLAGS.

This is documented in bug #122672 and has been in place since 11/2006.  

I'll make a patch for the documentation and assign to doc team for their approval/editing.

Comment 13 Mike Pagano gentoo-dev 2009-09-24 19:46:18 UTC
Created attachment 205134 [details, diff]
Handbook patch to describe usage of rootflags and real_rootflags for bootloader

When configuring mount options in the bootloader config file, the user must use real_rootflags if the real_root parameter is used. If the root= parameter is used, the rootflags= parameter is used to pass options.
Comment 14 Mike Pagano gentoo-dev 2009-09-24 19:46:43 UTC
Patch attached and assigning to doc team for review/edit/committal/etc.
Comment 15 nm (RETIRED) gentoo-dev 2009-09-24 20:27:40 UTC
Thanks for investigating, and for the patch, Mike.

Fixed in CVS.
Comment 16 Timothy Miller 2009-09-24 21:47:01 UTC
Yes.  Thank you very much for fixing this.
Comment 17 Zhang Le (RETIRED) gentoo-dev 2010-01-01 16:30:10 UTC
(In reply to comment #13)
> Created an attachment (id=205134) [details]
> Handbook patch to describe usage of rootflags and real_rootflags for bootloader
> 
> When configuring mount options in the bootloader config file, the user must use
> real_rootflags if the real_root parameter is used. If the root= parameter is
> used, the rootflags= parameter is used to pass options. 
> 

http://bugs.gentoo.org/attachment.cgi?id=205134&action=view

Hi, sorry to bring this up again, but the above patch make me a little confused:
What's the difference between "configuration file contains the real_root parameter" and "real_root defines the root mount point"? If the latter is true, the former must be true. Isn't it? 
Comment 18 nm (RETIRED) gentoo-dev 2010-01-01 17:47:18 UTC
(In reply to comment #17)

You're right. I rewrote it so that it would make sense: that if you use real_root, then use real_rootflags.