FS#16347 - [mkinitcpio] kernel panic when booting ext4 partitions without journals

Attached to Project: Arch Linux
Opened by (UNIVAC) - Friday, 25 September 2009, 02:15 GMT
Last edited by Thomas Bächler (brain0) - Friday, 19 February 2010, 17:27 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Tobias Powalowski (tpowa)
Aaron Griffin (phrakture)
Thomas Bächler (brain0)
Architecture i686
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:
initramfs made by mkinitcpio can't boot ext4 partitions that have been modified with tune2fs -O ^has_journal.

Additional info:
mkinitcpio 0.5.26-1
e2fsprogs 1.41.9-1
grub 0.97-16
kernel26 2.6.30.6-1

init makes mention of "Unsupported features" when attempting to mount ext4 partitions without journals. I don't recall the exact exit number that appears next to the "Unsupported features" entry.

Note: Grub is not the culprit. To verify this I've made a custom 30.6-1 kernel (the only change being disabling initramfs) and Grub boots journal-less ext4 partitions just fine.

Steps to reproduce (the lines marked as optional are steps I took when retrying to make initramfs boot the modified partition):

Boot in single user mode.
mount -n -o remount,ro /
tune2fs -O ^has_journal /dev/sdXX (root filesystem)
if prompted, do an e2fsck on the drive
(next line is optional: just to check if your kernel supports mounting it, mine did)
mount -n -o remount,rw /
mkinitcpio -p kernel26 (also optional)
reboot

More about my setup: both my /boot and /home partitions are ext4 ^has_journal ^huge_file. I can't do the same with / because of the aforementioned problems.
This task depends upon

Closed by  Thomas Bächler (brain0)
Friday, 19 February 2010, 17:27 GMT
Reason for closing:  Fixed
Additional comments about closing:  Should be fixed, and no response for my queries.
Comment by Aaron Griffin (phrakture) - Friday, 25 September 2009, 04:26 GMT
We're going to need the actual error message here to diagnose anything.
Comment by (UNIVAC) - Friday, 25 September 2009, 04:52 GMT
Well, to be honest I just tried recreating it and I couldn't.

initram booted it :D

It was probably a lower version of e2fsprogs, a couple of updates from the latest aif iso.

Sorry, lol.
Comment by Thomas Bächler (brain0) - Friday, 25 September 2009, 07:28 GMT
Probably a mistake in klibc's ext4 detection. Use rootfstype=ext4 for now, we will be using blkid quite soon in initramfs, which will solve all our problems.
Comment by Glenn Matthys (RedShift) - Friday, 25 September 2009, 13:17 GMT
IIRC ext4 doesn't support filesystems without journalling at the moment?

By the way, why are you even trying to use a filesystem without journalling? Are you aware of the consequences?
Comment by (UNIVAC) - Friday, 25 September 2009, 19:26 GMT
I run a laptop. What most people recommend for performance, data=writeback, is essentially the same.

UPS/battery, running simple programs like dwm instead of a full-blown DE for stability, it all helps :)

What do you mean that ext4 doesn't support it? The option has been there for a while.
Comment by Aaron Griffin (phrakture) - Friday, 25 September 2009, 19:31 GMT
Hmm, might be relevant if you're using data=writeback. From the mount man page:

data=journal / data=ordered / data=writeback
Specifies the journalling mode for file data. Metadata is always journaled. To use modes other than ordered on the root file system,
pass the mode to the kernel as boot parameter, e.g. rootflags=data=journal.
Comment by (UNIVAC) - Friday, 25 September 2009, 20:14 GMT
I didn't use that -o flag (journal_data_writeback) in tunefs, nor mount it like that in fstab. I went straight to removing the journal altogether.

Anyway, you guys might want to close this since I can't recreate it. :)
Comment by Gabor Woth (kurudisease) - Wednesday, 14 October 2009, 23:25 GMT
I would like to ask for the re-open this issue. I've tried the latest installation package and after a nopain installation system won't boot ext2 or ext4 -O^has_journal file systems. The fallback initrd works, but normal initrd causes kinit panic.
Comment by Thomas Bächler (brain0) - Thursday, 15 October 2009, 21:14 GMT
I have doubts that your issue is related, it sounds more like a screwed up default image. Please provide file lists of your default initramfs image (kernel26.img).
Comment by Gabor Woth (kurudisease) - Saturday, 17 October 2009, 17:50 GMT
You're right. I've replaced the images with a config enabling ext2 modules. After your request i've tried to make new images w/o the modules setting, but it booted up fine. Something could be wrong with the installer's mkinitcpio scripts?
Comment by Ilya (ilya) - Sunday, 22 November 2009, 23:51 GMT
(Forgive my english :)

My troubles begins at installation: I can't create ext4 partition without journal with Arch installer! Official Arch Linux Install Guide says "When asked for (optional) options to mkfs tools, pass arguments which will literally be added when calling mkfs. For example, to disable the journal on ext filesystems: don't do ^has_journal, but rather -O ^has_journal". It creates filesystem WITH journal anyway. Okay, trying another way.

I've reproduced this bug in VirtualBox (it also present on real hardware, but I don't want to experiment with my notebook too much). So, this is my steps.

1) boot archlinux-2009.08-netinstall-i686.img
2) parted: mklabel msdos
3) parted: mkpart primary ext2 0% 100%
4) mkfs.ext4 -O ^has_journal /dev/sda1
5) reboot (just in case) to archlinux-2009.08-netinstall-i686.img again
Now I can see /dev/sda1, but there is no /dev/disk/by-uuid/some-id which points to /dev/sda1
Hm... okay, proceeding.
6) /arch/setup ... manual partitionig without reformatting to save /dev/sda1 ext4 without journal...
7) reboot
Result: http://pic.ipicture.ru/uploads/091123/eK4EaGKnS9.png
Both images (normal and fallback) don't work :(

Adding "rootfstype=ext4" to kernel don't give any result.
Changing "root=/dev/disk/by-uuid/..." to "root=/dev/sda1" gives kernel panic: http://pic.ipicture.ru/uploads/091123/5uOhKWa7L3.png

I can provide more info if needed.

Is there any temportary solution on booting ext4 without journal (simple, without kernel recompilation)?
Comment by Ilya (ilya) - Monday, 23 November 2009, 00:23 GMT
(Forgive my english :)

My troubles begins at installation: I can't create ext4 partition without journal with Arch installer! Official Arch Linux Install Guide says "When asked for (optional) options to mkfs tools, pass arguments which will literally be added when calling mkfs. For example, to disable the journal on ext filesystems: don't do ^has_journal, but rather -O ^has_journal". It creates filesystem WITH journal anyway. Okay, trying another way.

I've reproduced this bug in VirtualBox (it also present on real hardware, but I don't want to experiment with my notebook too much). So, this is my steps.

1) boot archlinux-2009.08-netinstall-i686.img
2) parted: mklabel msdos
3) parted: mkpart primary ext2 0% 100%
4) mkfs.ext4 -O ^has_journal /dev/sda1
5) reboot (just in case) to archlinux-2009.08-netinstall-i686.img again
Now I can see /dev/sda1, but there is no /dev/disk/by-uuid/some-id which points to /dev/sda1
Hm... okay, proceeding.
6) /arch/setup ... manual partitionig without reformatting to save /dev/sda1 ext4 without journal...
7) reboot
Result: http://pic.ipicture.ru/uploads/091123/eK4EaGKnS9.png
Both images (normal and fallback) don't work :(

Adding "rootfstype=ext4" to kernel don't give any result.
Changing "root=/dev/disk/by-uuid/..." to "root=/dev/sda1" gives kernel panic: http://pic.ipicture.ru/uploads/091123/5uOhKWa7L3.png

I can provide more info if needed.

Is there any temportary solution on booting ext4 without journal (simple, without kernel recompilation)?
Comment by Ilya (ilya) - Monday, 23 November 2009, 00:25 GMT
oops, sorry for double
strange F5-effect O_o
Comment by Thomas Bächler (brain0) - Monday, 23 November 2009, 09:27 GMT
This is not an ext4 problem, it doesn't even find sda1. Sadly, you cut away the part where it talks about sda.
Comment by Ilya (ilya) - Monday, 23 November 2009, 11:33 GMT
/dev/sda1 is present, but /dev/disk/by-uuid/*, which must point to /dev/sda1 not!

It seems like initramfs (or whatever, I'm not sure) fails to recognize FS on /dev/sda1 (whih is ext4) then fails to create /dev/disk/by-uuid/* for this device and fails to mount it.

It's a VirtualBox, so no problem to see more: http://pic.ipicture.ru/uploads/091123/iPrIizRgCV.png
At the bottom of the screen you can see contents of /dev:
/dev/sda1 - new system root partition
/dev/sdb1 - archlinux-2009.08-netinstall-i686.img
/dev/disk/by-uuid/f9894... - it is UUID of /dev/sdb1
Comment by Ilya (ilya) - Monday, 23 November 2009, 12:31 GMT
The same system booted from /dev/sdb1 (archlinux-2009.08-netinstall-i686.img), see comments on screen.
http://pic.ipicture.ru/uploads/091123/1eDFpQ2eHG.png
Comment by Thomas Bächler (brain0) - Monday, 23 November 2009, 13:25 GMT
Okay, it seems that the old fstype/vol_id tools in our initramfs are broken. This definitely won't get fixed until I rewrite mkinitcpio to use blkid, but due to lack of time it might take a while. It should work when you don't use UUIDs though.

I could probably fix it in the tools with a quickfix, however I cannot even rebuild the klibc-initramfs tools for unknown reasons, which is yet another reason for the pending mkinitcpio overhaul.
Comment by Ilya (ilya) - Tuesday, 24 November 2009, 03:10 GMT
brain0, thank you for your answer, problem is clear for me now.

My purpose is to install Arch on notebook with SSD, so I need non-journaling FS on a root partition.
Is there an easy temporary workaround (without kernel rebuilding or something like this), or it is better to use ext2 until you fix this bug?
Comment by Thomas Bächler (brain0) - Tuesday, 24 November 2009, 09:29 GMT
You should boot with root=/dev/sda1 (no UUID) and rootfstype=ext4 as an option. That should work, I hope.
Comment by Ilya (ilya) - Friday, 27 November 2009, 03:22 GMT
Yes, it works, but only with ext4 created during install!

For more clarity:

1) Ext4 created, then journal disabled

Ext4 created during install (with default options), then journal disabled (with tune2fs), then booted - FAIL: http://pic.ipicture.ru/uploads/091127/yUnMQCX7lL.png

The same, booted with kernel options "root=/dev/sda1 rootfstype=ext4" - SUCCESS: http://pic.ipicture.ru/uploads/091127/I4zS2xeW5L.png
tune2fs -l /dev/sda1: http://pastebin.com/f6f3c45c1
dmesg: http://pastebin.com/f61587c9

2) Ext4 created without journal at once

Ext4 created BEFORE install with "mkfs.ext4 -O ^has_journal /dev/sda1", then Arch installed without FS recreation (just mounted), then booted - FAIL: http://pic.ipicture.ru/uploads/091127/si7SSe1T9H.png
tune2fs -l /dev/sda1: http://pastebin.com/f4196fa64

The same, booted with kernel options "root=/dev/sda1 rootfstype=ext4" - KERNEL PANIC: http://pic.ipicture.ru/uploads/091127/E28VSA1RcU.png

What's difference between ext4 created without journal at once and ext4 with disabled journal?
Comment by Thomas Bächler (brain0) - Saturday, 06 February 2010, 16:42 GMT
I will defer that bug. If possible, please try the kill-klibc branch of mkinitcpio, see http://mailman.archlinux.org/pipermail/arch-dev-public/2010-January/015117.html (comments about testing are not valid anymore, this will work perfectly without testing). The problem should be solved there.
Comment by Thomas Bächler (brain0) - Sunday, 07 February 2010, 20:53 GMT
This version is in the testing repository now, please verify that it works (or not).

Loading...