Results 1 to 9 of 9

Thread: grub - error 21 before menu after hd-removal

  1. #1

    Default grub - error 21 before menu after hd-removal

    I want to remove a SSD (hd1) from my computer but I can't because I always get the "error 21" before the actual grub menu. I have also an extra harddrive for win7 and and one for Opensuse 12.1 (LVM).
    Grub sees the SSD as an bootable disk (windows 2) and when I try to remove it , grub doesn't work any longer. The funny thing is that I have never used it for Linux but as a fast disk for Windows games. Never for any operation system.
    Also if I try to delete it from the devicemap and the menu.lst does not change anything. "windows 1" is the win7 harddrive while hd0,0 (instead of hd0,1) is actually the correct parameter for booting windows.

    This is what Yast proposes for grub:

    Code:
    ###Don't change this comment - YaST2 identifier: Original name: linux###
    
     title openSUSE 12.1
         root (hd2,0)
         kernel /vmlinuz-3.1.10-1.16-desktop root=/dev/system/root    resume=/dev/system/swap splash=silent quiet showopts vga=0x345
         initrd /initrd-3.1.10-1.16-desktop
      ###Don't change this comment - YaST2 identifier: Original name: windows 1###
     title windows 1
         rootnoverify (hd0,1)
         chainloader +1
      ###Don't change this comment - YaST2 identifier: Original name: windows 2###
     title windows 2
         map (hd1) (hd0)
         map (hd0) (hd1)
         rootnoverify (hd1,0)
    
         makeactive
         chainloader +1
      ###Don't change this comment - YaST2 identifier: Original name: failsafe###
     title Failsafe -- openSUSE 12.1
         root (hd2,0)
         kernel /vmlinuz-3.1.10-1.16-desktop root=/dev/system/root showopts apm=off noresume edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset  x11failsafe vga=0x345
         initrd /initrd-3.1.10-1.16-desktop
      ###Don't change this comment - YaST2 identifier: Original name: linux###
     title Kernel-3.1.10-1.16-desktop
         root (hd2,0)
         kernel /vmlinuz-3.1.10-1.16-desktop root=/dev/system/root    resume=/dev/system/swap splash=silent quiet showopts vga=0x345
         initrd /initrd-3.1.10-1.16-desktop
    
     device.map
    
    (hd2)    /dev/disk/by-id/ata-WDC_WD20EARX-00PASB0_WD-WCAZAC494823
     (hd1)    /dev/disk/by-id/ata-OCZ-VERTEX2_OCZ-2IG70BB3MTWXQL8I
     (hd0)    /dev/disk/by-id/ata-ST31500541AS_6XW0RLM0
    I hope someone can help me. I was thinking of playing with the hdx,y values or using a Knoppix CD and make a new grub but I am a little bit afraid of messing up everything.

  2. #2
    Join Date
    Nov 2009
    Location
    West Virginia Sector 13
    Posts
    15,982

    Default Re: grub - error 21 before menu after hd-removal

    Remove the entry for Windows 2 It won;t look for it anymore

  3. #3

    Default Re: grub - error 21 before menu after hd-removal

    Quote Originally Posted by gogalthorp View Post
    Remove the entry for Windows 2 It won;t look for it anymore
    With these changes I get grub error 21 (after harddisk removal) as well

    Code:
    ###Don't change this comment - YaST2 identifier: Original name: linux###
    
     title openSUSE 12.1
         root (hd2,0)
         kernel /vmlinuz-3.1.10-1.16-desktop root=/dev/system/root    resume=/dev/system/swap splash=silent quiet showopts vga=0x345
         initrd /initrd-3.1.10-1.16-desktop
      ###Don't change this comment - YaST2 identifier: Original name: windows###
    
     title Windows
         rootnoverify (hd0,0)
         chainloader +1
    Code:
     (hd2)	/dev/disk/by-id/ata-WDC_WD20EARX-00PASB0_WD-WCAZAC494823
     (hd0)	/dev/disk/by-id/ata-ST31500541AS_6XW0RLM0
    Could it be that hd2 becomes automatically hd1 after I physically removed the 2. windows disk?

  4. #4
    Join Date
    Sep 2012
    Posts
    5,856

    Default Re: grub - error 21 before menu after hd-removal

    Quote Originally Posted by tubl View Post
    Could it be that hd2 becomes automatically hd1 after I physically removed the 2. windows disk?
    That is quite possible. GRUB refers to disks by BIOS scan order number; so if BIOS has only two disks, they are most probably hd0 and hd1.

    Do you get GRUB menu after error 21? If yes, you could edit menu entry and replace all occurrences hd2 with hd1 to test if it boots. If not, you probably need to boot from rescue CD and reinstall bootloader.

  5. #5

    Default Re: grub - error 21 before menu after hd-removal

    I get the error always before the grub menu and can't do anything but reboot and connect the harddisk again.
    I think I am going the risk it and change the bootloader in yast and I hope that grub finds everything in hd1 instead of hd2 after I have rebooted the pc.
    And yes, if it goes bad I need the rescue CD.

  6. #6
    Join Date
    Sep 2012
    Posts
    5,856

    Default Re: grub - error 21 before menu after hd-removal

    Quote Originally Posted by tubl View Post
    I get the error always before the grub menu and can't do anything but reboot and connect the harddisk again
    If you cannot boot without SSD, it is unlikely to help - you will have the same three disks in the wrong order.

    OK, after error 21 you should be left in Grub command line. Now try "find /grub/menu.lst". This hopefully should spit out '(hd1,0)'. Now do "configfile (hd1,0)/grub/menu.lst". This should load your menu. Now press ESC to exit graphical mode (if you use one), use 'e' to edit menu entry and replace (hd2,0) with (hd1,0). Press ESC when finished editing. Press 'b' to boot edited entry. This should hopefully let your kernel boot (notice that depending on other system settings your kernel may now be confused by changed disk names ...). If you will be able to boot, you can reinstall boot loader now.

    If it does not work there may still be some other way before rescue boot.

  7. #7

    Default Re: grub - error 21 before menu after hd-removal

    I changed the numbers and it worked. Well, somehow. Grub at least is not the problem any longer.
    But:


    I can not get any further. I can login as root and also have access to all encrypted LVM volumes but can not get into SUSE.
    It still expects the SSD as /windows/D

  8. #8
    Join Date
    Sep 2012
    Posts
    5,856

    Default Re: grub - error 21 before menu after hd-removal

    Quote Originally Posted by tubl View Post
    I can login as root
    Then login, edit /etc/fstab and remove reference to no more existing drive. If in doubt, check whether device given on /etc/fstab line actually exists (ls ... or similar).

    If you followed my advice (it is not clear from your reply), this is not permanent change. You will need to do it every time until you reinstall bootloader.

  9. #9

    Default Re: grub - error 21 before menu after hd-removal

    Quote Originally Posted by arvidjaar View Post
    Then login, edit /etc/fstab and remove reference to no more existing drive. If in doubt, check whether device given on /etc/fstab line actually exists (ls ... or similar).

    If you followed my advice (it is not clear from your reply), this is not permanent change. You will need to do it every time until you reinstall bootloader.
    I removed the line from fstab and it works.
    Thank you for your help!

Posting Permissions

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