[opensuse] Moving grub/boot to second disk.
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. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
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-nat... 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@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Monday, January 02, 2012 06:48 AM John Bennett wrote:
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.
John, I can provide an alternative approach to Felix's reply, but whatever method you use you need to tell us what you are doing with the first drive, i.e., is your Windows "C:" partition on that drive and are you setting the machine up to primarily boot Windows and you want to boot openSUSE from there? Or do you want to have openSUSE's grub be the primary boot loader and use it to boot Windows on the first drive? Or are you using a bios on-the-fly boot device selection feature and want to boot off both drives? Or . . . ? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Tue, Jan 3, 2012 at 3:33 AM, Dennis Gallien
On Monday, January 02, 2012 06:48 AM John Bennett wrote:
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.
John, I can provide an alternative approach to Felix's reply, but whatever method you use you need to tell us what you are doing with the first drive, i.e., is your Windows "C:" partition on that drive and are you setting the machine up to primarily boot Windows and you want to boot openSUSE from there? Or do you want to have openSUSE's grub be the primary boot loader and use it to boot Windows on the first drive? Or are you using a bios on-the-fly boot device selection feature and want to boot off both drives? Or . . . ? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Thanks, Dennis. What I am doing is 'moving' all OS (ie boot stuff) to the new drive, with the intention that once it is all working I will clean the OS stuff off the 'old' drive, and this will become mainly data. My primary OS is opensuse, and only very rarely boot windows/ubuntu. First 2 partitions are Windows7 (boot and OS), 3rd partition is Opensuse 12.1 x64, and somewhere behind that (in an extended partition) is Ubuntu and/or anything else. All booted by the 12.1 default grub.... Thanks, John. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
2012. január 2. 12:48 napon John Bennett
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@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 03/01/12 04:54, Istvan Gabor wrote:
2012. január 2. 12:48 napon John Bennett
í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)
Thanks for the replies. Basically ended up copying the OS's to the new drive, change the SATA connectors, disconnect the old disk, boot from the install disk and reinstall grub on the new disk (similar to this, I think):
grub grub> root (hd0,1) grub> setup (hd0) grub> quit Reboot, then shutdown, reconnect the other drive, fix up fstab and all OK... Thanks, John. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (4)
-
Dennis Gallien
-
Felix Miata
-
Istvan Gabor
-
John Bennett