openSUSE Forums > Archives > SLS Archives > ARCHIVES - SuSE Linux > ARCHIVES - Install / Boot » Moving Grub Mbr Record To Another Hdd

Go Back   openSUSE Forums > Archives > SLS Archives > ARCHIVES - SuSE Linux > ARCHIVES - Install / Boot
Forums FAQ Members List Search Today's Posts Mark Forums Read


ARCHIVES - Install / Boot Troubles installing SuSE Linux? Get weird messages during boot? Post in here...

 
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 21-Apr-2008, 12:50
snitko
Guest
 
Posts: n/a
Default

Ok, here's the thing. I have to HDDs:
  • sda, the one where windows is installed, which is also with the GRUB mbr record and boots first.
  • sdb, the one with linux
So, the funny thing is that if I remove sda with windows I won't be able to boot linux - if I try to boot sdb first it says 'no boot sectors'.

The task is to create GRUB mbr on sdb, preferrably with the same menu.lst, where I can choose linux or windows. I couldn't find how to do this in Yast gui, so either there's no such option in it or it's just absolutely unobvious which checkbox means what.

Will be really grateful for any suggestions, direct instructions or links )
  #2 (permalink)  
Old 21-Apr-2008, 14:59
harrylanza
Guest
 
Posts: n/a
Default

Look here it may help Move MBR

Hope this helps

Harry
  #3 (permalink)  
Old 21-Apr-2008, 15:35
snitko
Guest
 
Posts: n/a
Default

I read the link
I cannot believe a man has to buy a new drive and make a fresh installation. There must be a typical solution to these problems. In windows, say, we have an msdos utility to restore windows mbr records. The same has to be here.
  #4 (permalink)  
Old 21-Apr-2008, 16:08
TioDuke
Guest
 
Posts: n/a
Default

No. You don't need to buy a new HDD. But it is a risky operation, so try to make backups before trying.

Take a look at this thread: Backing Up Windows' Mbr


First make a backup of sdb's MBR, just in case:
dd if=/dev/sdb of=/path/to/backup-of-sdb-mbr count=1 bs=512

You need to copy sda's MBR to a file using dd:
dd if=/dev/sda of=/path/to/backup-of-sda-mbr count=1 bs=512

Then you take that file and you copy it over sdb's MBR (but only the first 446 bytes: to keep sdb's partition table intact):
dd of=/dev/sdb if=/path/to/backup-of-sda-mbr bs=446 count=1


Be careful and also keep a copy of your original sdb's MBR and a LiveCD handy, just in case.


Before even beginning, double check the fore mention method with someone else. Preferably someone with a good knowledge of linux. Ask here if in doubt. I don't want to be responsible for any damage you may cause to your computer.
  #5 (permalink)  
Old 21-Apr-2008, 16:54
snitko
Guest
 
Posts: n/a
Default

Quote:
Before even beginning, double check the fore mention method with someone else. Preferably someone with a good knowledge of linux. Ask here if in doubt. I don't want to be responsible for any damage you may cause to your computer.
[/b]
Ok, thanks. I'll check, and ask again, if there's more questions.
  #6 (permalink)  
Old 21-Apr-2008, 19:03
Eds
Guest
 
Posts: n/a
Default

Quote:
Ok, thanks. I'll check, and ask again, if there's more questions.
[/b]
First of all, the notion that fixmbr would work if you removed the drive with the windows boot sector is nonsense - you'd have exactly the same problem requiring you to create another boot record on the remaining drive then making the windows partition active and fixing boot.ini to reflect the new drive configuration.

Anyway, the problem you have is that sda, sdb, sdc etc are the drives in the order that they have priority on the system, so if you have 3 drives, sda, sdb and sdc and you remove the first drive, sdb becomes sda, sdc becomes sdb and sdc no longer exists - straight forward enough.

Yast has a utility to create a boot record to any valid drive or partition (assuming it isn't broken at this point in time? - I know the install disk's repair utility had a problem a while back), so while the system is working with the original drive configuration, write a new boot sector to the second drive.

Then you'll need to edit menu.lst and /etc/fstab and change all sdb's to sda's before removing the first drive, otherwise the mounts just won't work (same as you'd need to do with windows boot.ini)

I gave up on suse's sdx.x method of mounting partitions long ago and use partition labels for fstab instead - doesn't matter where the drives are, since you mount a partition by, for example, LABEL=suse_system rather than /dev/sdb1. So long as you have a valid swap partition on each drive and make sure you use unique labels for each partition you can swap drives around til the cows come home without running into these issues.

[EDIT] typos
  #7 (permalink)  
Old 22-Apr-2008, 14:58
snitko
Guest
 
Posts: n/a
Default

Quote:
Yast has a utility to create a boot record to any valid drive or partition (assuming it isn't broken at this point in time? - I know the install disk's repair utility had a problem a while back), so while the system is working with the original drive configuration, write a new boot sector to the second drive.
[/b]
Well, that was my first thought of Yast, but I couldn't find this utility. Where exactly should I be looking?
  #8 (permalink)  
Old 22-Apr-2008, 15:08
snitko
Guest
 
Posts: n/a
Default

Here's what I have in Yast 'Boot Loader':


There's only a checkbox that says 'boot from MBR' telling nothing about which one of two HDDs this mbr is. Other options don't seem relevant to me.
  #9 (permalink)  
Old 22-Apr-2008, 19:48
Eds
Guest
 
Posts: n/a
Default

According to the manual - which I just read - usually a good place to start.

Quote:
13.3.2 Boot Loader Location

To change the location of the boot loader, follow these steps:
Changing the Boot Loader Location

1.

Select the Boot Loader Installation tab then select one of the following options for Boot Loader Location:

Boot from Boot Partition

The boot sector of the /boot partition.
Boot from Extended Partition

This installs the boot loader in the extended partition container.
Boot from Master Boot Record

This installs the boot loader in the MBR of the first disk (according to the boot sequence preset in the BIOS).
Boot from Root Partition

This installs the boot loader in the boot sector of the / partition.
Custom Boot Partition

Use this option to specify the location of the boot loader manually.

2.

Click Finish to apply your changes.

[/b]
 

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




 

Search Engine Friendly URLs by vBSEO 3.3.0 RC2