LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-16-2014, 05:00 AM   #1
BashTin
Member
 
Registered: May 2003
Location: West Midlands, United Kingdom.
Distribution: Slackware 14.1, Centos 7
Posts: 278

Rep: Reputation: 32
lilo: dual boot luks with lvm


Hello folks, hoping some of you smart guys/girls out there can help me out, again.

Well my latest setup is 2 1T drives, sda and sdb. sdb is basically a mirror of sda. My 'master plan' is to use sda as a working system and sdb is just a copy/mirror. Both have Slack 14.1 installed on them and every day a script is run to copy over files from sda to sdb. So, if sdb dies, I have a an exact working,bootable copy on sda and visa-versa. Each drive has an unencrypted /boot and encrypted /.

Why not use raid, well without going into details some would say raid is not a backup solution (delete or hose A and you imediately delete/hose B). Niether, some would say, are two sepparate drives in the same box, but we digress.

So the problem. How to setup lilo to boot either drive? (No, come on, I don't want to start learning all about grub. Lilo is simple file edit)

This is my lilo.conf at the moment:

Code:
image = /boot/vmlinuz-generic-smp-3.10.17-smp
label = "Slack"
root = /dev/slackcrypto
initrd = /boot/initrd-sda.gz
read-only

image = /boot/vmlinuz-generic-smp-3.10.17-smp
label = "Slack_Backup"
root = /dev/slackcrypto_backup
initrd = /boot/initrd-sdb.gz
read-only
I made both intitrds on each drive straight after installion and copied over initrd-sdb.gz to sda /boot partion. Then to run lilo I booted up Slack (sda) unlocked sdb2's encrypted root partition, vgscan --mknodes, vgscan -ay and ran lilo, without any complaints.

Reboot, at Lilo choose Slack_Backup and then get errors from luks: (sda/Slack, boots fine)

Code:
Unlocking LUKS encrypted device /dev/sdb2 as luks mapped device '';
Usage: blah, blah............
.............................
/sbin/cryptsetup: luksOpen: requires <device> <name> as arguments
mount: mounting /dev/mapper/ on /mnt failed: Block device required.
ERROR: NO /sbin/init found on root dev................
.....................
Obviously cryptsetup is not getting all the information it requires. So what have I missed, done wrong or need to try?

As always, thanks in advance for all suggestions and help.

Oh and as an aside, without a vpn, linuxquestions takes an age to load from China as it stalls waiting for 'ajax.googleapis.com' :-(

BashTin
 
Old 07-16-2014, 01:27 PM   #2
TracyTiger
Member
 
Registered: Apr 2011
Location: California, USA
Distribution: Slackware
Posts: 528

Rep: Reputation: 273Reputation: 273Reputation: 273
Quote:
Originally Posted by BashTin View Post
sdb is basically a mirror of sda.

Why not use raid, well without going into details some would say raid is not a backup solution (delete or hose A and you imediately delete/hose B)
I don't want to discourage you from your quest but just to let you know using RAID 1 on two disk drives essentially mirrors the disks. In the command to create the RAID setup "mirror" is even an alias for RAID type 1. When you loose one disk the second disk will work fine.

You are correct that RAID is not a backup solution. When you mirror a disk and keep it up to date with the original, that is also not a backup solution.
 
Old 07-16-2014, 01:36 PM   #3
TracyTiger
Member
 
Registered: Apr 2011
Location: California, USA
Distribution: Slackware
Posts: 528

Rep: Reputation: 273Reputation: 273Reputation: 273
Quote:
Originally Posted by BashTin View Post
Oh and as an aside, without a vpn, linuxquestions takes an age to load from China as it stalls waiting for 'ajax.googleapis.com' :-(
I run Firefox with noscript and ghostery. I just turned off access by googleapis.com and linuxquestions.org still seems to work okay. Not sure if everything on the site will work though. Something you may want to try to speed up your pages.
 
Old 07-16-2014, 01:55 PM   #4
TracyTiger
Member
 
Registered: Apr 2011
Location: California, USA
Distribution: Slackware
Posts: 528

Rep: Reputation: 273Reputation: 273Reputation: 273
Quote:
Originally Posted by BashTin View Post

This is my lilo.conf at the moment:

Code:
image = /boot/vmlinuz-generic-smp-3.10.17-smp
label = "Slack"
root = /dev/slackcrypto
initrd = /boot/initrd-sda.gz
read-only

image = /boot/vmlinuz-generic-smp-3.10.17-smp
label = "Slack_Backup"
root = /dev/slackcrypto_backup
initrd = /boot/initrd-sdb.gz
read-only
Note that "root = xxx" shouldn't be used when using initrd. It isn't needed and as initrd specifies the root device. I've had trouble with this in the past.

I just found out that the absence of googleapis.com affects the ability to reply to a post on linuxquestions.org when I tried to add a smiley. I'm typing this for a second time as I lost the first one.

(Following the example set by ruario of replying over multiple posts. )

EDIT: Normally my LUKS devices are "/dev/mapper/xxxx". I noticed that your reference to a root device was one layer lower without the encryption. Perhaps your use of LUKS is more sophisticated than the generic way I use it. When you build your initrd your root device (mkinitrd -r) should be the encrypted device.

Last edited by TracyTiger; 07-16-2014 at 02:22 PM.
 
Old 07-17-2014, 06:54 AM   #5
BashTin
Member
 
Registered: May 2003
Location: West Midlands, United Kingdom.
Distribution: Slackware 14.1, Centos 7
Posts: 278

Original Poster
Rep: Reputation: 32
Hi TracyTiger. Thanks very much for the reply, appreciated. Ok managed to get it sorted. A few comments/notes.....

Quote:
Originally Posted by TracyTiger View Post
I don't want to discourage you from your quest but just to let you know using RAID 1 on two disk drives essentially mirrors the disks. In the command to create the RAID setup "mirror" is even an alias for RAID type 1. When you loose one disk the second disk will work fine.

You are correct that RAID is not a backup solution. When you mirror a disk and keep it up to date with the original, that is also not a backup solution.
You misunderstand me or I misunderstand you. I am not using raid of any sort. Just two separate drives. I know RAID 1 is a mirror. But I did not want to use RAID because if you make some error on one disk it is immediately copied over to the other. Bye data or part of. At least my way I get around that particular issue. As you point out though my solution is far from perfect but it is one step in the right direction :-) Once my local backup is finished I can start to look at remote backup solutions to hopefully make it bullet proof.

So back to the issue at hand. First I discovered that while booted into sda's slackware KDE had automounted /dev/sdb1 under /boot, so both sda1 and sdb1 were mounted at /boot. As sbb1 got mounted after sda1, sda1's contents were thus made invisible to the system. Quick edit of fstab and added 'noauto' to sdb1 entry sorted that. Think this was the main issue and messed up lilo.

The root= paths in the posted lilo.conf were typos. I typed them in by hand and missed off 'root'. I also commented them out in lilo after you pointed out they were not needed and indeed the sytem still booted so obviously you are right!

Quote:
EDIT: Normally my LUKS devices are "/dev/mapper/xxxx". I noticed that your reference to a root device was one layer lower without the encryption. Perhaps your use of LUKS is more sophisticated than the generic way I use it. When you build your initrd your root device (mkinitrd -r) should be the encrypted device.
Yes this holds true with Luks only. But I have lvm ontop of that hence my root is an lvm logical partition So the correct -r option in my case for mkinitrd is /dev/slackcrypto_backup/root - for sdb.

Anyway got there in the end and thanks once again for your time and help. BashTin
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Help with lilo install after chrooting into LUKS/LVM Stephen Morgan Slackware 2 11-02-2012 01:18 PM
Problems installing lilo with RAID/LUKS/LVM - 13.1(64) NyteOwl Slackware 4 03-11-2011 03:09 PM
LUKS LVM with usb token at boot mrmnemo Ubuntu 3 02-26-2011 08:35 AM
[SOLVED] Combining LUKS and LVM... LILO fails to boot STDOUBT Slackware - Installation 4 06-10-2010 09:58 PM
How do I dual boot Windows XP and Slackware 13.1 with dm-crypt luks with lilo? gluesniffmonkey Slackware 5 06-06-2010 06:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration