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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
08-19-2015, 02:21 AM
|
#1
|
LQ Newbie
Registered: Aug 2015
Posts: 12
Rep: 
|
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.
|
|
|
08-19-2015, 03:33 PM
|
#2
|
Member
Registered: May 2009
Location: Leeds Uk
Distribution: Linux Mint 20.2
Posts: 139
Rep:
|
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
|
|
|
08-19-2015, 03:49 PM
|
#3
|
LQ Newbie
Registered: Aug 2015
Posts: 12
Original Poster
Rep: 
|
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!
|
|
|
08-19-2015, 05:02 PM
|
#4
|
Member
Registered: May 2009
Location: Leeds Uk
Distribution: Linux Mint 20.2
Posts: 139
Rep:
|
Question
Are you using hardware or mdadm to configure raid?
|
|
|
08-19-2015, 07:30 PM
|
#5
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,382
|
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 ... ?
|
|
|
08-20-2015, 12:47 AM
|
#6
|
LQ Newbie
Registered: Aug 2015
Posts: 12
Original Poster
Rep: 
|
- 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.
|
|
|
08-20-2015, 06:04 AM
|
#7
|
LQ Newbie
Registered: Aug 2015
Posts: 12
Original Poster
Rep: 
|
Quote:
Originally Posted by rayfward
Question
Are you using hardware or mdadm to configure raid?
|
I used software RAID, mdadm.
|
|
|
08-20-2015, 06:43 AM
|
#8
|
Member
Registered: Sep 2009
Distribution: Linux Mint 9, Linux Mint 17.2(xfce), LMDE2(Mate), Debian Jessie minimal (with standalone OBox)
Posts: 299
Rep:
|
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.
|
|
|
08-20-2015, 01:09 PM
|
#10
|
LQ Newbie
Registered: Aug 2015
Posts: 12
Original Poster
Rep: 
|
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.
|
|
|
08-20-2015, 02:38 PM
|
#11
|
LQ Newbie
Registered: Aug 2015
Posts: 12
Original Poster
Rep: 
|
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?
|
|
|
08-21-2015, 01:56 AM
|
#12
|
Member
Registered: May 2009
Location: Leeds Uk
Distribution: Linux Mint 20.2
Posts: 139
Rep:
|
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.
"
|
|
|
08-21-2015, 11:37 AM
|
#13
|
Member
Registered: Aug 2015
Distribution: Kubuntu 24.04 LTS
Posts: 241
Rep:
|
Quote:
Originally Posted by adiculiniute
- 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.
|
|
|
08-21-2015, 01:40 PM
|
#14
|
LQ Newbie
Registered: Aug 2015
Posts: 12
Original Poster
Rep: 
|
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.
|
|
|
08-21-2015, 01:50 PM
|
#15
|
LQ Newbie
Registered: Aug 2015
Posts: 12
Original Poster
Rep: 
|
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"
|
|
|
All times are GMT -5. The time now is 07:37 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|