Tuesday, June 24, 2008

Linux can't complete boot due to fsck error

  • I saw the following error after I migrated the / to a raid 1 /dev/md1
    setuproot: moving /dev failed No such file or directory
    setuproot: error mounting /proc: No such file or directory
    setuproot: error mounting /sys: No such file or directory
    switchroot: mount failed: No such file or directory

    What I did is to reboot with a repair system, and type the following commands:
    mount /dev/md1 /mnt
    chroot /mnt
    mount /proc
    mv /boot/initrd.img /boot/initrd.old
    mkinitrd -v /boot/initrd.img 2.6.26.20
  • The libary package was in compatible with the upgraded e2fsprogs package. But the partition only needed check because the maximum mount count was exceeded. So in the "Repair Filesystem" mode, root can do the following:
    1. disable the fsck on a partition by running the command
      dumpe2fs -h /dev/hda1 | grep 'ount count'
      tune2fs -c 0 -i 0 /dev/hda1

      Reboot and no fsck error whatsoever.

    2. Remount the / to read and write
      mount -o remount,rw /
  • Create the software raid 1 with two sata drives
    1. mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sda1 /dev/sdb1
    2. Run diskdrake to set the mount point for /dev/md0 and mount it
    3. mdadm --examine --scan /dev/sda1 >> /etc/mdadm.conf
    4. Change the partition label with e2label /dev/md0 /home
    5. Manually start the array with mdadm -As /dev/md0
    6. Add auto=yes to the end of every ARRAY clause in /etc/mdadm.conf
    7. Add HOTPLUG_RC_scsi=yes into /etc/sysconfig/hotplug


      References:
    1. Mandriva Initscripts
    2. Choosing a Mandriva Kernel

0 comments: