How to copy MBR from old harddrive to new harddrive? | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Go Back    


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

How to copy MBR from old harddrive to new harddrive?

UNIX for Dummies Questions & Answers


Tags
linux

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 02-01-2006
shorty shorty is offline
Registered User
 
Join Date: Jan 2006
Last Activity: 29 August 2012, 1:27 PM EDT
Posts: 59
Thanks: 1
Thanked 0 Times in 0 Posts
How to copy MBR from old harddrive to new harddrive?

How do I copy the master boot record from one harddrive to another or how to install just the MBR?
Sponsored Links
    #2  
Old 02-01-2006
mahendramahendr mahendramahendr is offline Forum Advisor  
Registered User
 
Join Date: Dec 2005
Last Activity: 22 August 2008, 8:28 AM EDT
Location: London
Posts: 222
Thanks: 0
Thanked 0 Times in 0 Posts
if it is for unix or linux :

Copy just the MBR and boot sector of a hard dirve to another hard drive image:

dd if=/dev/hda of=/dev/hdb bs=512 count=2

Copy MBR only of a hard drive:

dd if=/dev/hda of=/dev/hdb bs=446 count=1

otherwise you can create a file of MBR image and later you can copy back to the hard drive.

Check the hard drive names in your machine....

If it is for windows, you have lot of tool available here :

http://www.geocities.com/thestarman3...tToolsRefs.htm
Sponsored Links
    #3  
Old 02-01-2006
shorty shorty is offline
Registered User
 
Join Date: Jan 2006
Last Activity: 29 August 2012, 1:27 PM EDT
Posts: 59
Thanks: 1
Thanked 0 Times in 0 Posts
I tried dd if=/dev/hda of=/dev/hdb bs=512 count=2 and I it said it couldn't find /dev/hda. I looked in the /dev directory and there is no hda (or sda)?!?
    #4  
Old 02-01-2006
infierno's Avatar
infierno infierno is offline
Registered User
 
Join Date: Jul 2005
Last Activity: 19 April 2008, 5:41 PM EDT
Location: Asuncion, Paraguay
Posts: 79
Thanks: 0
Thanked 0 Times in 0 Posts
tried to do on what OS?
Sponsored Links
    #5  
Old 02-01-2006
shorty shorty is offline
Registered User
 
Join Date: Jan 2006
Last Activity: 29 August 2012, 1:27 PM EDT
Posts: 59
Thanks: 1
Thanked 0 Times in 0 Posts
solaris 5.8
Sponsored Links
    #6  
Old 02-02-2006
blowtorch's Avatar
blowtorch blowtorch is offline Forum Advisor  
AFK
 
Join Date: Dec 2004
Last Activity: 28 July 2014, 9:39 AM EDT
Location: UK
Posts: 2,351
Thanks: 0
Thanked 6 Times in 6 Posts
I don't know how to copy a boot block, but you can install a new boot block if you have the Solaris CD. Check the man page of installboot(1m).
Sponsored Links
    #7  
Old 01-06-2009
drak drak is offline
Registered User
 
Join Date: Jan 2009
Last Activity: 6 January 2009, 10:43 PM EST
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Error Stop

I read this and nearly had a heart attack... the instructions given above a PLAIN WRONG and will destroy your partitions and data.

To backup the MBR you

dd if=/dev/sda of=mbrbackup bs=512 count=1

to restore the MBR you want to

dd if=mbrbackup of=/dev/sdb bs=446 count=1

If you copy more than 446 you will wipe over the partition tables, which is OK if you are copying to the same disk with the same unchanged partitions.

Whoever you are who wrote what you did, you should be ashamed of yourself for leaving such inaccurate and dangerous information out there.

To everyone else, please double check your DD commands before you use them because you can do irreparable damage. If in double google a few different sources to double and triple check.

Drak
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Detecting Harddrive Errors sunsysadm2003 Solaris 1 07-10-2008 11:39 AM
installing second harddrive crzywut Solaris 2 04-13-2008 10:06 AM
booting from which harddrive onthetopo UNIX for Dummies Questions & Answers 2 06-25-2007 06:55 PM
Copying a file to my harddrive zoolz UNIX for Dummies Questions & Answers 1 01-09-2006 08:17 AM
Supplemental harddrive. matvrix Filesystems, Disks and Memory 1 03-06-2005 04:04 PM



All times are GMT -4. The time now is 09:46 AM.