Mailinglist Archive: opensuse (1159 mails)

< Previous Next >
Re: [opensuse] Moving grub/boot to second disk.
On 2012/01/02 21:48 (GMT+1000) John Bennett composed:

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...

Presumably you are only dealing with Grub Legacy (and openSUSE and distros that do not use Grub2). The following certainly does, as my experience with Grub2 is virtually nil.

The way I deal with such a case is to boot a Knoppix disk with the HDs attached in their intended normal order and with the BIOS assignments in natural order. Any live media possessing Grub should suffice, but Knoppix is the grand master of live media.

I only use the Grub shell, never Grub scripts, which makes SUSE's grub.conf irrelevant for the immediate task. Before zypper and YaST are allowed to do updates each grub.conf does need to be conformed to the ultimate installed reality.

Each device.map needs to conform to the BIOS, and should use device IDs instead of legacy device names.

http://www.gnu.org/software/grub/manual/legacy/grub.html#Installing-GRUB-natively explains how to get Grub properly installed to the appropriate boot records. It's the only method I ever use whether booted directly to openSUSE or to Knoppix.

Each menu.lst stanza needs to be conformed to the applicable device.map. You may find it helpful during your repair attempts to add extra stanzas to each menu.lst so that any possible BIOS order has a matching stanza. IOW, each openSUSE / or /boot partition would have both a (0,X) and a (1,X) stanza to try. It's also helpful to do the same type of replication for chainloader and configfile entries. Once repair is complete you may or may not want to remove the duplication, depending on what you expect to be able to do if one disk dies or is otherwise removed.

If you use device labels in device.map, menu.lst and/or fstab, duplication need to be removed immediately after the initial clone process (copying) is finished. Before doing anything dependent on labels or UUIDs on the clone be sure to reboot.

Any fstab instance using a device name instead of a LABEL, device ID or UUID will need to be conformed to installed reality.

All cloned partitions need new UUIDs assigned by whichever tool is appropriate to the filesystem type; e.g. tune2fs -U for EXT3.

As to extended partition name it can be helpful at some point to ensure that the names match logical order on disk. If all logical partitions come after all primary partitions, the MBR table entries should be sorted if necessary so that the extended is sdX4, not sdX3. It should only be 3 in the case where there actually is one primary that logically follows all logicals on the disk, while 2 primaries precede it/them. If there were 2 primaries following, then the extended should be sdX2.

Windows will not like having the clone in the system at the same time as the original. Windows puts a code the MBR sector just ahead of the partition table. You will need to ensure that the new disk does not carry the exact same code in this location before attempting to use Windows. This I would do myself using the sector editor built into DFSee, which is the application I always use for partitioning and cloning, regardless what OS I boot to perform such partitioning or cloning operations.

Note that I never install Grub on any MBR.

See also http://fm.no-ip.com/PC/partitioningindex.html
--
"The wise are known for their understanding, and pleasant
words are persuasive." Proverbs 16:21 (New Living Translation)

Team OS/2 ** Reg. Linux User #211409 ** a11y rocks!

Felix Miata *** http://fm.no-ip.com/
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >
References