Safely move bootloader to another disk

Ages ago I installed Linux on a “spare” 40GB disk and I don’t remember how, but that disk is where I still boot the computer from, in Bios it’s listed as a primary master and HD0.

Over the time my installs moved to the “main” disk where it is now Suse 11.3 alongside Windows.

I want to get rid of that original “spare” disk altogether, physically take it out, but don’t know how to move the bootloader to the “main” one.

I’m confused by all the options offered in Yast Boot Loader Location menu.

Can I just tell it to put itself into a custom boot partition and point it to dev/sdb, the current designation of the “main” disk?

Would I need to edit Grub as well? I figure the current “sdb” would be called “sda” after I take the old disk out. Would it be safe to simply rename /sdb entries, things like /sdb4 to /sda4 and so on?

Additional question - I used to play with Win7 demo, deleted that now, but its loader still pops up when I boot into Windows with their “earlier version of operating system” menu. Their offered solution is to run “mbrfix” from a WinXp recovery CD.

My question - what would that mbrfix do to the Linux bootloader and how can I get it to point back to to Grub afterwards?

If you remove your old disk you will need to re-do the bootloader and much editing

Why not just leave it in for now, like a rather large boot device :wink:
Then when you are ready to install 11.4, remove it and all will be easy.

It has got a bunch of unreadable sectors and from boot log I can see it throws up a lot of warnings. Earlier someone here recommended to throw it away immediately.

I suspect those errors could be responsible for the machine not logging me in automatically two times out of three, though it could be something else, I would need to boot the system without the faulty disk and see how it behaves then.

I guess I can remove it from fstab first and not mount it at all. Perhaps there’s a setting somewhere for SMART to ignore checking it for errors, too.

How far off is 11.4? December?

How different would be from running “recover” option from 11.3 DVD now, without the old disk?

The repair installed system has been removed from 11.3

How much room do you have on this disk you have suse on now. Could you make a small partition, say about 10GB max. Enough to install Mint or Ubuntu?

I’d say you could take out the disk, then boot from a Live CD. From there on, you could switch to the installed system, start Yast and reconfigure and reinstall the bootloader. Please first show is the output of


fdisk -l

I have to lookup the exact sequence of commands, but I know it can be done this way

Already found what’s needed, please download a LiveCD, boot from it, and post the output of the command above ( to be done in a terminal window)

You cool dude
I was leading him a long way around.

Needed this meself a couple of months ago, in this one How to repair system without DVD, post #15 from ken_yap. That opened new horizons for me, knowing to be able to do things on a non-booting system. Credits to ken_yap, the translation to what else one could use these four lines for was open to me.

As if on cue, the old drive has disappeared from BIOS.

I should probably open the case and check the connections, but at this point I can boot into Live CD and Bios can see my “primary slave” where my Suse is so fixing should be possible.

It’s getting late in this part of the world so I’ll leave it until tomorrow.

Not sure if fdisk -l would give the same output if my working disk is registered as a slave, as it is now, or as a master, after I take the old drive out and reconnect the wiring tomorrow.

Current output is coming up, from Live CD

linux:~ # fdisk -l

Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x3a7fa39b

Device Boot Start End Blocks Id System
/dev/sda1 * 1 4121 33093900 7 HPFS/NTFS
/dev/sda2 7298 12166 39110242 83 Linux
/dev/sda3 4121 7297 25519221 83 Linux
/dev/sda4 12167 14593 19494877+ 83 Linux

Partition table entries are not in disk order

Disk /dev/sdb: 750.1 GB, 750156374016 bytes
255 heads, 63 sectors/track, 91201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xa4b57300

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 91201 732572001 7 HPFS/NTFS
linux:~ #

The sdb here is an external drive plugged into USB.

Oh, and this live CD is Suse 11.1, with no ext4 support so I can’t even read fstab or grub from the installed system.

I’ve got 11.3 gnome and KDE at the office, I think. Otherwise it might take a while to download and burn them.

Hope you guys can give me some directions over the next few hours, I might try to fix this thing in the morning.

I can leave it in this LiveCD mode overnight, I think, for speed reasons - booting up and getting network up manually takes good ten minutes and the default ipv6 takes some five six page reloads to connect to anything with Firefox.

What we need to know now is on which partition the root of your openSUSE is. If you don’t know, we can find out by mounting the partitions and check what’s on them. The first one has an NTFS filesystem, which is Windows, we skip that one. Now to the first linux one


su
mount /dev/sda2 /mnt
ls /mnt

You should see:
bin boot dev etc home lib lib64 lost+found media mnt opt proc root sbin selinux srv sys tmp usr var
If not, we unmount the partition:


     umount /dev/sda2
     

and repeat the above for sda3, if without good result sda4.

As soon as you found the partition with your install on it, do:


mount --bind /dev /mnt/dev
chroot /mnt
mount /proc
mount /sys


Now you “switched” system to the one with it’s root mounted in /mnt, i.e. the already installed openSUSE !!!

Next thing is the bootloader, do:


yast2

I suggest you let it propose a new configuration. Let us know how you got on.

Silly me, completely forgot that I haven’t upgraded this system to 11.3.

Once I discovered that I just popped the 11.2 DVD in and did the “repair” that created a new bootloader and redone grub.

Then, once Suse was back, I just read Swerdna’s guide to booting along with Windows, cos’ that option totally disappeared from grub. Luckily it was very straightforward.

Discovered a couple of other problems with my install but that’s a fight for another day.

Pity there’s no “repair” in 11.3, makes me wonder if I should wait out for 11.4 and skip 3 altogether.

I wonder if I could have redone the bootloader/grub from LiveCD. It has these Yast modules but would they have worked on an existing system? Or is that what mounting root was for - letting Live CD to tinker with the existing installation? I thought it wasn’t supposed to touch that under any circumstances.

The Live-CD’s are linux, when used normally, they don’t touch the system. What the tric does in short, is use the Live-CD to boot the system. When chrooting it to the actual installed system, it will use that from there on, but still running on the same kernel. So you start the Yast that’s on the installed system. Once done that, you can create a new bootloader from Yast. Start the repo manager from Yast, and you will see the repos configured on the installed system.

Nice to let us know you got it up and running again. See you around.