LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 06-19-2015, 06:08 PM   #1
Archy1
Member
 
Registered: Jan 2014
Distribution: Debian
Posts: 95

Rep: Reputation: 2
Debian won't boot to RAID 1 with only a single drive


EDIT: See the third post in this thread and read this other thread for a much simpler and easy to execute solution.

I installed Debian 8 amd64 with mdadm RAID 1 with two hard disk drives. There are two raid volumes, one for /boot and one for everything else. Beneath the RAID 1 volume for everything else lies a LUKS volume and beneath the LUKS volumes lies an LVM volume and within the LVM an ex4 "/" and swap partitions exist.

This works fine and dandy when both drives are present but when only one exists, this happens:
Click image for larger version

Name:	1.png
Views:	64
Size:	11.0 KB
ID:	18750
And after over a minute of "No volume groups found" I crash to the BusyBox (is there any way to get to the BusyBox more quickly?).

Bleh isn't the point of RAID 1 to reduce down time?

[THINKING]Hhmm, maybe grub's boot menu isn't set up to expect only one drive present?
I'll boot to Debian Live and see if the RAID 1 volume is messed up in any way before messing with grub.[/THINKING]

*Boots Debian live*
Code:
user@debian:~$ sudo -i

root@debian:~# apt-get -y install mdadm lvm2 cryptsetup
I select "ok"
Click image for larger version

Name:	3.png
Views:	55
Size:	63.3 KB
ID:	18752

"ls /dev | grep md" reveals that raid volumes are enabled.
Code:
root@debian:~# ls /dev | grep md
md
md0
md1
"cryptsetup -v isLuks /dev/md1" reveals md1 to be the LUKS volume.
Code:
root@debian:~# cryptsetup -v isLuks /dev/md1
Command successful.

root@debian:~# cryptsetup -v luksOpen /dev/md1 md1_crypt
Enter passphrase for /dev/md1:
Key slot 0 unlocked.
Command successful.

root@debian:~# vgscan
	Found volume group vg-sys using metadata type lvm2

root@debian:~# vgchange -a y vg-sys
	2 logical volume(s) in volume group vg-sys now active

root@debian:~# lvscan
	ACTIVE 	'/dev/vg-sys/c-swap'
	ACTIVE 	'/dev/vg-sys/c-root'

root@debian:~# mount /dev/vg-sys/c-root /mnt
mount: /dev/mapper/vg--sys-c--root mounted on /mnt.

root@debian:~# ls /mnt
bin	dev	home	lib	lost+found	mnt	proc	run	srv	tmp	var
boot	etc	initrd.img	lib64	media	opt	root	sbin	sys	usr	vmlinuz

root@debian:~# shutdown -r now
Now this happens on reboot!

Click image for larger version

Name:	4.png
Views:	53
Size:	6.3 KB
ID:	18755

And yes, there is still only one disk!

But then this happens :

Click image for larger version

Name:	5.png
Views:	43
Size:	14.6 KB
ID:	18754
Click image for larger version

Name:	6.png
Views:	41
Size:	14.2 KB
ID:	18753

I enter root's password and issue "shutdown -h now"

I boot to Debian Live again:
Code:
user@debian:~$ sudo -i

root@debian:~# apt-get -y install mdadm

##COMMENT: Select okay at the mdadm configuration prompt.

root@debian:~# mount /dev/md0 /mnt

root@debian:~# ls /mnt
config-3.16.0-4-amd64  initrd.img-3.16.0-4-amd64  System.map-3.16.0-4-amd64
grub		       lost+found		  vmlinuz-3.16.0-4-amd64

root@debian:~# shutdown -r now
And somehow this fixed the issue!

Now why in the world did this fix anything? Why is mounting all RAID 1 volumes in Debian Live the solution to booting Debian into a RAID 1 array with missing disks?

Last edited by Archy1; 06-22-2015 at 06:36 PM.
 
Old 06-21-2015, 03:31 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Quote:
Originally Posted by Archy1 View Post
##COMMENT: Select okay at the mdadm configuration prompt.
Screenshot of this would be more useful.
 
Old 06-21-2015, 07:38 PM   #3
Archy1
Member
 
Registered: Jan 2014
Distribution: Debian
Posts: 95

Original Poster
Rep: Reputation: 2
It's the same as the second image shown.

And I just found a way way more simple solution that was just recently posted. Lol.

Here's the simple solution for my setup. From the BusyBox:
Code:
mdadm --run /dev/md0
mdadm --run /dev/md1
exit
And it boots just fine and those commands only need to be entered once per drive failure/removal/corruption.

Now the real question is how to get to the BusyBox more quickly than letting Debian timeout to it and still why in the world this works.

Last edited by Archy1; 06-21-2015 at 07:44 PM.
 
  


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
dual boot debian with vista in a 3 drive raid 0 configuration jake658879 Debian 3 04-22-2009 09:49 AM
OS on single drive, RAID 5 on 3 others - user lost OS drive drphat Linux - Server 4 01-01-2009 07:10 AM
Going from single hard drive to Software RAID 1 Zippy1970 Linux - Hardware 8 03-14-2008 09:38 AM
Single drive to RAID howto fw12 Linux - General 1 10-11-2007 06:08 PM
will not boot X/GDM with RAID, but will with single drive Astol Linux - Hardware 1 09-20-2007 05:14 PM

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

All times are GMT -5. The time now is 06:37 AM.

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