LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-19-2015, 02:21 AM   #1
adiculiniute
LQ Newbie
 
Registered: Aug 2015
Posts: 12

Rep: Reputation: Disabled
Cannot boot after one HDD died in software RAID1


Hello to everyone!

Hope that you can help me with a very frustrating problem. I am far from beeing a linux guru... and I don't know what to do next.

Almoust 3 years ago I created a raid 1 in my centos linux server. Yesterday one of my hdd died, and the array is degraded. Apparently the broken hdd is the one needed to boot the OS, which has grub. I thought that if it's in RAID1, everything is in mirror, including grub. Well, my bad because I did not make any boot tests to see if the server starts from both hdd's. Now it's too late.

Can you please help, and tell me if I can make it work? Reinstalling centos is not an option right now.

Thank you very much, and sorry for my english!
Best regards,
Adrian.
 
Old 08-19-2015, 03:33 PM   #2
rayfward
Member
 
Registered: May 2009
Location: Leeds Uk
Distribution: Linux Mint 20.2
Posts: 136

Rep: Reputation: 17
Hi adiculiniute
You can try pressing F12 (depending on your motherboard ) and selecting the surviving drive and you should be able to boot from it.
In the end you can boot from a live image and restore your grub installation.

Regards
Ray
 
Old 08-19-2015, 03:49 PM   #3
adiculiniute
LQ Newbie
 
Registered: Aug 2015
Posts: 12

Original Poster
Rep: Reputation: Disabled
I am trying to restore the grub from a live CD for 3 hours!
I can't!

I google a lot, and did everything ... not working.

You have a step by step guide?
Thank you!
 
Old 08-19-2015, 05:02 PM   #4
rayfward
Member
 
Registered: May 2009
Location: Leeds Uk
Distribution: Linux Mint 20.2
Posts: 136

Rep: Reputation: 17
Question
Are you using hardware or mdadm to configure raid?
 
Old 08-19-2015, 07:30 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,131

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
Give us all the info you have or we can't help. For example (in addition to the above):
- which CentOS
- which grub
- what liveCD are you using
- do you know how to chroot into the surviving disk
- how is the boot failing ?. Are you in a initrd recovery, do you see a boot menu, do you get to grub at all ... ?
 
Old 08-20-2015, 12:47 AM   #6
adiculiniute
LQ Newbie
 
Registered: Aug 2015
Posts: 12

Original Poster
Rep: Reputation: Disabled
- CentOS 6.5 or 6.6 (ok... when I installed the server almoust 3 years ago, it was 6.2 or something like it, but in time I did the updates necesarry, and now it's 6.5 or 6.6? don't know exactly; but i guess this is not so important.

- which grub? GNU grub version 0.97.

- I used also live CD and I tryed booting to rescue mode from the original install DVD too. Live CD is named: "CentOS-6-5-i386-LiveCD" ; and original install DVD: "CentOS-6.7-i386-bin-DVD1"

- Yes, i know to chroot, based on what Google told me

The strange thing is that rescue mode did not find any linux partitions, and did not mount the sysimage. The fdisk -l shows all partition I have.

So here is what I did when I get to prompt shell:

#mdadm --assemble --scan
#cat /proc/mdstat
#mkdir /mnt/root
#mkdir /mnt/boot
#mount /dev/md124 /mnt/boot
#mount /dev/md125 /mnt/root
#chroot /mnt/root

- At this point the root is mounted.
Next:

#grub-install /dev/md124
After this, i get:
"/dev/md124 Not found or not a block device"

I also did:
#grub-install --recheck /dev/md124/boot
The result is: "Probing device to guess BIOS drives. This may take a long time. No suitable drive was found in the generated device map. Reverting to backed copy."


And now, to answer to your last question: the computer does not boot at all, it shows "Loading Operating System" and remains in this state.


Thank you very much!
Adrian

Last edited by adiculiniute; 08-20-2015 at 01:43 AM.
 
Old 08-20-2015, 06:04 AM   #7
adiculiniute
LQ Newbie
 
Registered: Aug 2015
Posts: 12

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by rayfward View Post
Question
Are you using hardware or mdadm to configure raid?
I used software RAID, mdadm.
 
Old 08-20-2015, 06:43 AM   #8
mzsade
Member
 
Registered: Sep 2009
Distribution: Linux Mint 9, Linux Mint 17.2(xfce), LMDE2(Mate), Debian Jessie minimal (with standalone OBox)
Posts: 299

Rep: Reputation: 34
I've never had more than 1 hdd on my computers and don't know the first thing about RAID but since you mentioned mdadm i recalled coming across the term in the context of repairing grub. You might want to have a look at this and this

Last edited by mzsade; 08-20-2015 at 06:45 AM.
 
Old 08-20-2015, 10:35 AM   #9
rayfward
Member
 
Registered: May 2009
Location: Leeds Uk
Distribution: Linux Mint 20.2
Posts: 136

Rep: Reputation: 17
Hi Adrian
Take a look here and report back what happens.
https://www.hostvirtual.com/kb/6302/...evice-map.html
 
Old 08-20-2015, 01:09 PM   #10
adiculiniute
LQ Newbie
 
Registered: Aug 2015
Posts: 12

Original Poster
Rep: Reputation: Disabled
Pfffff...

"Boot to cloud kernel or chroot into the virtual machine..." How the heck can i do that? I made virtual machines in windows, not in linux )

I guess it's getting way too complicate for me... I am very close to abandon. Feels like I don't have any more nerves for this bshit!
I am taking serious into account saving all the data, and reinstall OS. Thus the data partition is 1,5TB full.

Unless someone come's quickly with a magic solution
I tryed also "Super grub disk" a cd image that promises it fix the grub problems. It fixes nothing so far.

hmmm.
 
Old 08-20-2015, 02:38 PM   #11
adiculiniute
LQ Newbie
 
Registered: Aug 2015
Posts: 12

Original Poster
Rep: Reputation: Disabled
Uhh!

Somehow I managed to have this: (see 222436.jpg in attachment). It's a good job you say. Well, yes, it's a progress. I have grub.

But then, it appears this: (see 222817.jpg) and after I press any of that options it says: (see 222833.jpg)

Now what seems to be the problem?
Attached Thumbnails
Click image for larger version

Name:	20150820_222436.jpg
Views:	29
Size:	139.8 KB
ID:	19231   Click image for larger version

Name:	20150820_222817.jpg
Views:	32
Size:	134.8 KB
ID:	19232   Click image for larger version

Name:	20150820_222833.jpg
Views:	35
Size:	90.3 KB
ID:	19233  
 
Old 08-21-2015, 01:56 AM   #12
rayfward
Member
 
Registered: May 2009
Location: Leeds Uk
Distribution: Linux Mint 20.2
Posts: 136

Rep: Reputation: 17
Hi Adrian

"Boot to cloud kernel or chroot"
In this case chroot.

To Quote ArchLinux
"Changing root is commonly done for performing system maintenance on systems where booting and/or logging in is no longer possible. Common examples are:

Rebuilding the initramfs image.
Upgrading or downgrading packages.
Resetting a forgotten password.
Reinstalling the bootloader. Rebuilding the initramfs image.
"
 
Old 08-21-2015, 11:37 AM   #13
hortageno
Member
 
Registered: Aug 2015
Distribution: Ubuntu 22.04 LTS
Posts: 240

Rep: Reputation: 67
Quote:
Originally Posted by adiculiniute View Post
- CentOS 6.5 or 6.6 (ok... when I installed the server almoust 3 years ago, it was 6.2 or something like it, but in time I did the updates necesarry, and now it's 6.5 or 6.6? don't know exactly; but i guess this is not so important.

- which grub? GNU grub version 0.97.

- I used also live CD and I tryed booting to rescue mode from the original install DVD too. Live CD is named: "CentOS-6-5-i386-LiveCD" ; and original install DVD: "CentOS-6.7-i386-bin-DVD1"

- Yes, i know to chroot, based on what Google told me

The strange thing is that rescue mode did not find any linux partitions, and did not mount the sysimage. The fdisk -l shows all partition I have.

So here is what I did when I get to prompt shell:

#mdadm --assemble --scan
#cat /proc/mdstat
#mkdir /mnt/root
#mkdir /mnt/boot
#mount /dev/md124 /mnt/boot
#mount /dev/md125 /mnt/root
#chroot /mnt/root

- At this point the root is mounted.
Next:

#grub-install /dev/md124
After this, i get:
"/dev/md124 Not found or not a block device"

I also did:
#grub-install --recheck /dev/md124/boot
The result is: "Probing device to guess BIOS drives. This may take a long time. No suitable drive was found in the generated device map. Reverting to backed copy."


And now, to answer to your last question: the computer does not boot at all, it shows "Loading Operating System" and remains in this state.


Thank you very much!
Adrian
The first mistake you do is to mount /boot in the wrong place. The right command should be

mount /dev/md124 /mnt/root/boot

Before you chroot you need to mount at least /dev with the --bind option inside the new root. In your case it would be

mount --bind /dev /mnt/root/dev

I think you need to do the same with /proc too and then you do

chroot /mnt/root

And finally you need to install grub in the block device (/dev/sda? or whatever the remaining hard disk in your raid is) and not in the raid container. Try this and report back with any error messages.

Last edited by hortageno; 08-21-2015 at 11:39 AM.
 
Old 08-21-2015, 01:40 PM   #14
adiculiniute
LQ Newbie
 
Registered: Aug 2015
Posts: 12

Original Poster
Rep: Reputation: Disabled
OK. I did what you told me to do.
So...
From installation DVD of Centos 6.7 boot into rescue mode, at prompt shell did the following:

mkdir /mnt/root
mount /dev/md125 /mnt/root
mount /dev/md124 /mnt/root/boot

mount --bind /dev /mnt/root/dev
mount --bind /proc /mnt/root/proc

chroot /mnt/root

Everything is ok ...so far. I proceeded with grub installation as you mentioned (not in raid container md124, but in /dev/sdb3 (sdb3 is the correct device because "fdisk -l" told me so... sdb3 has boot flag *))

Now I execute:

grub-install /dev/sdb3
* /dev/sdb3 does not have any corresponding BIOS drive.

What is that?

Thank you!
Adrian

Last edited by adiculiniute; 08-21-2015 at 01:41 PM.
 
Old 08-21-2015, 01:50 PM   #15
adiculiniute
LQ Newbie
 
Registered: Aug 2015
Posts: 12

Original Poster
Rep: Reputation: Disabled
I did a quick research for that error... and i found that I can pass that with --recheck argument.

#grub-install --recheck /dev/sdb3
After 3-4 seconds... it returns another diferent error: "Could not find device for /boot"
 
  


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
How to install grub to BOTH hdd's - /boot on software raid1 suprstar Linux - Software 1 09-14-2012 05:59 AM
[SOLVED] Laptop died, moved HDD to external enclosure. Can't boot. uncertain Linux - Laptop and Netbook 3 01-21-2010 04:04 PM
Kernel panic during boot with software RAID1 Petevs Linux - General 2 09-11-2007 06:41 PM
software RAID1; system doesn't boot kristof_v Linux - Software 1 06-19-2007 09:13 AM
[RAID1, GRUB] Secondary HDD can't boot up when primary HDD fails Akhran Linux - Newbie 2 05-04-2006 04:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:46 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