Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 24

Thread: Trouble installing grub on RAID array

  1. #11
    Join Date
    Apr 2007
    Beans
    107

    Re: Trouble installing grub on RAID array

    Quote Originally Posted by psusi View Post
    Can you run the boot info script and post the results?
    Here it is. Again, it looks like grub is searching for md/0 instead of md0 for some reason. But I have no idea why, or how to fix it.
    Attached Files Attached Files

  2. #12
    Join Date
    Apr 2007
    Beans
    107

    Re: Trouble installing grub on RAID array

    Some more investigation. I chroot'ed into /dev/md0 and ran grub-mkconfig, which again produced output including the line:
    Code:
      set root='(md/0)'
    It seems that this is coming from grub-probe:
    Code:
    # grub-probe -v /
    grub-probe: info: cannot open `/boot/grub/device.map'.
    grub-probe: info: changing current directory to /dev.
    grub-probe: info: changing current directory to vboxusb.
    grub-probe: info: changing current directory to 002.
    grub-probe: info: changing current directory to 004.
    grub-probe: info: changing current directory to snd.
    grub-probe: info: changing current directory to by-path.
    grub-probe: info: changing current directory to cpu.
    grub-probe: info: changing current directory to shm.
    grub-probe: info: the size of hd0 is 976773168.
    grub-probe: info: the size of hd0 is 976773168.
    grub-probe: info: the size of hd0 is 976773168.
    grub-probe: info: the size of hd0 is 976773168.
    grub-probe: info: the size of hd1 is 156312576.
    grub-probe: info: the size of hd1 is 156312576.
    grub-probe: info: the size of hd1 is 156312576.
    grub-probe: info: the size of hd2 is 976773168.
    grub-probe: info: the size of hd2 is 976773168.
    grub-probe: info: the size of hd2 is 976773168.
    grub-probe: info: the size of hd2 is 976773168.
    grub-probe: info: the size of hd3 is 976773168.
    grub-probe: info: the size of hd3 is 976773168.
    grub-probe: info: the size of hd3 is 976773168.
    grub-probe: info: the size of hd3 is 976773168.
    grub-probe: info: the size of hd3 is 976773168.
    grub-probe: info: the size of hd0 is 976773168.
    grub-probe: info: the size of hd0 is 976773168.
    grub-probe: info: the size of hd0 is 976773168.
    grub-probe: info: the size of hd0 is 976773168.
    grub-probe: info: the size of hd1 is 156312576.
    grub-probe: info: the size of hd1 is 156312576.
    grub-probe: info: the size of hd1 is 156312576.
    grub-probe: info: the size of hd2 is 976773168.
    grub-probe: info: the size of hd2 is 976773168.
    grub-probe: info: the size of hd2 is 976773168.
    grub-probe: info: the size of hd2 is 976773168.
    grub-probe: info: the size of hd3 is 976773168.
    grub-probe: info: the size of hd3 is 976773168.
    grub-probe: info: the size of hd3 is 976773168.
    grub-probe: info: the size of hd3 is 976773168.
    grub-probe: info: the size of hd3 is 976773168.
    grub-probe: info: opening md/0.
    ext2
    It somehow thinks the device is md/0 instead of md0, despite this:
    Code:
    # mount
    rootfs on / type rootfs (rw)
    none on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
    none on /proc type proc (rw,nosuid,nodev,noexec,relatime)
    none on /dev type devtmpfs (rw,relatime,size=2021324k,nr_inodes=505331,mode=755)
    none on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
    fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
    /dev/disk/by-uuid/416ac6b2-d0d5-4479-8737-79344b2c2518 on / type ext4 (rw,relatime,barrier=1,data=ordered)
    none on /sys/kernel/debug type debugfs (rw,relatime)
    none on /sys/kernel/security type securityfs (rw,relatime)
    none on /dev/shm type tmpfs (rw,nosuid,nodev,relatime)
    none on /var/run type tmpfs (rw,nosuid,relatime,mode=755)
    none on /var/lock type tmpfs (rw,nosuid,nodev,noexec,relatime)
    none on /proc/fs/vmblock/mountPoint type vmblock (rw,relatime)
    binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,nosuid,nodev,noexec,relatime)
    gvfs-fuse-daemon on /home/max/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
    /dev/md0 on / type ext4 (rw,relatime,barrier=1,stripe=256,data=ordered)
    none on /dev type devtmpfs (rw,relatime,size=2021324k,nr_inodes=505331,mode=755)
    none on /proc type proc (rw,nosuid,nodev,noexec,relatime)
    none on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
    I find that "ext2" from grub-probe suspicious, too, because the filesystem is ext4.

  3. #13
    Join Date
    Apr 2007
    Beans
    107

    Re: Trouble installing grub on RAID array

    Quote Originally Posted by YesWeCan View Post
    Code:
    brian@bU10:/media$ sudo mdadm --create /dev/md0 --level=5 --raid-devices=3 /dev/sdb /dev/sdc missing
    mdadm: array /dev/md0 started.
    brian@U10:/media$ sudo grub-install /dev/md0
    Installation finished. No error reported.
    Says it works.
    I get this (from within chroot):
    Code:
    # grub-install /dev/md0 
    /usr/sbin/grub-setup: error: can't open /dev/md/0: No such file or directory.

  4. #14
    psusi is offline Ubuntu addict and loving it
    Join Date
    Sep 2005
    Location
    Orlando, FL
    Beans
    3,980
    Distro
    Ubuntu Development Release

    Re: Trouble installing grub on RAID array

    Grub does not differentiate between ext[234]; they are the same FS just with different optional features enabled.

    At the rescue prompt, if you type ls by itself, it shows (md/0)? But ls (md/0)/ shows no results?

    I do notice that your raid partitions are tagged as Linux instead of raid. That might be the problem.

  5. #15
    Join Date
    Oct 2009
    Beans
    2,199
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Trouble installing grub on RAID array

    I can do this successfully, or something similar anyhow.

    In Ubuntu 10.10 32-bit running in VirtualBox.
    I created two 20GB virtual disks: sdb, sdc
    I created a single partition on each, ext4
    'sudo mdadm --create /dev/md0 --level=5 --raid-devices=3 /dev/sdb /dev/sdc missing'
    'sudo mkfs.ext4 /dev/md0'
    'sudo mkdir /media/raid'
    'sudo mount /dev/md0 /media/raid'

    then I copied my root fs to the raid
    'sudo rsync -var --exclude=/media --exclude=/dev / /media/raid'

    then I did your exact commands in post #1 to chroot to it, then
    'update-grub'

    then looked at /dev/grub/grub.cfg and it looks correct,
    Code:
    ### BEGIN /etc/grub.d/10_linux ###
    menuentry 'Ubuntu, with Linux 2.6.35-25-generic' --class ubuntu --class gnu-linux --class gnu --class os {
        recordfail
        insmod raid
        insmod raid5rec
        insmod mdraid
        insmod ext2
        set root='(md0)'
        search --no-floppy --fs-uuid --set 0eff2efe-45fa-4e13-87fe-a379f5c6abed
        linux    /boot/vmlinuz-2.6.35-25-generic root=UUID=0eff2efe-45fa-4e13-87fe-a379f5c6abed ro   quiet splash
        initrd    /boot/initrd.img-2.6.35-25-generic
    }
    I don't think I can try to boot it because I am in VB so I didn't bother with grub-install.
    I am curious as to what exact steps you used.
    BTW what is the partition structure on your raid drives? Do you have more than one partition on each?
    How did you copy your root fs to the raid?

    One thought I had is that the mdadm install might not have been copied properly. Wild guess. But you could reinstall mdadm in the chroot context and then update-grub again and see if that corrects the problem.

  6. #16
    Join Date
    Apr 2007
    Beans
    107

    Re: Trouble installing grub on RAID array

    Quote Originally Posted by psusi View Post
    At the rescue prompt, if you type ls by itself, it shows (md/0)? But ls (md/0)/ shows no results?
    That's correct. "ls (/md/0)/" produces a blank line and nothing else.

  7. #17
    Join Date
    Apr 2007
    Beans
    107

    Re: Trouble installing grub on RAID array

    Quote Originally Posted by YesWeCan View Post
    'sudo mdadm --create /dev/md0 --level=5 --raid-devices=3 /dev/sdb /dev/sdc missing'
    'sudo mkfs.ext4 /dev/md0'
    'sudo mkdir /media/raid'
    'sudo mount /dev/md0 /media/raid'

    then I copied my root fs to the raid
    'sudo rsync -var --exclude=/media --exclude=/dev / /media/raid'

    then I did your exact commands in post #1 to chroot to it, then
    'update-grub'

    then looked at /dev/grub/grub.cfg and it looks correct,
    Yep, and that's what I did, too, both this time and the last time, when I successfully built an array. This time I think I accidentally formatted the filesystem ext3 first then went back and redid it as ext4, but otherwise that's what I've done. The exact command for copying data is:
    Code:
    sudo nice ionice -c3 rsync --verbose --archive --delete --update --one-file-system --human-readable --progress / /mnt/raid/
    BTW what is the partition structure on your raid drives? Do you have more than one partition on each?
    See attached RESULTS.txt.gz above. The two RAID drives each have a swap partition.

    One thought I had is that the mdadm install might not have been copied properly. Wild guess. But you could reinstall mdadm in the chroot context and then update-grub again and see if that corrects the problem.
    It didn't correct the problem, but it produced a warning:
    Code:
    # sudo apt-get install --reinstall mdadm
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
    1 not fully installed or removed.
    Need to get 0B/240kB of archives.
    After this operation, 0B of additional disk space will be used.
    Preconfiguring packages ...
    (Reading database ... 341271 files and directories currently installed.)
    Preparing to replace mdadm 2.6.7.1-1ubuntu16 (using .../mdadm_2.6.7.1-1ubuntu16_amd64.deb) ...
    Unpacking replacement mdadm ...
    Processing triggers for ureadahead ...
    Processing triggers for doc-base ...
    Processing 2 removed 1 changed doc-base file(s)...
    Registering documents with scrollkeeper...
    Processing triggers for man-db ...
    Setting up mdadm (2.6.7.1-1ubuntu16) ...
    Generating array device nodes... /var/lib/dpkg/info/mdadm.postinst: 170: /dev/MAKEDEV: not found
    failed.
     Removing any system startup links for /etc/init.d/mdadm-raid ...
    update-initramfs: deferring update (trigger activated)
    update-rc.d: warning: mdadm start runlevel arguments (2 3 4 5) do not match LSB Default-Start values (S)
    update-rc.d: warning: mdadm stop runlevel arguments (0 1 6) do not match LSB Default-Stop values (0 6)
    runlevel:/var/run/utmp: No such file or directory
     * Starting MD monitoring service mdadm --monitor                        [ OK ] 
    Processing triggers for initramfs-tools ...
    update-initramfs: Generating /boot/initrd.img-2.6.35-25-generic
    mdadm: md device /dev/md127 does not appear to be active.
    From my Googling, though, that's harmless. More interestingly, the new /etc/mdadm/mdadm.conf it produced has an md/0 in it!
    Code:
    # cat /etc/mdadm/mdadm.conf 
    # mdadm.conf
    #
    # Please refer to mdadm.conf(5) for information about this file.
    #
    
    # by default, scan all partitions (/proc/partitions) for MD superblocks.
    # alternatively, specify devices to scan, using wildcards if desired.
    DEVICE partitions
    
    # auto-create devices with Debian standard permissions
    CREATE owner=root group=disk mode=0660 auto=yes
    
    # automatically tag new arrays as belonging to the local system
    HOMEHOST <system>
    
    # instruct the monitoring daemon where to send mail alerts
    MAILADDR root
    
    # definitions of existing MD arrays
    ARRAY /dev/md/0 level=raid5 metadata=1.2 num-devices=3 UUID=98ab8ad1:23e4df2e:d8bb3605:b9be0e1f name=eve:0
    ARRAY /dev/md0 level=raid5 num-devices=3 UUID=c45843d4:a0418d21:00706633:8bce23f2
    
    # This file was auto-generated on Sun, 06 Feb 2011 09:11:09 +1100
    # by mkconf $Id$
    So I took a look at /proc/mdstat:

    # cat /proc/mdstat
    Code:
    Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] 
    md127 : inactive sdd1[2](S)
          204804544 blocks
           
    md0 : active raid5 sda1[0] sdc1[1]
          968576000 blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/2] [UU_]
          
    unused devices: <none>
    That "md127" on /dev/sdd1 is a leftover from my old RAID array. I don't know why it's md127 and not md/0 but it seems to be the same thing:

    Code:
     # mdadm --examine /dev/sda1 /dev/sdc1 /dev/sdd1 | egrep 'UUID|/dev'
    /dev/sda1:
         Array UUID : 98ab8ad1:23e4df2e:d8bb3605:b9be0e1f
        Device UUID : 56b64914:fa4f68bf:a9dbe8f9:68e1b477
    /dev/sdc1:
         Array UUID : 98ab8ad1:23e4df2e:d8bb3605:b9be0e1f
        Device UUID : 3af9a379:9b51803a:4e261ec4:3aa28cdd
    /dev/sdd1:
               UUID : c45843d4:a0418d21:00706633:8bce23f2 (local to host eve)
    I think I will destroy /dev/sdd1 (which is useless anyway), reinstall mdadm, and see if that helps.

  8. #18
    psusi is offline Ubuntu addict and loving it
    Join Date
    Sep 2005
    Location
    Orlando, FL
    Beans
    3,980
    Distro
    Ubuntu Development Release

    Re: Trouble installing grub on RAID array

    Now you seem to have two different arrays, one of which is using format 1.2, which grub can not work with.

  9. #19
    Join Date
    Apr 2007
    Beans
    107

    Re: Trouble installing grub on RAID array

    Quote Originally Posted by parsim View Post
    I think I will destroy /dev/sdd1 (which is useless anyway), reinstall mdadm, and see if that helps.
    After that, /etc/mdadm/mdadm.conf dropped the line for the old array, leaving just the existing one... but it's still mapped to wrong device:
    Code:
    # cat /etc/mdadm/mdadm.conf 
    # mdadm.conf
    #
    # Please refer to mdadm.conf(5) for information about this file.
    #
    
    # by default, scan all partitions (/proc/partitions) for MD superblocks.
    # alternatively, specify devices to scan, using wildcards if desired.
    DEVICE partitions
    
    # auto-create devices with Debian standard permissions
    CREATE owner=root group=disk mode=0660 auto=yes
    
    # automatically tag new arrays as belonging to the local system
    HOMEHOST <system>
    
    # instruct the monitoring daemon where to send mail alerts
    MAILADDR root
    
    # definitions of existing MD arrays
    ARRAY /dev/md/0 level=raid5 metadata=1.2 num-devices=3 UUID=98ab8ad1:23e4df2e:d8bb3605:b9be0e1f name=eve:0
    
    # This file was auto-generated on Sun, 06 Feb 2011 10:02:34 +1100
    # by mkconf $Id$
    I tried manually editing that to "/dev/md0" but it makes no difference: grub still sets root to "md/0". Which doesn't exist.

    Code:
    # ls -l /dev/md*
    brw-rw---- 1 root disk 9, 0 2011-02-06 09:45 /dev/md0

  10. #20
    psusi is offline Ubuntu addict and loving it
    Join Date
    Sep 2005
    Location
    Orlando, FL
    Beans
    3,980
    Distro
    Ubuntu Development Release

    Re: Trouble installing grub on RAID array

    I don't think the version of grub in Ubuntu supports metadata format 1.2.

Page 2 of 3 FirstFirst 123 LastLast

Bookmarks

Posting Permissions

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