1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Two Hard Disks and GRUB location /dev/hdb6

Discussion in 'Linux and Unix' started by zillah, Jan 13, 2006.

Thread Status:
Not open for further replies.
Advertisement
  1. saikee

    saikee

    Joined:
    Jun 11, 2004
    Messages:
    3,887
    I have gone over this ground a few times. Every time a disk is unplugged and later plugged back the disk order may be changed.

    My 4 disks were changing order all the time whenever I remove one away.

    Just be aware of it and especially you now know how to check it with the Grub command. Believe me Linux can only work with the disk order handed down from the BIOS.
     
  2. zillah

    zillah Thread Starter

    Joined:
    Jun 6, 2005
    Messages:
    330
    Yes I agree with you,,,,but in my case I have not plugged and unplugged the HDs.
     
  3. saikee

    saikee

    Joined:
    Jun 11, 2004
    Messages:
    3,887
    I don't think anybody knows what you have done.

    Post #1 you suggested Linux in the slave disk
    Post #5 shows Linux in hdb6
    Post #6 confirms again Linux is (hd1,5)
    Post #10 shows Linux in (hd0,5)<-----------------first time disks were swapped
    Post #13 confirrms again Linux in (hd0,5)
    Post #16 shows the original order of (hd1)=hdb in device.map
    Post #38 still shows Linux in (hd0,5)
    Post #40 You start correction making (hd0)=hdb and so (hd0,5) matches the Linux location<---------------Now everything matches
    Post #42 Confirmation of #40 above
    Post #47 You again confirm Linux can be found in (hd0,5)

    Post #58 You suddenly showed Linux returning to (hd1,5)<----------------2nd change, everything mismatched again.

    One thing for sure if you are looking for an excuse that Grub had changed it then you are in for a big surprise as everything Grub does in the "map" statement is temporary. You can manually type the map statement and you will not see the (hd0) and (hd1) reverse order.

    The first change at Post #6 was previously introduced by yourself before any advice wastaken up.
     
  4. zillah

    zillah Thread Starter

    Joined:
    Jun 6, 2005
    Messages:
    330
    Could you please confirm this:
    If I changed the values in the menu.lst,,,,does that affect the outpout of grub>geometry ?
    Because I was trying different values in the menu.lst,,,,,,but bear in mind that I have never changed the position for the HDs physically.
     
  5. saikee

    saikee

    Joined:
    Jun 11, 2004
    Messages:
    3,887
    Since you have a Grub prompt why don't you let Grub speak for itself.

    Do the geometry stataement, then the map statements and then repeat the map statement again. to see if the disk order has been changed

    Run the system, power down and check it again.
     
  6. zillah

    zillah Thread Starter

    Joined:
    Jun 6, 2005
    Messages:
    330
    grub > geometry (hd0)
    drive 0x80: C/H/S = 1023/255/63, The number of sectors = 78165360, LBA
    Partition num :0 , Filesystem type unknown, partition type 0xbb
    Partition num :1 , Filesystem type is fat, partition type 0xc
    Partition num :4 , Filesystem type unknown, partition type 0x82
    Partition num :5 , Filesystem type is ext2fs, partition type 0x83

    grub > geometry (hd1)
    drive 0x81: C/H/S = 1023/255/63, The number of sectors = 78156288, LBA
    Partition num :0 , Filesystem type unknown, partition type 0x7
    Partition num :1 , Filesystem type is fat, partition type 0xc
    Partition num :2 , Filesystem type unknown, partition type 0x7



    Code:
    grub> find /boot/grub/device.map
      (hd0,5)
    
    grub> cat  ([B]hd0,5[/B])/boot/grub/device.map
    # this device map was generated by anaconda
    (fd0)       /dev/fd0
    (hd0)       /dev/hda-------zero and A
    (hd1)       /dev/hdb-------one and B
    



    I did repeat the command again
    Code:
    grub> cat  ([B]hd0,5[/B])/boot/grub/device.map
    # this device map was generated by anaconda
    (fd0)       /dev/fd0
    (hd0)       /dev/hda-------zero and A
    (hd1)       /dev/hdb-------one and B
    


    I am looking to your commant.






    After doing all the above, I run the Linux System through command line from menu.lst then I restarted the PC , and I did these below again

    grub > geometry (hd0)
    drive 0x80: C/H/S = 1023/255/63, The number of sectors = 78165360, LBA
    Partition num :0 , Filesystem type unknown, partition type 0xbb
    Partition num :1 , Filesystem type is fat, partition type 0xc
    Partition num :4 , Filesystem type unknown, partition type 0x82
    Partition num :5 , Filesystem type is ext2fs, partition type 0x83

    grub > geometry (hd1)
    drive 0x81: C/H/S = 1023/255/63, The number of sectors = 78156288, LBA
    Partition num :0 , Filesystem type unknown, partition type 0x7
    Partition num :1 , Filesystem type is fat, partition type 0xc
    Partition num :2 , Filesystem type unknown, partition type 0x7



    Code:
    grub> find /boot/grub/device.map
      (hd0,5)
    
    grub> cat  ([B]hd0,5[/B])/boot/grub/device.map
    # this device map was generated by anaconda
    (fd0)       /dev/fd0
    (hd0)       /dev/hda-------zero and A
    (hd1)       /dev/hdb-------one and B
    



    I did repeat the command again
    Code:
    grub> cat  ([B]hd0,5[/B])/boot/grub/device.map
    # this device map was generated by anaconda
    (fd0)       /dev/fd0
    (hd0)       /dev/hda-------zero and A
    (hd1)       /dev/hdb-------one and B
    
     
  7. zillah

    zillah Thread Starter

    Joined:
    Jun 6, 2005
    Messages:
    330
    Some thing extra I did, which you have not asked me to do it. I restarted the PC again (second time not the first time) and I did these below again :
    grub > geometry (hd0)
    drive 0x80: C/H/S = 1023/255/63, The number of sectors = 78165360, LBA
    Partition num :0 , Filesystem type unknown, partition type 0xbb
    Partition num :1 , Filesystem type is fat, partition type 0xc
    Partition num :4 , Filesystem type unknown, partition type 0x82
    Partition num :5 , Filesystem type is ext2fs, partition type 0x83

    grub > geometry (hd1)
    drive 0x81: C/H/S = 1023/255/63, The number of sectors = 78156288, LBA
    Partition num :0 , Filesystem type unknown, partition type 0x7
    Partition num :1 , Filesystem type is fat, partition type 0xc
    Partition num :2 , Filesystem type unknown, partition type 0x7



    I proceed booting FC, and I am sending this reply form Linux box, and typed in (fdisk -l and geometry) and the results below :
    Code:
    [[email protected] grub]# [B]fdisk -l[/B]
    
    Disk /dev/hda: 40.0 GB, 40016019456 bytes
    255 heads, 63 sectors/track, 4865 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    
       Device Boot	  Start		 End	  Blocks   Id  System
    /dev/hda1   *		   1		1959	15735636	7  HPFS/NTFS
    /dev/hda2			1960		2612	 5245222+   c  W95 FAT32 (LBA)
    /dev/hda3			2613		4865	18097222+   7  HPFS/NTFS
    
    Disk /dev/hdb: 40.0 GB, 40020664320 bytes
    255 heads, 63 sectors/track, 4865 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    
       Device Boot	  Start		 End	  Blocks   Id  System
    /dev/hdb1   *		   1		2611	20972826   bb  Boot Wizard hidden
    /dev/hdb2			2612		3264	 5245222+   c  W95 FAT32 (LBA)
    /dev/hdb3			3265		4865	12860032+   5  Extended
    /dev/hdb5			3265		3328	  514048+  82  Linux swap / Solaris
    /dev/hdb6			3329		4865	12345921   83  Linux
    


    I tried geomety command while I am accessing linux OS (not like before)
    Code:
    grub> geometry (hd0)
    drive 0x80: C/H/S = 4865/255/63, The number of sectors = 78156288, /dev/hda
       Partition num: 0,  Filesystem type unknown, partition type 0x7
       Partition num: 1,  Filesystem type is fat, partition type 0xc
       Partition num: 2,  Filesystem type unknown, partition type 0x7
    
    grub> geometry (hd1)
    drive 0x81: C/H/S = 4865/255/63, The number of sectors = 78165360, /dev/hdb
       Partition num: 0,  Filesystem type unknown, partition type 0xbb
       Partition num: 1,  Filesystem type is fat, partition type 0xc
       Partition num: 4,  Filesystem type unknown, partition type 0x82
       Partition num: 5,  Filesystem type is ext2fs, partition type 0x83
    

    I leave the comment to you
     
  8. saikee

    saikee

    Joined:
    Jun 11, 2004
    Messages:
    3,887
    Two comments

    (1) Your device.map does not match the disk order. Device.map is the first record Grub assembled when it was installed.

    Post #16 first showed hd0=/dev/hda

    Post #40 you confirmed hd0 has been amended to correspond to /dev/hdb as previously suggested by Post #29

    Post #66 now shows hd0 has been reverted back to /dev/hda.

    Device.map is only created once and never changes untill you correct it yourself. Therefore you have either failed to implement the alteration in Post #40 after claiming having done it or have since change device.map yourself.

    (2) Grub never alters your disk order.
     
  9. saikee

    saikee

    Joined:
    Jun 11, 2004
    Messages:
    3,887
    It is now all clear

    Since you have device.map mis-matching your disk order this effectively forces Grub to change the disk order internally once the Linux has been booted.

    Before you booted the hd0 was /dev/hdb

    After you booted Grub had to follow the faulty device.map and assigned hd0 to /dev/hda.

    Can you now confirm

    Did you implement the changes in device.map in Post #40 or have you since changed it?
     
  10. zillah

    zillah Thread Starter

    Joined:
    Jun 6, 2005
    Messages:
    330
    Yes I did change to the device.map.
     
  11. saikee

    saikee

    Joined:
    Jun 11, 2004
    Messages:
    3,887
    Thus your confusion should disappear if you make the device.map compatible with the boot disk order and make sure the partition references are matched too in the Grub menu.lst.

    The problem would not have risen if the boot disk order was not changed in the first place.
     
  12. zillah

    zillah Thread Starter

    Joined:
    Jun 6, 2005
    Messages:
    330
    From Linux OS I have done these :


    1- I changed the value in /boot/grub/device.map to :
    Code:
    # this device map was generated by anaconda
    (fd0)     /dev/fd0
    (hd0)     /dev/hd[B]b[/B]
    (hd1)     /dev/hd[B]a[/B]
    


    2- Ckeck fdisk -l
    Code:
    Disk /dev/hda: 40.0 GB, 40016019456 bytes
    255 heads, 63 sectors/track, 4865 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/hda1   *           1        1959    15735636    7  HPFS/NTFS
    /dev/hda2            1960        2612     5245222+   c  W95 FAT32 (LBA)
    /dev/hda3            2613        4865    18097222+   7  HPFS/NTFS
    
    Disk /dev/hdb: 40.0 GB, 40020664320 bytes
    255 heads, 63 sectors/track, 4865 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/hdb1   *           1        2611    20972826   bb  Boot Wizard hidden
    /dev/hdb2            2612        3264     5245222+   c  W95 FAT32 (LBA)
    /dev/hdb3            3265        4865    12860032+   5  Extended
    /dev/hdb5            3265        3328      514048+  82  Linux swap / Solaris
    /dev/hdb6            3329        4865    12345921   83  Linux
    [[email protected] ~]#
    



    3- Ckeck geometry
    Code:
    grub> geometry (hd0)
    drive 0x80: C/H/S = 4865/255/63, The number of sectors = 78156288, /dev/hda
       Partition num: 0,  Filesystem type unknown, partition type 0x7
       Partition num: 1,  Filesystem type is fat, partition type 0xc
       Partition num: 2,  Filesystem type unknown, partition type 0x7
    
    grub> geometry (hd1)
    drive 0x81: C/H/S = 4865/255/63, The number of sectors = 78165360, /dev/hdb
       Partition num: 0,  Filesystem type unknown, partition type 0xbb
       Partition num: 1,  Filesystem type is fat, partition type 0xc
       Partition num: 4,  Filesystem type unknown, partition type 0x82
       Partition num: 5,  Filesystem type is ext2fs, partition type 0x83
    



    4- I checked the menu.lst
    Code:
    # grub.conf generated by anaconda
    #
    # Note that you do not have to rerun grub after making changes to this file
    # NOTICE:  You do not have a /boot partition.  This means that
    #          all kernel and initrd paths are relative to /, eg.
    #          root (hd1,5)
    #          kernel /boot/vmlinuz-version ro root=/dev/hdb6
    #          initrd /boot/initrd-version.img
    #boot=/dev/hda
    default=0
    timeout=5
    splashimage=([B]hd0,5[/B])/boot/grub/splash.xpm.gz
    hiddenmenu
    title Fedora Core (2.6.11-1.1369_FC4)
    	root ([B]hd0,5[/B])
    	kernel /boot/vmlinuz-2.6.11-1.1369_FC4 ro root=LABEL=/ rhgb quiet
    	initrd /boot/initrd-2.6.11-1.1369_FC4.img
    title WinXP and 2003
            rootnoverify ([B]hd1[/B],0)
            map (hd1)  (hd0)
            map (hd0)  (hd1)
            [B]makeactive[/B]
            chainloader +1
    




    Then I booted the system , and I did not get the menu options for grub , I ended up with native grub again (grub>)

    I checked the geometry again (this time from grub command not from linux OS) the result was:
    Code:
    grub> geometry (hd[COLOR="Red"][B]1[/B][/COLOR])
    drive 0x80: C/H/S = 4865/255/63, The number of sectors = 78156288, /dev/hda
       Partition num: 0,  Filesystem type unknown, partition type 0x7
       Partition num: 1,  Filesystem type is fat, partition type 0xc
       Partition num: 2,  Filesystem type unknown, partition type 0x7
    
    grub> geometry (hd[COLOR="red"][B]0[/B][/COLOR])
    drive 0x81: C/H/S = 4865/255/63, The number of sectors = 78165360, /dev/hdb
       Partition num: 0,  Filesystem type unknown, partition type 0xbb
       Partition num: 1,  Filesystem type is fat, partition type 0xc
       Partition num: 4,  Filesystem type unknown, partition type 0x82
       Partition num: 5,  Filesystem type is ext2fs, partition type 0x83
    
     
  13. saikee

    saikee

    Joined:
    Jun 11, 2004
    Messages:
    3,887
    So your boot disk order of hd0=/dev/hdb has not been altered between Post #67 and Post #72.

    Everything seems to be in order except you lose the menu part of the Grub, right?

    Can you boot Fc and XP up manually, using the information of /boot/grub/menu.lst (plus a "boot" statement in each case)?

    You may have to restore Grub again.
     
  14. zillah

    zillah Thread Starter

    Joined:
    Jun 6, 2005
    Messages:
    330
    Yes.


    Yes.



    How ?
     
  15. saikee

    saikee

    Joined:
    Jun 11, 2004
    Messages:
    3,887
    Before booting the Linux up
    Code:
    root (hd0,5)
    setup (hd0)
    or after thye Linux has been booted and in command shell
    Code:
    grub-install /dev/hdb
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/433726

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice