Find the answer to your Linux question:
Results 1 to 9 of 9
Hi everyone, I had a server running RHEL 6. It had 4 main raid drives and 1 boot drive. The setup was like so when I installed RHEL 6: Boot ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2014
    Posts
    6

    RedHat MBR Recover Help (Boot drive failed)


    Hi everyone,

    I had a server running RHEL 6. It had 4 main raid drives and 1 boot drive. The setup was like so when I installed RHEL 6: Boot went on 1 harddrive and everything else was on md0 which was setup as raid 5 + 1 spare software raid.

    Now the boot drive failed so /boot is basically done. Is there a way to install /boot only on a new HDD and just boot it up as normal?

    Thank you so much for your help.

    Chris

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,737
    Not enough information. Was just /boot on the system drive, or was / also on there? If the raid was for /home and such, then you may be able to accomplish what you want, though you will have to reinstall all of your software.

    Do you know the full layout of your system and location of all the main directories (/, /var, /opt, /bin, /sbin, /usr, /home, /boot, /etc, /lib, /lib64, /usr/lib, /usr/lib64, and so forth?
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined!
    Join Date
    Aug 2014
    Posts
    6
    Rubberman:

    Yes only the /boot was on that drive. I distinctly remember this. All the other directories are on the raid drive /md0 which was made with raid 5 + spare (4 drives)

    Edit: Which was created under the installation of RHEL 6. Its software raid.

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Aug 2014
    Posts
    6
    Another thing I should add I guess is that it had 12GB for swap / 200mb allocated as ext4 for bootloader. And rest of hte space was completely unallocated space. Everything else was on the md0.

  6. #5
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,737
    Keeping a bit image backup of the boot drive is important so in just such a case you can restore the system. /boot contains not only the kernel boot files, but in /boot/grub are all of the grub configuration files, menu list, etc. The MBR boot record is binary code on the first sector of the disc (along with the partition table). You might be able to download from a CentOS mirror site the initramfs, initrd, symvers, System.map, and vmlinuz files needed to restore the boot data needed, but that doesn't deal with the MBR boot record and /boot/grub. There should be a recovery CD/DVD iso image on the CentOS mirrors that may help you fix this. There may be other recovery tools and techniques that others on the forums can tell you about, but restoring from the last-known-good backup is what I do. I put /boot, /, and swap on the system disc, and /home (as well as /opt, database files, etc as necessary) on the RAID or other drive.

    Time to do some Googling (I prefer DuckDuckGo - no ads), and I would suggest that you post this issue to the CentOS and RedHat user forums. Lots of experienced RHEL types lurk there.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  7. #6
    Just Joined!
    Join Date
    Aug 2014
    Posts
    6
    Thanks for the reply for sure. Definitely a lesson learned in keeping a bit backup of boot.

    A quick question. Right now under regulation installation of RedHat, if I just mount the 4 raid drives which has all previous data, it shows up as md0 and is all in tact. I can install OS onto a new HDD and just have the raid drives as mount only. I am wondering if I did this will this give me access to the files on RAID drive, So i can back that up and then rebuild the server, then restore the backed up files. Does this make logical sense? Will only mounting the raid drives cause any issue during instalation? (the installer says it wont touch / format the other drives which auto detect as raid md0).

  8. #7
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,737
    I'm not sure. My experience is that it usually re-installs all the applications and such, resulting in possibly a borked system. One thing you can do is take the array off-line, do the installation which will put / on the system drive in the currently unused space, then reboot with a live DVD, re-enable the array, mount /boot, and edit the grub.conf file so that the kernel line root=UUID.... is pointing to the appropriate root partition on the array. Then reboot. Grub should then find your old system files, applications, data, et al. You will need to get the UUID for the root partition on the array to do this, but that is not difficult. Consider figuring that out to be a learning exercise - I'm trying to teach you how to fish.

    The main caveat here is DO NOT install with the array enabled, otherwise you may get into a deeper hole than you are now. It is easier to do the grub configuration fixup afterwards than restoring the full set of data on the array. Backups are good, and necessary, but restoring may gigabytes (or terabytes) of data can be very time consuming.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  9. #8
    Just Joined!
    Join Date
    Aug 2014
    Posts
    6
    Excellent points! Thanks for the help so far. So my progress has been pretty good, I have to try what you just said above. But here is what I have done so far.

    1) Using the RHEL 6 boot disc, and choosing the recover method I was able to enter the Shell command interface.
    2) I was able to use mdadm to rebuild the raid array and mount it as read only onto /mnt/sysimage. This allowed me to see that all the files from /root /usrs .. etc were all in there. So I know for sure nothing is wrong with the raid drives, which is an excellent thing.
    3) I created a partition on the new HDD I got that I am going to use as boot, I created a small boot partition and a swap on the drive.
    4) Mounted the above partition as /boot in /mnt/sysimage.

    Now the only thing left is to recreate the boot loader ie reinstalling grub and kernal.

    And it was going well till I got to this point, where this bug posted here: bugzilla.redhat.com/show_bug.cgi?id=429785 didn't allow me to install grub, saying that its missing. Of course my installation just happens to be RHEL 6.3.

    What I am wondering is hopefully to use a more recent boot disk or recover to just install the missing files. And see how that goes.

    I shall post on the progress for sure on this. And I will definitely look into your method if this one doesnt seem to work.

  10. #9
    Just Joined!
    Join Date
    Aug 2014
    Posts
    6
    Hey Rubberman and forum. Quick question about UUIDs. OK so I confirmed the raid is in tact. Using the RHEL 7 Live disc it can detect the installed system which is loaded automatically to /mnt/sysimage in the recovery.

    One interesting thing though that I find a bit confusing and maybe some Gurus can help. When I type "blkid" the raid md0's UUID matches that of the one in /etc/fstab. However in the mdadm conf that UUID is different... I am just confused as to why these are different. Mdadm seems to have a differnet UID for the same drive ... and drive.

    Any points as to why this is? Because it loads perfectly on its own just using the live cd, but UUIDs are different when using / looking at various files.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •