I have a failed system running on CentOS 6 and would like to attempt recovery of system.

One problem it has is the mdadm superblock appears to have some issues, it has all sorts of inconsistent information and appears to have been overwritten somehow. I'm getting metadata for displaying that they are version 1.0 and 1.1. I'm pretty sure all raid volumes should be using version 1.2. This happened on all hard-drives, so I can't simply just grab a working one.

I have managed to mount these volumes and copied them over another hard-drive by simply doing "cp" command with preserve permission. The new hard drive will have new UUID, so I'll have to redo some of the configuration files.

What changes that come to mind are the follow files:

  • /etc/mdadm.conf
  • /etc/fstab
  • grub configuration (possible an grub-install might do the job, will need to try in out)
  • Initial RAM Disk needs to be recompiled to be aware of the change
  • Regenerate blkid.tab

Is there any other changes I'll need to do to make a bootable system? Thanks.

  • Ok! Getting grub errors when trying to re-install. It seems it can't locate the conf files and other essential config files. So I'll have change something to get grub to be aware of these changes. – supmethods Apr 10 '14 at 3:56

System had mdadm superblock overwritten somehow which resulted in system having in inconsistent metadata and inability to boot up. Portions of GRUB must have been also overwritten in the process or the necessary information to load the necessary files for boot no longer pointed to a valid location.

Attempted to recovery GRUB through the recovery disc but failed with "Grub filesystem type unknown partition type 0xfd" and "Unable to find GRUB.conf". This is likely due to GRUB Stage 1.5 data likely have been overwritten or GRUB Stage 1 no longer points to the right location for retrieval of the mdadm raid drivers (I wonder if there's a way to pass filesystem drivers to GRUB, if you know of a way, please add comments).

Managed to port system over to another machine by doing the follow:

Fixing the boot partition:

  • Complete fresh system install on a separate hard drive (RAID if desired)
  • Rebooted system, ran CentOS rescue disk and mounted both the new and old system (e.g. /mnt/old_sys and /mnt/new_sys)
  • Copied all /boot contents (except for the /boot/grub folder) from previous system over to the new system's /boot partition ensuring all permission are preserved. It's important to not do anything to the GRUB folder, GRUB Stage 1 will likely have pointers to the necessary files Stage 1.5 or stage 2. (Will need to thoroughly test this though but just to be safe, don't do anything to the GRUB folder.)
  • Edit the new grub.conf file, make updates according to your requirements.
  • Recreated the initram disk for the kernels you've just copied over (You'll need to mount /dev, /proc, /sys and bind these partitions to your new system's respective partitions. Chroot into the new system image and mkinitrd.)

The rest of the systems data

  • Make a copy of the /etc/fstab and /etc/mdadm.conf from the new install. You probably can rename the files in the old system data and copy these files and then copy it over. (It'll save you the time of copying it over again when the old system data has been copied).
  • Remove all folders on the / partition except for folders that are built on run-time e.g. /dev, /sys, /proc are the few I've excluded. Preserving permissions.
  • Copy all contents from the old partition to the new partition excluding the folders from built on run-time. Preserving permissions of course.
  • Reboot the system and you should be able to access the recovered system. Modify and other config files as required. e.g. udev/rules.d/ifgcfg-eth0 if you're changing over systems.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.