The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



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 !!

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

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 02-01-2006
shorty shorty is offline
Registered User
  
 

Join Date: Jan 2006
Posts: 51
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?
  #2 (permalink)  
Old 02-01-2006
mahendramahendr mahendramahendr is offline Forum Advisor  
Registered User
  
 

Join Date: Dec 2005
Location: London
Posts: 222
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
  #3 (permalink)  
Old 02-01-2006
shorty shorty is offline
Registered User
  
 

Join Date: Jan 2006
Posts: 51
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 (permalink)  
Old 02-01-2006
infierno's Avatar
infierno infierno is offline
Registered User
  
 

Join Date: Jul 2005
Location: Asuncion, Paraguay
Posts: 79
tried to do on what OS?
  #5 (permalink)  
Old 02-01-2006
shorty shorty is offline
Registered User
  
 

Join Date: Jan 2006
Posts: 51
solaris 5.8
  #6 (permalink)  
Old 02-02-2006
blowtorch's Avatar
blowtorch blowtorch is offline Forum Advisor  
Supporter
  
 

Join Date: Dec 2004
Location: Singapore
Posts: 2,350
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).
  #7 (permalink)  
Old 01-06-2009
drak drak is offline
Registered User
  
 

Join Date: Jan 2009
Posts: 1
Exclamation 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
Closed Thread

Bookmarks

Tags
linux

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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




All times are GMT -4. The time now is 05:43 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0