setup-swraid1-on-a-running-lvm-system-ubuntu-10.04 - SDB dont boot but SDA yes

Discussion in 'HOWTO-Related Questions' started by lucho115, Jun 15, 2011.

  1. lucho115

    lucho115 New Member

    Hi, iam try to do a setup thats descripted in this how to:
    http://www.howtoforge.com/how-to-se...-system-incl-grub2-configuration-ubuntu-10.04

    All was ok, but when iam trying to tested a get boot from sda if remove sdb, but if remove sda, sdb dont boot, and say these: cant find the device 8f67c746-fcb9-4735-a3c3-deb113204ae7 and give me a grub console.
    So, i reconect sda, boot ok, and run grub-install sda and grub-install sdb again, and then try again to remove sda, now i get that the system reboot when charging grub, so waht happening?
    to reference the 2 disk are tested and smart mark like ok without problems.
    I put sda ok, and boot ok, but why i cant boot from sdb?
    thks and sorry about my english.
    bye
     
  2. falko

    falko Super Moderator

    Did you do the following (I quote from the tutorial - page 4)?

     
  3. lucho115

    lucho115 New Member

    Yes falko, i do that, but anyway the system reboot when load grub.
    I also build the raid again doing this:

    Code:
    mdadm --manage /dev/md0 --fail /dev/sdb1
    mdadm --manage /dev/md1 --fail /dev/sdb5
    mdadm --manage /dev/md0 --remove /dev/sdb1
    mdadm --manage /dev/md1 --remove /dev/sdb5
    shutdown -h now
    sfdisk -d /dev/sda | sfdisk --force /dev/sdb
    mdadm --zero-superblock /dev/sdb1
    mdadm --zero-superblock /dev/sdb5
    mdadm -a /dev/md0 /dev/sdb1
    mdadm -a /dev/md1 /dev/sdb5
    grub-install /dev/sda
    grub-install /dev/sdb
    
    Then reboot, all ok, so remove again sda, put sdb in sda place, and get the same, the system reboot loading grub, but if i insert sda its boot ok, also try sda in sdb place and boot ok.
    Any other idea?
    thks
     
  4. falko

    falko Super Moderator

    Which distribution do you use?

    What's in /etc/fstab and /boot/grub/grub.cfg?
     
  5. lucho115

    lucho115 New Member

    Falko thanks for post here, iam using ubuntu 10.04.2 server, and the files:

    /etc/fstab
    Code:
    # /etc/fstab: static file system information.
    #
    # Use 'blkid -o value -s UUID' to print the universally unique identifier
    # for a device; this may be used with UUID= as a more robust way to name
    # devices that works even if disks are added and removed. See fstab(5).
    #
    # <file system> <mount point>   <type>  <options>       <dump>  <pass>
    proc            /proc           proc    nodev,noexec,nosuid 0       0
    /dev/mapper/mysql-root /               ext4    errors=remount-ro 0       1
    # /boot was on /dev/sda1 during installation
    #UUID=8f67c746-fcb9-4735-a3c3-deb113204ae7 /boot           ext2    defaults        0       2
    /dev/md0 /boot           ext2    defaults        0       2
    /dev/mapper/mysql-swap_1 none            swap    sw              0       0
    
    /boot/grub/grub.cfg
    Code:
    #
    # DO NOT EDIT THIS FILE
    #
    # It is automatically generated by /usr/sbin/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
      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
    }
    insmod raid
    insmod mdraid
    insmod lvm
    insmod ext2
    set root='(mysql-root)'
    search --no-floppy --fs-uuid --set 20055c28-f960-44bc-80d4-1a0bd714ab5a
    if loadfont /usr/share/grub/unicode.pf2 ; then
      set gfxmode=640x480
      insmod gfxterm
      insmod vbe
      if terminal_output gfxterm ; then true ; else
        # For backward compatibility with versions of terminal.mod that don't
        # understand terminal_output
        terminal gfxterm
      fi
    fi
    insmod raid
    insmod mdraid
    insmod ext2
    set root='(md0)'
    search --no-floppy --fs-uuid --set 6348ca9c-7027-4d2b-9452-05745c0f2acb
    set locale_dir=($root)/grub/locale
    set lang=es
    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/10_linux ###
    menuentry 'Ubuntu, con Linux 2.6.32-32-generic-pae' --class ubuntu --class gnu-linux --class gnu --class os {
    	recordfail
    	insmod raid
    	insmod mdraid
    	insmod ext2
    	set root='(md0)'
    	search --no-floppy --fs-uuid --set 6348ca9c-7027-4d2b-9452-05745c0f2acb
    	linux	/vmlinuz-2.6.32-32-generic-pae root=/dev/mapper/mysql-root ro   quiet
    	initrd	/initrd.img-2.6.32-32-generic-pae
    }
    menuentry 'Ubuntu, con Linux 2.6.32-32-generic-pae (modo recuperación)' --class ubuntu --class gnu-linux --class gnu --class os {
    	recordfail
    	insmod raid
    	insmod mdraid
    	insmod ext2
    	set root='(md0)'
    	search --no-floppy --fs-uuid --set 6348ca9c-7027-4d2b-9452-05745c0f2acb
    	echo	'Cargando Linux 2.6.32-32-generic-pae ...'
    	linux	/vmlinuz-2.6.32-32-generic-pae root=/dev/mapper/mysql-root ro single 
    	echo	'Cargando el disco RAM inicial...'
    	initrd	/initrd.img-2.6.32-32-generic-pae
    }
    menuentry 'Ubuntu, con Linux 2.6.32-28-generic-pae' --class ubuntu --class gnu-linux --class gnu --class os {
    	recordfail
    	insmod raid
    	insmod mdraid
    	insmod ext2
    	set root='(md0)'
    	search --no-floppy --fs-uuid --set 6348ca9c-7027-4d2b-9452-05745c0f2acb
    	linux	/vmlinuz-2.6.32-28-generic-pae root=/dev/mapper/mysql-root ro   quiet
    	initrd	/initrd.img-2.6.32-28-generic-pae
    }
    menuentry 'Ubuntu, con Linux 2.6.32-28-generic-pae (modo recuperación)' --class ubuntu --class gnu-linux --class gnu --class os {
    	recordfail
    	insmod raid
    	insmod mdraid
    	insmod ext2
    	set root='(md0)'
    	search --no-floppy --fs-uuid --set 6348ca9c-7027-4d2b-9452-05745c0f2acb
    	echo	'Cargando Linux 2.6.32-28-generic-pae ...'
    	linux	/vmlinuz-2.6.32-28-generic-pae root=/dev/mapper/mysql-root ro single 
    	echo	'Cargando el disco RAM inicial...'
    	initrd	/initrd.img-2.6.32-28-generic-pae
    }
    ### END /etc/grub.d/10_linux ###
    
    ### BEGIN /etc/grub.d/20_memtest86+ ###
    menuentry "Memory test (memtest86+)" {
    	insmod raid
    	insmod mdraid
    	insmod ext2
    	set root='(md0)'
    	search --no-floppy --fs-uuid --set 6348ca9c-7027-4d2b-9452-05745c0f2acb
    	linux16	/memtest86+.bin
    }
    menuentry "Memory test (memtest86+, serial console 115200)" {
    	insmod raid
    	insmod mdraid
    	insmod ext2
    	set root='(md0)'
    	search --no-floppy --fs-uuid --set 6348ca9c-7027-4d2b-9452-05745c0f2acb
    	linux16	/memtest86+.bin console=ttyS0,115200n8
    }
    ### END /etc/grub.d/20_memtest86+ ###
    
    ### BEGIN /etc/grub.d/30_os-prober ###
    if [ ${timeout} != -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 ###
    
    i will wait for help. tks.
     
  6. lucho115

    lucho115 New Member

    Please, any help is welcome.
     
  7. lucho115

    lucho115 New Member

    OK, i forget to say that wheni rebuild the raid again this happen:

    Code:
    mdadm --manage /dev/md0 --fail /dev/sdb1
    mdadm --manage /dev/md1 --fail /dev/sdb5
    mdadm --manage /dev/md0 --remove /dev/sdb1
    mdadm --manage /dev/md1 --remove /dev/sdb5
    
    I run :
    Code:
    cat /proc/mdstat
    and i get:

    Code:
    root@mysql:~# cat /proc/mdstat
    Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
    md0 : active raid1 sda1[0] 
          248768 blocks [2/1] [U_]
    
    md1 : active raid1 sda5[0]
          79792064 blocks [2/1] [U_]
    
    unused devices: <none>
    root@mysql:~#
    So, i reboot :

    Code:
    shutdown -h now
    And i do again:
    Code:
    cat /proc/mdstat
    , and i get :

    Code:
    root@mysql:~# cat /proc/mdstat
    Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
    md0 : active raid1 sda1[0] sdb1[0]
          248768 blocks [2/1] [UU]
    
    md1 : active raid1 sda5[0]
          79792064 blocks [2/1] [U_]
    
    unused devices: <none>
    root@mysql:~#
    Why md0 is again build?
    I removed again :

    Code:
    mdadm --manage /dev/md0 --fail /dev/sdb1
    mdadm --manage /dev/md0 --remove /dev/sdb1
    Now the sdb1 is removed, but i dont reboot because md0 will be rebuild again, so follow with this:

    Code:
    sfdisk -d /dev/sda | sfdisk --force /dev/sdb
    mdadm --zero-superblock /dev/sdb1
    mdadm --zero-superblock /dev/sdb5
    mdadm -a /dev/md0 /dev/sdb1
    mdadm -a /dev/md1 /dev/sdb5
    grub-install /dev/sda
    grub-install /dev/sdb
    
    This can explain the booting problem? or give you a kind of track?
    thks
     
  8. falko

    falko Super Moderator

    Is there a reference to 8f67c746-fcb9-4735-a3c3-deb113204ae7 anywhere in a file in the /boot/grub/ or /etc/grub.d/ directories?
     
  9. lucho115

    lucho115 New Member

    Nop, nothing, only in /etc/fstab this line:

    Code:
    #UUID=8f67c746-fcb9-4735-a3c3-deb113204ae7 /boot           ext2    defaults        0       2
    but, is commented, so doesnt used.
     
  10. falko

    falko Super Moderator

    Can you run
    Code:
    update-grub
    and
    Code:
    update-initramfs -u
    again?
     
  11. lucho115

    lucho115 New Member

    i didit, but i still have the same problem.
     
  12. lucho115

    lucho115 New Member

    i change the 2 disks, and i have installed ubuntu server 10.04.2, and build the raid with the installer, and all work ok. The 2 disks can boot. In other hand this is a new system and i need to use the other system. Any way this server is a mysql server, so i have installed only installesd apache, mysql, phpmyadmin, openssh, and nothing more. So i can backup the mysql bases, and used in the new system, but i have a problem that maybe the correct will be open other thread, and i will, but the problem is the following: The old system have the same packages installed, and at boot its consume 120 mb of ram, and the new one 230mb of ram, why i can happend?
    thks
     

Share This Page