Page 1 of 2 12 LastLast
Results 1 to 10 of 96

Thread: Grub2 + mdadm RAID1 = cycle reset before grub menu :(

Hybrid View

  1. #1
    Join Date
    Jan 2011
    Beans
    11

    Angry Grub2 + mdadm RAID1 = cycle reset before grub menu :(

    Grub2 + mdadm RAID1 = cycle reset before grub menu

    AS IS:
    /dev/sdb1 on / type ext4

    root@office:~# uname -a
    Linux office 2.6.35-24-server #42-Ubuntu SMP Thu Dec 2 03:58:11 UTC 2010 x86_64 GNU/Linux

    root@office:~# mount
    [spoiler]
    /dev/sdb1 on / type ext4 (rw,noatime,errors=remount-ro,commit=0)
    proc on /proc type proc (rw,noexec,nosuid,nodev)
    none on /sys type sysfs (rw,noexec,nosuid,nodev)
    fusectl on /sys/fs/fuse/connections type fusectl (rw)
    none on /sys/kernel/debug type debugfs (rw)
    none on /sys/kernel/security type securityfs (rw)
    none on /dev type devtmpfs (rw,mode=0755)
    none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
    none on /dev/shm type tmpfs (rw,nosuid,nodev)
    none on /var/run type tmpfs (rw,nosuid,mode=0755)
    none on /var/lock type tmpfs (rw,noexec,nosuid,nodev)
    /dev/md0 on /mnt/md0 type ext4 (rw,noatime,commit=0)
    /dev/md1 on /mnt/md1 type ext4 (rw,noatime,commit=0)
    binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
    [/spoiler]

    root@office:~# cat /proc/mdstat
    [spoiler]
    root@office:~# cat /proc/mdstat
    Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
    md1 : active raid10 sde5[3] sdc5[1] sdd5[2]
    1228869504 blocks 64K chunks 2 near-copies [4/3] [_UUU]

    md2 : active raid10 sdc6[1] sdd6[2] sde6[3]
    20971392 blocks 64K chunks 2 near-copies [4/3] [_UUU]

    md0 : active raid1 sdc1[1] sdd1[2] sde1[3]
    208704 blocks [4/3] [_UUU]
    [/spoiler]

    try RAID

    root@office:~# cat /mnt/md1/etc/fstab
    [spoiler]
    /dev/md0 /boot ext4 defaults 0 0
    /dev/md1 / ext4 errors=remount-ro 0 1
    /dev/md2 none swap sw,pri=5 0 0
    [/spoiler]

    TO BE:

    #md0 : active raid1 sdc1[1] sdd1[2] sde1[3]
    /dev/md0 /boot ext4 defaults 0 0
    #md1 : active raid10 sde5[3] sdc5[1] sdd5[2
    /dev/md1 / ext4 errors=remount-ro 0 1



    rsync ... /boot /mnt/md0
    rsync ... / /mnt/md1

    chroot /mnt/md1
    update-grub
    update-initramfs -vu
    grub-install /dev/sdc
    grub-install /dev/sdd
    grub-install /dev/sde

    root@office:~# blkid
    [spoiler]
    /dev/sda1: LABEL="backup" UUID="d63ed235-b1a3-475c-bd24-2c38eda6078c" TYPE="ext4"
    /dev/sdb1: UUID="103aed4a-b7bd-4b59-b480-6f01f1fd1470" TYPE="ext4"
    /dev/sdb5: UUID="20ab2fa3-58e0-478d-8bdf-191de325dec0" TYPE="swap"
    /dev/sdd1: UUID="e374e3c1-793c-3f88-5774-42e6f4e07f49" TYPE="linux_raid_member"
    /dev/sdd5: UUID="35931e99-bcaa-43f0-5774-42e6f4e07f49" TYPE="linux_raid_member"
    /dev/sdd6: UUID="7c6d2401-ba00-f6db-5774-42e6f4e07f49" TYPE="linux_raid_member"
    /dev/sdc1: UUID="e374e3c1-793c-3f88-5774-42e6f4e07f49" TYPE="linux_raid_member"
    /dev/sdc5: UUID="35931e99-bcaa-43f0-5774-42e6f4e07f49" TYPE="linux_raid_member"
    /dev/sdc6: UUID="7c6d2401-ba00-f6db-5774-42e6f4e07f49" TYPE="linux_raid_member"
    /dev/sde1: UUID="e374e3c1-793c-3f88-5774-42e6f4e07f49" TYPE="linux_raid_member"
    /dev/sde5: UUID="35931e99-bcaa-43f0-5774-42e6f4e07f49" TYPE="linux_raid_member"
    /dev/sde6: UUID="7c6d2401-ba00-f6db-5774-42e6f4e07f49" TYPE="linux_raid_member"
    /dev/md0: UUID="b23ef133-bb62-417b-abcb-dc5a061e9adc" TYPE="ext4"
    /dev/md2: UUID="3c576433-fe63-49e0-b0a1-2c6e7be94552" TYPE="swap"
    /dev/md1: UUID="0887a872-dc0f-41a8-9d5e-2c40f339d711" TYPE="ext4"
    [/spoiler]

    root@office:~# cat /mnt/md0/grub/grub.cfg
    [spoiler]
    #
    # DO NOT EDIT THIS FILE
    #
    # It is automatically generated by grub-mkconfig using templates
    # from /etc/grub.d and settings from /etc/default/grub
    #

    ### BEGIN /etc/grub.d/00_header ###
    if [ -s $prefix/grubenv ]; then
    set have_grubenv=true
    load_env
    fi
    set default="0"
    if [ "${prev_saved_entry}" ]; then
    set saved_entry="${prev_saved_entry}"
    save_env saved_entry
    set prev_saved_entry=
    save_env prev_saved_entry
    set boot_once=true
    fi

    function savedefault {
    if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
    fi
    }

    function recordfail {
    set recordfail=1
    if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
    }

    function load_video {
    insmod vbe
    insmod vga
    }

    insmod raid
    insmod mdraid
    insmod part_msdos
    insmod part_msdos
    insmod part_msdos # почему только 3 раза ?

    insmod ext2
    set root='(md1)' #КТО ЭТО ДЕЛАЕТ ????????????
    search --no-floppy --fs-uuid --set 0887a872-dc0f-41a8-9d5e-2c40f339d711
    if loadfont /usr/share/grub/unicode.pf2 ; then
    set gfxmode=640x480
    load_video
    insmod gfxterm
    fi
    terminal_output gfxterm
    insmod raid
    insmod mdraid
    insmod part_msdos
    insmod part_msdos
    insmod part_msdos
    insmod ext2
    set root='(md0)'
    search --no-floppy --fs-uuid --set b23ef133-bb62-417b-abcb-dc5a061e9adc
    set locale_dir=($root)/grub/locale
    set lang=ru
    insmod gettext
    if [ "${recordfail}" = 1 ]; then
    set timeout=-1
    else
    set timeout=10
    fi
    ### END /etc/grub.d/00_header ###

    ### BEGIN /etc/grub.d/05_debian_theme ###
    set menu_color_normal=white/black
    set menu_color_highlight=black/light-gray
    ### END /etc/grub.d/05_debian_theme ###

    ### BEGIN /etc/grub.d/09_raid ###
    # This file provides an easy way to add custom menu entries. Simply type the
    # menu entries you want to add after this comment. Be careful not to change
    # the 'exec tail' line above.
    menuentry 'Ubuntu, with Linux 2.6.35-24-server RAID' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod raid
    insmod mdraid
    insmod part_msdos
    insmod ext2
    set root='(md0)'
    linux /vmlinuz-2.6.35-24-server root=/dev/md1 ro
    initrd /initrd.img-2.6.35-24-server
    }

    ### END /etc/grub.d/09_raid ###

    ### BEGIN /etc/grub.d/10_linux ###
    menuentry 'Ubuntu, with Linux 2.6.35-24-server' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod raid
    insmod mdraid
    insmod part_msdos
    insmod part_msdos
    insmod part_msdos
    insmod ext2
    set root='(md0)'
    search --no-floppy --fs-uuid --set b23ef133-bb62-417b-abcb-dc5a061e9adc
    linux /vmlinuz-2.6.35-24-server root=UUID=0887a872-dc0f-41a8-9d5e-2c40f339d711 ro splash quiet
    initrd /initrd.img-2.6.35-24-server
    }
    menuentry 'Ubuntu, with Linux 2.6.35-24-server (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod raid
    insmod mdraid
    insmod part_msdos
    insmod part_msdos
    insmod part_msdos
    insmod ext2
    set root='(md0)'
    search --no-floppy --fs-uuid --set b23ef133-bb62-417b-abcb-dc5a061e9adc
    echo 'Loading Linux 2.6.35-24-server ...'
    linux /vmlinuz-2.6.35-24-server root=UUID=0887a872-dc0f-41a8-9d5e-2c40f339d711 ro single
    echo 'Loading initial ramdisk ...'
    initrd /initrd.img-2.6.35-24-server
    }
    menuentry 'Ubuntu, with Linux 2.6.35-23-server' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod raid
    insmod mdraid
    insmod part_msdos
    insmod part_msdos
    insmod part_msdos
    insmod ext2
    set root='(md0)'
    search --no-floppy --fs-uuid --set b23ef133-bb62-417b-abcb-dc5a061e9adc
    linux /vmlinuz-2.6.35-23-server root=UUID=0887a872-dc0f-41a8-9d5e-2c40f339d711 ro splash quiet
    initrd /initrd.img-2.6.35-23-server
    }
    menuentry 'Ubuntu, with Linux 2.6.35-23-server (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod raid
    insmod mdraid
    insmod part_msdos
    insmod part_msdos
    insmod part_msdos
    insmod ext2
    set root='(md0)'
    search --no-floppy --fs-uuid --set b23ef133-bb62-417b-abcb-dc5a061e9adc
    echo 'Loading Linux 2.6.35-23-server ...'
    linux /vmlinuz-2.6.35-23-server root=UUID=0887a872-dc0f-41a8-9d5e-2c40f339d711 ro single
    echo 'Loading initial ramdisk ...'
    initrd /initrd.img-2.6.35-23-server
    }
    ### END /etc/grub.d/10_linux ###

    ### BEGIN /etc/grub.d/20_linux_xen ###
    ### END /etc/grub.d/20_linux_xen ###

    ### BEGIN /etc/grub.d/20_memtest86+ ###
    menuentry "Memory test (memtest86+)" {
    insmod raid
    insmod mdraid
    insmod part_msdos
    insmod part_msdos
    insmod part_msdos
    insmod ext2
    set root='(md0)'
    search --no-floppy --fs-uuid --set b23ef133-bb62-417b-abcb-dc5a061e9adc
    linux16 /memtest86+.bin
    }
    menuentry "Memory test (memtest86+, serial console 115200)" {
    insmod raid
    insmod mdraid
    insmod part_msdos
    insmod part_msdos
    insmod part_msdos
    insmod ext2
    set root='(md0)'
    search --no-floppy --fs-uuid --set b23ef133-bb62-417b-abcb-dc5a061e9adc
    linux16 /memtest86+.bin console=ttyS0,115200n8
    }
    ### END /etc/grub.d/20_memtest86+ ###

    ### BEGIN /etc/grub.d/30_os-prober ###
    if [ "x${timeout}" != "x-1" ]; then
    if keystatus; then
    if keystatus --shift; then
    set timeout=-1
    else
    set timeout=0
    fi
    else
    if sleep --interruptible 3 ; then
    set timeout=0
    fi
    fi
    fi
    ### END /etc/grub.d/30_os-prober ###

    ### BEGIN /etc/grub.d/40_custom ###
    # This file provides an easy way to add custom menu entries. Simply type the
    # menu entries you want to add after this comment. Be careful not to change
    # the 'exec tail' line above.
    ### END /etc/grub.d/40_custom ###

    ### BEGIN /etc/grub.d/41_custom ###
    if [ -f $prefix/custom.cfg ]; then
    source $prefix/custom.cfg;
    fi
    ### END /etc/grub.d/41_custom ###

    [/spoiler]

    try boot from /dev/sdc /dev/sdd dev/sde
    cycle reset before grub menu
    no messages
    no logs
    reset

    any ideas ?

  2. #2
    Join Date
    Jun 2010
    Beans
    181

    Re: Grub2 + mdadm RAID1 = cycle reset before grub menu :(

    I can see that you have Raid10 with 3 partitions: (editsde5[3] sdc5[1] sdd5[2] - that means the array must be started as "degraded". If something will go wrong with assembling degraded array during boot then Grub wont have access to your Root device.
    What results comes from: >mdadm -D /dev/md1

    I'm not completely sure how much difference it makes, but in case of problems with grub I go different way:
    - mount /root device
    - mount /boot device inside /root (as it would be mounted normally)
    > grub-install --root-directory=</path_to/mounted_root> --recheck <--nofloppy>

    ...and it allways worked fine for me.
    Last edited by disabledaccount; January 7th, 2011 at 11:08 AM.

  3. #3
    Join Date
    Jan 2011
    Beans
    11

    Re: Grub2 + mdadm RAID1 = cycle reset before grub menu :(

    Quote Originally Posted by tomazzi View Post
    mdadm -D /dev/md1
    /dev/md1 is degraded before finish migration root from /dev/sdb to /dev/md1

    root@office:~# mdadm -D /dev/md1
    /dev/md1:
    Version : 00.90
    Creation Time : Wed Jan 5 03:09:59 2011
    Raid Level : raid10
    Array Size : 1228869504 (1171.94 GiB 1258.36 GB)
    Used Dev Size : 614434752 (585.97 GiB 629.18 GB)
    Raid Devices : 4
    Total Devices : 3
    Preferred Minor : 1
    Persistence : Superblock is persistent

    Update Time : Sat Jan 8 16:18:36 2011
    State : active, degraded
    Active Devices : 3
    Working Devices : 3
    Failed Devices : 0
    Spare Devices : 0

    Layout : near=2, far=1
    Chunk Size : 64K

    UUID : 35931e99:bcaa43f0:577442e6:f4e07f49 (local to host office)
    Events : 0.413368

    Number Major Minor RaidDevice State
    0 0 0 0 removed
    1 8 37 1 active sync /dev/sdc5
    2 8 53 2 active sync /dev/sdd5
    3 8 69 3 active sync /dev/sde5

  4. #4
    Join Date
    Jan 2011
    Beans
    11

    Re: Grub2 + mdadm RAID1 = cycle reset before grub menu :(

    Quote Originally Posted by tomazzi View Post
    I'm not completely sure how much difference it makes, but in case of problems with grub I go different way:
    - mount /root device
    - mount /boot device inside /root (as it would be mounted normally)
    > grub-install --root-directory=</path_to/mounted_root> --recheck <--nofloppy>

    ...and it allways worked fine for me.
    root@office:~# mount | grep md
    /dev/md0 on /mnt/md0 type ext4 (rw,noatime,commit=0)
    /dev/md1 on /mnt/md1 type ext4 (rw,noatime,commit=0)
    /dev/md0 on /mnt/md1/boot type ext4 (rw)


    root@office:~# grub-install --root-directory=/mnt/md1 --recheck --no-floppy /dev/sdc
    Installation finished. No error reported.
    root@office:~# grub-install --root-directory=/mnt/md1 --recheck --no-floppy /dev/sdd
    Installation finished. No error reported.
    root@office:~# grub-install --root-directory=/mnt/md1 --recheck --no-floppy /dev/sde
    Installation finished. No error reported.

    Only I will try to be loaded a bit later - it is necessary to go on an installation site
    I will necessarily write result

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

    Re: Grub2 + mdadm RAID1 = cycle reset before grub menu :(

    In order to update or reinstall grub within the chroot, you must bind mount /dev, /sys, and /proc into the chroot, and have /boot properly mounted.

    Also just to make sure, the reason your two raid10s are degraded is because you are planning on adding the two original drives after you migrate the system to the raid?

  6. #6
    Join Date
    Jan 2011
    Beans
    11

    Re: Grub2 + mdadm RAID1 = cycle reset before grub menu :(

    Quote Originally Posted by psusi View Post
    In order to update or reinstall grub within the chroot, you must bind mount /dev, /sys, and /proc into the chroot, and have /boot properly mounted.
    in tomazzi variant i dont use chroot
    root@office:~# grub-install --root-directory=/mnt/md1 --recheck --no-floppy /dev/sdc

    Quote Originally Posted by psusi View Post
    Also just to make sure, the reason your two raid10s are degraded is because you are planning on adding the two original drives after you migrate the system to the raid?
    i planned add single physical drive with two partition

    one partition (sdb5) in md1
    md1 : active raid10 sde5[3] sdc5[1] sdd5[2]
    1228869504 blocks 64K chunks 2 near-copies [4/3] [_UUU]

    and one partition (sdb6) in md2
    md2 : active raid10 sdc6[1] sdd6[2] sde6[3]
    20971392 blocks 64K chunks 2 near-copies [4/3] [_UUU]

  7. #7
    Join Date
    Jan 2011
    Beans
    11

    Unhappy Re: Grub2 + mdadm RAID1 = cycle reset before grub menu :(

    Quote Originally Posted by vharseko View Post
    root@office:~# mount | grep md
    /dev/md0 on /mnt/md0 type ext4 (rw,noatime,commit=0)
    /dev/md1 on /mnt/md1 type ext4 (rw,noatime,commit=0)
    /dev/md0 on /mnt/md1/boot type ext4 (rw)


    root@office:~# grub-install --root-directory=/mnt/md1 --recheck --no-floppy /dev/sdc
    Installation finished. No error reported.
    root@office:~# grub-install --root-directory=/mnt/md1 --recheck --no-floppy /dev/sdd
    Installation finished. No error reported.
    root@office:~# grub-install --root-directory=/mnt/md1 --recheck --no-floppy /dev/sde
    Installation finished. No error reported.

    Only I will try to be loaded a bit later - it is necessary to go on an installation site
    I will necessarily write result
    the same result
    On a circle an reboot before menu grub

  8. #8
    Join Date
    Jun 2010
    Beans
    181

    Re: Grub2 + mdadm RAID1 = cycle reset before grub menu :(

    Strange...

    What I suppose:
    - GRUB2 raid module can't assemble array - You can try to install unconfigured grub on some spare hdd, then try to boot manually (from grub console) >insmod raid, set root, etc This can tell you where is the problem.

    - You have hw problems. Check each hdd SMART report at first - especially C7 UDMA CRC errors counters. Check RAM with memtest, run some stress test from live_CD.

    Have you tried to boot from different hdd's? (You have 3x hdd raid1 on /boot)

  9. #9
    Join Date
    Jan 2011
    Beans
    11

    Re: Grub2 + mdadm RAID1 = cycle reset before grub menu :(

    Quote Originally Posted by tomazzi View Post
    Strange...

    - You have hw problems. Check each hdd SMART report at first - especially C7 UDMA CRC errors counters. Check RAM with memtest, run some stress test from live_CD.
    It is excluded, as on this computer perfectly there is a loading from a single disk

  10. #10
    Join Date
    Jan 2011
    Beans
    11

    Re: Grub2 + mdadm RAID1 = cycle reset before grub menu :(

    Quote Originally Posted by tomazzi View Post
    Have you tried to boot from different hdd's? (You have 3x hdd raid1 on /boot)
    Certainly, I have tried to be loaded from each of three disks:

    root@office:~# grub-install --root-directory=/mnt/md1 --recheck --no-floppy /dev/sdc
    Installation finished. No error reported.
    root@office:~# grub-install --root-directory=/mnt/md1 --recheck --no-floppy /dev/sdd
    Installation finished. No error reported.
    root@office:~# grub-install --root-directory=/mnt/md1 --recheck --no-floppy /dev/sde
    Installation finished. No error reported.

    , a situation identical - reset before menu grub

Page 1 of 2 12 LastLast

Tags for this Thread

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
  •