[Gllug] How does grub number discs in mixed systems?

Christopher Currie ccurrie at usa.net
Wed Feb 13 14:35:38 UTC 2008


On  Wed, 13 Feb 2008 12:06:26 +0000 wroteJohn Winters <john at sinodun.org.uk>
>
> Message-ID: <47B2DD42.2090602 at sinodun.org.uk>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> I'm struggling to predict what labels grub will use for a system which
> I'm looking at modifying.
>
> Currently the box has one PATA drive (hda) and one SATA drive (sda).
> Grub seems to reference these respectively as hd0 and hd1.
>
> I want to replace the PATA drive with another SATA drive, removing the
> PATA drive.
>
> Can I then reliably say that the original SATA drive (still sda) will
> become hd0 and the new SATA drive (on the second SATA controller) will
> become hd1?

No, IMHE; grub varies the order of disks depending at least on what the BIOS 
reports to it. 

This is probably teaching grandmothers to suck eggs, but:
If you have an independent grub boot disk (floppy or CD) you can boot it up 
and test the geometry with :   #There is no royal road to geometry

grub>geometry (hd<TAB> #this lists the hard drive Grub knows about
grub>geometry (hd0)<ENTER> #will tell you what partitions are on what it
                                                     #thinks is hd0
grub>geometry (hd1)<ENTER> # and so on

or just
 grub> root(<TAB>

You can the boot up with
grub>rootnoverify (hdx,n)<ENTER>  #where x is the bootable drive number and n
                                                        # the partition number      
grub>makeactive		#may be needed
grub>chainloader+1
grub>boot<ENTER>

Also, grub> map (hd0) (hd1)
     grub> map (hd1) (hd0)

 allows you to swap the drives round if it's being tiresome.

>
> I would welcome a reference to some definitive documentation on how grub
> decides the order in which to number the drives.  I've read several
> on-line tutorials but they all make the same mistake as the grub
> documentation - they assume you already know these basic details.

You've presumably looked at 
http://www.gnu.org/software/grub/manual/html_node/Naming-convention.html#Naming-convention

Some Grub documentation I found online told me, if I remember correctly, that 
Grub can recognize drives numbered sd1, sd2, etc. I always get an 'error when 
parsing number' when I've tried this. Perhaps not surprising that I've 
deleted it from my bookmarks.

Christopher
 > ------------------------------

Christopher


-- 
Christopher Currie	ccurrie at usa.net

-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list