Slackware 12.2 + RAID-1 + LVM + LUKS encrypted root
Dear all,
after some very busy months I am back with something that appears to be a challenge. For me, at least, that is. I am trying to get Slackware 12.2 running on a system with two identical harddiscs using RAID-1, LVM and LUKS. /dev/md0 is unencrypted /boot /dev/md1 is for everything else and LUKS encrypted Here is what I get: Code:
[...] luks+lvm+raid (And here I want to apologise for not delivering the promised mini-HOWTO; I was fully occupied with partially unplanned tasks, so sorry. I'll try my very best to deliver, this time, once my current problems with 12.2 are understood and solved...) The system is still the same, however, the results of upgrading or installing 12.2 are different. The system refuses to boot. The screen messages during boot seem to suggest, that the RAID system is "seen" by the system, but the encrypted filesystem is not. I can boot with the installation DVD, however, and Code:
chroot Thanks for any hints! gargamel |
Is this your 12.1 system that you upgraded, or is it a new system? I assume that if it's an upgrade that you followed the instructions meticulously (like the rc.udev part that seems to get overlooked) and that you made a new initrd.gz and that it all seemed to go without error.
I've been thinking about upgrading, but I've been nervous that the complexity of the setup (luks+lvm+raid etc) and the numerous little gotchas that seem to have occurred with 12.2 would make a lot of work... |
For your convenience, here is what I did.
1. Boot with the installation DVD, login as root 2. Start RAID-1 Code:
# mdadm -Es > /etc/mdadm.conf Code:
# cryptsetup luksOpen /dev/md1 slackluks Code:
# vgscan --mknodes Code:
# setup /dev/cryptvg/root as root (/) /dev/md0 as /boot and /dev/cryptvg/home as /home. I chose "Quick format" for root and /boot, but no formatting for /home. Install full system from DVD. Configure system, mainly LILO: Trying "simple" install to MBR with UTF-8 console support. After a few more clicks, EXIT the setup procedure. Code:
Installation of Slackware Linux is complete. Code:
# mount Code:
# chroot /mnt Code:
append=" vt.default_utf8=1" Code:
# cd /boot 7. Reboot! I get these messages during boot time. Code:
[...] Repeat steps 1 through 4. 9. Switch to generic SMP kernel Code:
# mount /dev/cryptvg/root /mnt Code:
# ls -l /etc/rc.d/rc.modules 10. Create initrd It's time to create the initrd. The mkinitrd command tends to get lengthy in complex environments. It is easier to edit Code:
/etc/mkinitrd.conf Code:
SOURCE_TREE="/boot/initrd-tree" Code:
# mkinitrd -F 11. Configure LILO Edit /etc/lilo.conf to read: Code:
append=" vt.default_utf8=1" Code:
# lilo 12. Reboot Repeat step 7. With exactly the same result... :mad: (to be continued) ;) |
Quote:
gargamel |
few ideas
I'm betting that it is something in the initrd.gz, just like the last time. That message:
Quote:
The other thing I did when trying to fix this sort of problem was inserting a number of "sh" commands in my /boot/initrd-tree init file so that I could inspect the status of the boot process before the kernel hang. (and don't forget to re-run mkinitrd without any options to remake the initrd.gz after you edit "init") Of course, if you never get the busybox shell, then you have another problem entirely, as that would mean the initrd doesn't get used. If it's a lilo issue, I'll be at a loss, as I use grub. Just make sure you rerun lilo every time you change the initrd! |
Quote:
Also, with other attempts, I have checked the init script in initrd-tree. It is no authored by Pat V. (used to be Eric Hameleers, who found the solution to my original problem with 12.1 and created that great patch), but seems to contain the patch: RAID is initiated before LVM and LUKS. However, my thinking was that for step 1 through 7 this shouldn't be relevant, at all. Of course, I'll watch out for this with one of my next attempts, when I try to get a generic SMP kernel with an initrd. :cool: Quote:
Quote:
|
I agree that the huge kernel wil get you to where you got, but to mount the root fs, which is where it looks like it hangs, you need lvm, and for that you need the initrd....
|
|
Quote:
gargamel |
Additional information.
/etc/fstab Code:
[...] Code:
[...] Code:
[...] Well, in Slackware 12.1 ROOTDEV="/dev/cryptvg/root" was ok, so I guess that here the man page is a little confusing. gargamel |
Next attempt.
Up to now I only issued the commands for activation the logical volumes (LVM) only once. But probably it makes sense to issue them also right after chroot-ing: Code:
# chroot /mnt the system writes the number "99" on half the screen... Whatever that means! gargamel |
Means you have to use your boot CD, chroot in and redo LILO ;)
|
Redoing lilo is what I did. Doing it again would therefore most likely
produce the same result. 1 Which means that I most likely will get the very samy result. 2 Therefore I will have to redo lilo. 3 GOTO 1. Seems to be a "dynamic halt"... (synonym for "infinite loop") gargamel |
Similar setup, same problem
I have a very similar setup, just without the RAID, and I get the same problem on boot. I did a clean install of Slackware 12.2. I've done a clean install of Slackware 12.1 and had this working, which is also where I'm getting my settings from.
I've done some searching around the net for information on this no init issue. Sadly, there isn't much out there that's very useful. Some said that the initrd was missing a module for the root device, or that the root device was wrong, or that the memory was bad. I ran a memtest from the Ubuntu disc and it came back clean, so I'm not considering this anymore. The settings I'm using for the bootloader (lilo, soon to be grub as soon as I can get this booted) and for the initrd all came from my prior 12.1 install. I also updated the BIOS, but this did not have any affect either. I've used Knoppix 5.3.1 and the Slackware install disc in attempts to repair correct this issue, but nothing I've tried has worked. I've tried changing the append line in lilo to point to init or ash/sh explicity, but THIS DOES NOT WORK: Code:
[...] Code:
[...] Code:
mkinitrd -c -k 2.6.27.7-smp ext3:usbhid:ehci_hcd:uhci_hcd -f ext3 -r /dev/cryptvg/root -C /dev/sda2 -L My setup follows the instructions in the LUKS+LVM section of README_CRYPTO almost exactly. The only changes I made were to the sizes of the LVM volumes. ....This my be entirely specific to my hardware, but during the installation (near the end of the package installation), the kernel OOPS!ed... dmesg showed a trace through the ata layer, and the hard drives were restarted. Part of it was cut off, and I'm not sure if this causes the issue... Did anyone else notice or see this? Type dmesg | less right after the install ejects the disc. This *could* cause a problem, but I don't see how it causes *this* problem. |
Quote:
Code:
mkinitrd -c -k 2.6.27.7-smp -m ext3:usbhid:ehci_hcd:uhci_hcd -f ext3 -r /dev/cryptvg/root -C /dev/sda2 -L |
Quote:
There is definitely a kernel bug during the install, it occurs at about where fontconfig runs, after the packages are installed. I could only salvage part of it, but it looks redundant, look at the Oops line near the bottom. The earlier ones are lower numbered and occur on alternating cores. Code:
Pid: 19287, comm: sh Tainted: G D (2.6.27.7-smp #2) |
any luck with 99s?
Quote:
|
I've been wondering if this problem has anything to do with the /dev/root change that was mentioned in a number of other threads, particularly this one:
http://www.linuxquestions.org/questi...evroot-688189/ |
I don't see an indication that the /dev/root thing is my way, but I really don't know.
My recent "experiments" didn't solve the problem, however, here are my observations: (1) New install including formatting / and /boot, following the README_CRYPT.TXT word by from the point where the LVM setup is complete, including creation of initrd and switching to generic SMP kernel, liloconfig and lilo. Reboot. ==> In fact I was asked to enter a LUKS passphrase. However, my USB keyboard wouldn't work... (2) So once again boot with the install DVD, add USB support modules to initrd (uhci-hcd, ehci-hcd,...), lilo. Reboot. ==> Kernel panic, RAID not working. However, I noticed something strange. After a complete install like in (1) including formatting the first run of mkinitrd reports more than 9000 blocks written, while running it again and again it only reports 6500 blocks. Even when I remove the initrd-tree completely, mkinitrd would only write about 6500 blocks. But after a full install it writes 9000 plus blocks, it reports, exactly one time. Then I downloaded the latest version 1.40 of mkinitrd-command-generator.sh. With some of my attempts this created just about what I already had, but in my recent attempts it doesn't "see" the RAID anymore. Weird! Still stuck... gargamel |
SUCCESS!!!
The new mkinitrd 1.3.3 fixes the problem. So it was really a software bug, not a PEBKAC. ;) gargamel |
Congratulations and good to know it can work. Maybe I'll get brave enough to try it; though at this point 12.1 has everything I need and 12.2 nothing extra that I want..
|
Thanks. Yes, 12.1 worked flawlessly here, once I had it up and running thanks to the great support
of the folks here. The most valuable part coming from Alien Bob --- thanks, Eric, once again! Although he doesn't stop emphasizing that he is not here for holding hands, he and his mates in the Slackware team (Robby Workman and some other people) are very helpful, just like Pat V. himself, too. Indeed they didn't ever refuse to hold my hand, and I am very grateful for that! As to 12.2, there's a lot of updates, I like to have, such as Mozilla Firefox 3.x (note that 2.0.20 is supposed to be the last 2.0.x version of this browser, the 2.x branch will no longer be maintained). But there some truth in the saying: "Never change a running system!" Well, I did, and immediately had a reason to return to LQ.org... ;) So, thanks guys, for doing it again! gargamel |
I have just written an initial draft for a mini-Howto on this subject. Please review it and help me to improve it!
It's available here: http://www.iverbi.de/slackware/RAID1...2_2_Howto.html http://www.iverbi.de/slackware/RAID1...12_2_Howto.pdf Best regards and thanks for all your feedback in advance, gargamel |
Well done gargamel, I'll take a look, this is really useful :-)
|
Quote:
report back any errors or suggestions. gargamel |
Yeah, that looks really good. I have a few minor suggestions though.
1. From experience, the modules needed for USB keyboards are *NOT* added automatically. 2. This is more of a suggestion, but perhaps you would like to include a note about multiple initrds? This is especially relevant if the user is going to be compiling their own kernels. mkinitrd will overwrite the initrd each time it is run, so there should be a unique one for each kernel entry, ie, the initrd for the default slackware 12.2 kernel should be copied to initrd.gz-2.6.27.7-smp. This can also be set with the -o switch to mkinitrd. |
Thanks for your feedback!
1. Ok, I'll correct this. Although it once looked to me as if my USB keyboard was working although initrd did not provide modules to the kernel for it. 2. I understand your point, but the topic is already complex, and adding information on multiple initrd setups would make it even more complex and further reduce the number of potetntial readers... Also I don't have time to try it out myself, at the moment. That's why I am a bit reluctant, here. What do others think? gargamel |
Just uploaded the second draft with minor corrections, looking forward to your feedback!
BTW, I am a non-native English speaker, so any language corrections or improvements would be most welcome, too! gargamel EDIT: For your convenience I add the links, again. http://www.iverbi.de/slackware/RAID1...2_2_Howto.html http://www.iverbi.de/slackware/RAID1...12_2_Howto.pdf |
'swap is not part of a RAID array...' Should be 'Swap...' (Capital S)
'At least, make a node into a tissue!' Should be 'At least, make a note on a tissue!' 'This command reads the configuration and do the same things as...' Should be 'This command reads the configuration and does the same things as...' 'But how, you may asked, do I...' Should be 'But how, you may ask, do I...' Everything else looks great. Nice job. :) |
Added the corrections, thanks!!!
http://www.iverbi.de/slackware/RAID1...2_2_Howto.html http://www.iverbi.de/slackware/RAID1...12_2_Howto.pdf gargamel EDIT: For a future version I plan to clean up the HTML code, currently generated by export from OOo. Once the content is stable, that is. PDF output from OOo looks better. |
related
I'm using LVM over software RAID 1, and I just spent 2 hours trying to recover from the "Please append a correct "root=" boot option" kernel panic after a kernel upgrade.
I thought I would post the solution in case anyone else has a similar problem. If you run `lilo` and it says something about not being able to boot `non-linear` partitions, then you are having the same problem. It turns out that lilo can't boot to a 'non-linear' partition (AKA a partition with snapshots made of it), which turned out to be the problem. I was making snapshots before the upgrade in case I wanted to revert afterwards. Well, this isn't allowed. I was able to boot in by hitting TAB during lilo boot-strapping and selecting LinuxOLD as the boot image. Alternatively, you should be able to get a shell using a recover disc. The solution: 1. Remove the snapshots (on boot partition and probably root partition, too) 2. Run `lilo` so that it can load the config. If it gives no errors, you should be home free. Restart and see if it works. |
Interesting, but FYI GRUB 0.97 has no problem with "non-linear" partitions, so you can keep your snapshots.
|
Does GRUB do LVM on RAID?
Does GRUB 0.97 do LVM on RAID? For some reason the installer used LILO. I assumed it was for a good reason, but if GRUB works, I would prefer it, anyways.
|
Grub does LVM on RAID with LUKS encryption and dmraid too if you need it too, all at the same time. :)
|
Awesome
Awesome. Now, I don't suppose you could tell me how to switch it over? If it's just simply installing and configuring GRUB I can probably figure it out, but do you have to do something to have it automatically update the bootlist on a kernel upgrade?
|
I didn't do anything special, but I run Slackware so if and when I ever do a kernel upgrade, it's manual and so is my tinkering with menu.lst. Actually one of my gripes with distros like Ubuntu is that it is so very easy to hose your system with all those frequent kernel upgrades. But I digress. Just install it as usual, there should be a ton of HOWTOs out there. Check out google looking particularly at grub and raid and ubuntu, it might help you not trip over anything. Be careful with the disk numbers according to BIOS and according to grub and according to ubuntu - they can be different.
|
All times are GMT -5. The time now is 01:24 PM. |