LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 08-11-2005, 01:44 AM   #1
taiwf
Member
 
Registered: Jun 2005
Distribution: debian, ubuntu, redhat,knoppix
Posts: 194

Rep: Reputation: 31
move mbr to different hard disk


hi,

I have tried to install linux on my second hard disk (ie. drive D) but I abort the installation halfway and now my MRB is on my 2nd hard disk (where my first hardisk is window 2000).

Now I can't boot onto window unless 2nd hardisk is connected. I wonder is there anyway to bring MBR back to first hard disk so i can remove the 2nd hard disk?


Thank in advanced.
 
Old 08-11-2005, 02:20 AM   #2
BroX
Member
 
Registered: Oct 2003
Location: Sweden
Distribution: Slackware64-current, SlackwareARM-15.0
Posts: 833

Rep: Reputation: 90
I think /sbin/lilo -M /dev/<your-partition-here> will do the job. Check "man lilo" for more details. Here an excerpt of it:
Code:
        /sbin/lilo - install boot loader

       Auxiliary uses:
...
        /sbin/lilo -M - write a Master Boot Loader on a device
...

-M master-device [mbr|ext]
              Install  a  Master Boot Record on the device specified as master-device, selecting the Standard or 
              Extended Master Boot Loader per the option.  The  primary  partition  table  on  master-device  is
              undistrubed.   If no valid volume ID (serial number) is present, then generate one and write it to
              the MBR.  If mbr is specified, the Standard Master Boot Loader will search partitions 1-4  for  an
              active  flag,  and boot the flagged partition.  Only one active flag is allowed.  If ext is speci-
              fied, the search for an active partition will include extended partitions as well.   The  presence
              of  the  Extended  Master Boot Loader on the Master Boot Record (MBR = sector 0) of a disk affects
              the operation of the -A option.
Cheers, Leon.

Last edited by BroX; 08-11-2005 at 02:22 AM.
 
Old 08-11-2005, 02:25 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,119

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Above may work for lilo (don't use it, don't know), but it won't help with grub.
Regardless, the Win2000 MBR can be restored by booting the install CD, and selecting recovery console, then run
Code:
fixmbr
 
Old 08-11-2005, 06:24 PM   #4
taiwf
Member
 
Registered: Jun 2005
Distribution: debian, ubuntu, redhat,knoppix
Posts: 194

Original Poster
Rep: Reputation: 31
hmm, i type fixmbr and it come out a warning message that i might lose my partition data. I just wondering if that will delete my current partition or simple create(or transfer??) MBR to my first hard disk where win2k reside.
 
Old 08-11-2005, 09:58 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,119

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
I previously posted the solution, seems maybe some background might also be in order.

The MBR is always on the disk the BIOS treats as the primary boot disk - to you and me that generally means the "first" disk. That's what the "M" stands for. Every other disk has an equivalent location, but it ain't (truly) the MBR unless you booted that disk.
So in your case, the MBR is still on the primary boot disk, and contains Linux boot code. This (in your case) uses the second disk for what are known as stage files - these do most of the work as the MBR occupies less than one sector, and can't do a lot more than basically relocate itself and load the first of the stage files into memory.
What you are attempting to do with the fixmbr command is simply over-write the MBR loader code with the Microsoft version. Simple as that - it will obliterate any reference to previous code; i.e. your Linux partitions will become unknown.

As to why you get the message, I have no idea. The fixmbr should only replace the loader code portion of the MBR, and not touch the partition table - which also happens to reside in the sector known as the MBR.
I would interpret this as Microsoft simply covering all possible situations with a generic warning message - in this country we call that "covering your *rse".
I don't recall anyone else reporting that message, and frankly I'd ignore it on my own machine, but I know I can recover anything I have in the unlikely event fixmbr did indeed screw the partition table.
You will have to make that call for yourself I'm afraid.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cloning 1 hard disk to smaller hard disk, dd or ghost? fireman949 Linux - Hardware 8 12-23-2012 12:51 AM
how do i recover my Hard Disk and MBR? Pisces107 Linux - General 5 12-25-2003 11:12 PM
Lilo and MBR of the second hard disk petarsabev Slackware 9 09-30-2003 11:35 PM
Hard Disk question - Making a big hard disk MrAnonym Linux - General 2 09-15-2003 06:08 PM
Move hard disk with OS te_conway Linux - General 1 03-12-2002 09:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 11:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration