Восстановление Linux после неудачного fsck на raid разделе.

Восстановление Linux после неудачного fsck на raid разделе.

When the periodical fsck on Ubuntu start-up returns an error, if you’ve set up a password for root, then you can just enter that password and repair the errors on your partition.
But Ubuntu comes with the root account disabled per default and you’re recommended not to give root a password for security reasons. This means that you probably won’t be able to comply with this promt:

Give root password for mainenance
(or type Control-D to continue): _

Further, you’re not presented with any console to login and perform the manual fsck. So the only option is to do the fsck from LiveCD. Normally this is fairly simple:

sudo fsck /dev/sda1

Replace sda1 with the actual name of your partition. If you don’t know you can start the partition editor from the administration menu and check.

This is not so easy however if the partition you need to check is part of a RAID because you have to configure and start software RAID first. This is done with mdadm, however mdadm doesn’t come with the Ubuntu LiveCD.

So I ended up using a KNOPPIX LiveCD to be able to finally perform the manual fsck on my RAID partition:

  • Scan the RAID partitions. You’ll also be verifying that you’re using the correct partitions that belong to a RAID.
    sudo mdadm --examine --scan /dev/sda1
    sudo mdadm --examine --scan /dev/sdb1

    The output should be something like this:
    ARRAY /dev/md0 level=raid1 num-devices=2 UUID=a28090aa:6893be8b:c4024dfc:29cdb07a
  • Now edit mdadm.conf:
    sudo nano /etc/mdadm/mdadm.conf
    and add the above output line to the end of the file with the following modification:
    ARRAY /dev/md0 level=raid1 num-devices=2 UUID=a28090aa:6893be8b:c4024dfc:29cdb07a devices=/dev/sda1,/dev/sdb1
    where devices=/dev/sda1,/dev/sdb1 are the two RAID partitions you want to perform the fsck
  • Start the RAID setup:
    sudo /etc/init.d/mdadm start
    sudo /etc/init.d/mdadm-raid start
  • Perform the fsck on your RAID partition:
    sudo fsck /dev/md0
  • Finally restart into your now booting Ubuntu system

< Назад к списку новостей