[TriLUG] [eee] post-install, grub OK from external stick but not from internal SSD

Joseph Mack NA3T jmack at wm7d.net
Wed Apr 23 17:30:19 EDT 2008


On Wed, 23 Apr 2008, Tom Roche wrote:

>
> summary: I seem to understand why to use grub instead of the BIOS'
> boot selector. But how to grub-install on the eee's internal SSD?

the simplest is to boot up to some kernel (doesn't matter if 
it's the stick or the disk) and say

`grub-install /dev/[hs]da`

swiping from lower down your posting.

> > o /dev/sda doesn't have a valid boot sector.
>
> > when you boot to /dev/sda (any way you like), re-run grub-install
> > telling it to install on the hard disk.
>
> How to do that? /dev/sda* are there, but I get
>
> $ sudo grub-install /dev/sda
> grep: /boot/grub/partition.map: no such file or directory

you must have a market enhanced grub-install. Mine doesn't 
have partition.map and partition.map is not mentioned in the 
man page. I do have a device.map file. If you have a 
device.map file, look in there for BIOS names for drives.

> /dev/sda does not have any corresponding BIOS drive.

The BIOS doesn't know about /dev/sda - this is the name the 
kernel calls it. This is because the kernel is using the 
scsi driver to talk to the SATA drives. When grub runs, 
there is no kernel and the drive will be known by its BIOS 
name which could be (hd0), (hd1), /dev/hda, /dev/hdc. All 
drives; IDE, SATA, scsi, have to look like the ST506 at boot 
time. So you can have a disk on a Promise hard disk 
controller, for which the kernel needs a driver, and the 
kernel will boot/load, because the controller must present a 
ST506 to the BIOS, and so the BIOS loads the kernel. The 
kernel will start checking out devices and when it gets to 
the harddisk controller, unless it has the driver built in, 
will not be able to read any more files, but the kernel did 
boot. So stay with BIOS drive names untill the kernel is 
executing. Be prepared to try a few combinations eg 
/dev/hd0, /dev/hd1, hd0 etc if the suggestions above don't 
work.

> $ sudo grub-install /dev/sda1

The BIOS doesn't look there when the machine boots.

> > Presumably somewhere in there you have a choice of places to boot.
>
> Correct: the current BIOS Boot Device Priority (which I haven't
> changed) is [CD, SSD, USB], but the point of the Boot Selector Popup
> is allow choice @ runtime.

do you mean when the kernel is running you can popup the 
BIOS boot menu? I've never heard of that. Presumably this is 
for the next boot?

> 0 If I boot *without* the stick inserted, I get the Error 21

BIOS doesn't know any device by the name you've used 
(presumably a device in your menu.lst file)

> 1 If I boot *with* the stick inserted, but don't choose to boot from
>   the stick using the Boot Selector Popup,

presumably then the BIOS goes down its list of devices to 
boot from till it finds one that's bootable and it finds the 
stick

> I still get the menu.lst
> from the stick (plus the stick's LED strobes madly).

and tries to boot from the stick anyhow

> Then
>
> * if I choose to boot from the stick, I get Error 15,

file not found

the file (the kernel) you've chosen to boot from doesn't 
exist. You've probably got the wrong drive descriptor in 
there. Iterate through (hd0,0)....(hdn,z).

>   because menu.lst
>   has root=(hd0,0).

no, you can have nonsense for the root and the kernel will 
boot fine. It's only when the kernel tries to mount root 
that the kernel will panic. This happens a fair way into 
the boot so it's easy to differentiate booting the kernel 
and not being about to mount root.

> If I use the grub editor to set root=(hd1,0), I
>   can then boot from the stick.

this does not jive with the previous paragraph.

> * if I choose to "Normal Boot" from the SSD, I get Error 15, because
>   menu.lst has root=(hd1,0). If I use the grub editor to set
>   root=(hd0,0), I can then boot from the stick.

neither does this.

> > Presumably you could also have boot to usb flash drive only, and on
> > the flash drive's menu.lst, have an option to boot to the hard disk.
> > Ideally you'd like not to have to deal with the BIOS menu choosing
> > your boot device - it would be better to have grub menu.
>
> Hmm ... because of the changing hd[n] above? <doh!> So it looks like
> what I want to do is setup SSD:/boot/grub/menu.lst with options to
>
> * boot from SSD, with root=(hd0,0)
>
> * boot from first removable drive (note that the eee has only SSD and
>   USB, no optical), with root=(hd1,0)

don't follow this, presumably because I don't understand 
what's happening as you change root above.

> * don't use the Boot Selector Popup!

well eventually you should be able to use the BIOS boot 
selector. What effect it's having now, I don't know, but all 
bets are off as to what it's doing, while you haven't got it 
booting.

Previously you had it booting from the hard disk; now you 
have it booting from the stick. All that's needed is to 
figure out how to choose between the two :-)

Joe
-- 
Joseph Mack NA3T EME(B,D), FM05lw North Carolina
jmack (at) wm7d (dot) net - azimuthal equidistant map
generator at http://www.wm7d.net/azproj.shtml
Homepage http://www.austintek.com/ It's GNU/Linux!



More information about the TriLUG mailing list