Re: Suse, bootable USB stick and Grub
- From: rsink <nospam@xxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 15 Mar 2009 17:17:53 -0400
I'm tinkering with this too because my laptop has no floppy.
On my Asus/amd64 desktop setting the boot priority to
removable media includes the floppy. The funny thing is that
the usb doesn't boot unless I unplug the hard drive before a
new boot. After that the usb stick boots even with the drive
later plugged in. Weird.
The stick can be formatted dos or anything else. Format it
to an fs that you won't confuse with another, this will
prove valuable (initially).
I partition & format my 16 gb stick like so
Boot Start End Blocks Id System
ext2 /dev/sdb1 1 1 8001 83 Linux
/dev/sdb4 2 1966 15783862+ 5 Extended
ext2 /dev/sdb5 2 3 16033+ 83 Linux
reis /dev/sdb6 4 1966 15767766 83 Linux
Make a /boot folder in partition-1 with at least
/boot/grub/stage1
(/boot/grub/stage-1.5)
/boot/grub/stage2
/boot/grub/menu.lst
pasted out from the system /boot folder (without the
device.map) and edit the menu as per your machine.
Here's my test menu, title-1 works and it's read off the
usb, the other title reports invalid or corrupt partition
table (presumably on the usb?). It works because the hard
drive is seen as (hd1) at boot time if the usb is also
plugged in. The thing to be aware of is how grub (bios) sees
the usb and/or the drive
a - when executing the 'install' command with paths
b - at boot time when paths are read from the menu
------------------------------------------------------
color white/blue yellow/black
default 0
timeout 1200
#
# this one works
title root (hd1,9) kern (hd1,9)/boot init (hd1,9)/boot sda10
root (hd1,9)
kernel (hd1,9)/boot/vmlinuz root=/dev/sda10 splash=0 3
initrd (hd1,9)/boot/initrd
#
#
# this one bombs (trying to load at least kernel from stick)
title root (hd1,9) kern (hd0,0)/ init (hd1,9)/boot sda10
root (hd1,9)
kernel (hd0,4)/vmlinuz root=/dev/sda10 splash=0 3
initrd (hd1,9)/boot/initrd
---------------------------------------------------------
Find out how the OS sees the usb stick at the time. One way
to do that is to run fdisk -l. Next open the file
/boot/grub/device-map (of the OS) and you'll see something like
(fd0) /dev/fd0
(hd0) /dev/sda
(hd1) /dev/sdb
Here's the curve! The OS tag on the usb can change every
minute but not the bios tag (hd1) so if you now do
root (hd1,0)
it will show the 1st partition on the usb AND the filesystem
on it. If you see the fs you formatted to and it's the only
partition-1 with that fs you will have positive ID.
Here's the grub 'install' starting all over (single
complete lines):
grub> root (hd1,0)
grub> install (hd1,0)/boot/grub/stage1 (hd1)
(hd1,0)/boot/grub/stage2 p (hd1,0)/boot/grub/menu.lst
or, since root is defined,
grub> install /boot/grub/stage1 (hd1) /boot/grub/stage2 p
/boot/grub/menu.lst
Done.
Next, for grubgurus... here's my take on the grub 'install'
process, if anyone shoots holes in it I'll be very happy.
install (hd0,0)/boot/grub/stage1 d (hd0)
(hd0,0)/boot/grub/stage2 p (or) config_file
(hd0,0)/boot/grub/menu.lst
Here, this install command is told where to source bios-path
data items at the time this command executes which is not
the time of booting. If all the argument data is found then
it is processed according to optional argument switches.
Then...
1. the target stage1 version of the source stage1 is
written to the boot code area (first 446 bytes) of the root
sector of 512 bytes of the device that will ultimately boot
if the computer can boot from it at boot-time.
2. Only stage1 (as modified) is written out as boot-code
to the root sector of the booting device. Grub may decide to
transparently write stage-1.5 boot code to root track
sectors following the root sector that begins it. The entire
root track is reserved for disk system use and is not
formattable as part of a filesystem.
3. The stage2 and menu or configuration files are read-in
during boot as normal files would be from the source paths
that are/were given when this command is/was executed. When
grub reports "Loading stage2" during boot-time it is reading
the sourced stage2, and when the menu appears it is the
sourced menu. These files must remain in their original
source path and their bios path must be what grub sees at
boot time.
.
- References:
- Suse, bootable USB stick and Grub
- From: Roger
- Re: Suse, bootable USB stick and Grub
- From: VWWall
- Re: Suse, bootable USB stick and Grub
- From: Roger
- Re: Suse, bootable USB stick and Grub
- From: VWWall
- Re: Suse, bootable USB stick and Grub
- From: Roger
- Re: Suse, bootable USB stick and Grub
- From: VWWall
- Re: Suse, bootable USB stick and Grub
- From: Roger
- Re: Suse, bootable USB stick and Grub
- From: Roger
- Re: Suse, bootable USB stick and Grub
- From: marrgol
- Re: Suse, bootable USB stick and Grub
- From: Roger
- Suse, bootable USB stick and Grub
- Prev by Date: Re: SuSE Run on a USB Harddrive
- Next by Date: Re: Where does yast store list of installed packages (oss-111)?
- Previous by thread: Re: Suse, bootable USB stick and Grub
- Next by thread: Outpur from bash to php
- Index(es):
Relevant Pages
|
Loading