Mailinglist Archive: opensuse (1159 mails)

< Previous Next >
Re: [opensuse] Moving grub/boot to second disk.
2012. január 2. 12:48 napon John Bennett <hornetster@xxxxxxxxx> írta:

Trying to move a 12.1 x64 install from one drive (1.5tb SATA existing)
to the other (2tb SATA new). Have copied the partitions to the new drive
(using GParted, suse partition now sdb4 instead of sdb3 - created
extended partition which was named sdb3... sdb1+2 are windows
partitions) Going to leave both disks in the PC.
Questions:
If I change the boot disk order in the BIOS, does this change the
reference to the disks? ie does the new disk change from (1) to (0) in
the device.map file?
What files do I need to edit in grub (menu.lst, grub.conf, device.map)
How do I install grub in the mbr/partition boot record?
Have tried googling this, but can't find an answer for my particular prob...
Thanks, John.

Hello:

Felix gave you a detailed description.
I only want to add that you might have to recreate the initrd image, as device
names
are occasionally "hard-coded" in the initrd (at least it happened earlier, not
sure
about 12.1).

Have a look at this thread:

http://lists.opensuse.org/opensuse/2010-01/msg00577.html

Another thing I do is that I install on the MBR chain-loaders only.
This can be either lilo or grub and links the real bootloader of the system
which resides on the root partition's boot sector.

I you use grub both for the chainloader and the OS system loader you need
two grub configurations. Eg:

/boot/grub/ dir with all grub files (menu.lst etc) for system boot
/boot/grub-chainloader dir with all grub files for the chainloader.

menu.lst in /boot/chainloader looks like:

# Modified by YaST2. Last modification on Wed Jan 12 22:24:13 CET 2011
# THIS FILE WILL BE PARTIALLY OVERWRITTEN by perl-Bootloader
# Configure custom boot parameters for updated kernels in
/etc/sysconfig/bootloader

timeout 8
gfxmenu (hd0,0)/boot/message
##YaST - activate
default 0

title openSUSE 11.2
rootnoverify (hd0,0)
chainloader (hd0,0)+1

title openSUSE 11.4
rootnoverify (hd1,0)
chainloader (hd1,0)+1

title openSUSE 12.1
rootnoverify (hd1,1)
chainloader (hd1,1)+1

You can install grub and grub chainloader from a running system by the
grub shell (running as root):

# grub
root (hd0,0) # sets root to first disk, first partiton; adjust according to
your system
setup --force-lba (hd0,0) (hd0,0) # installs grub boot loader to first disk,
first partition, uses grub files (menu.lst, stages) in /boot/grub dir on
first disk, first partition
quit

The above defaults to /boot/grub dir.

For the chainloader grub-dir you have to use the --prefix option in grub:
setup --force-lba --prefix=/boot/grub-chainloader (hd0) (hd0,0)

This means that grub shell will install grub in according to the files in
/boot/grub-chainloader/, and not /boot/grub/

Of course you have to change "(hdx,x)" according to the system.
(hd0) is the MBR of the first hard disk.

Istvan

--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >
Follow Ups
References