Linux - SoftwareThis 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.
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.
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.
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.
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 ... ?
- 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.
#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.
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
"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.
"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.
"
- 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.
#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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.