How to copy MBR from old harddrive to new harddrive?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to copy MBR from old harddrive to new harddrive?
# 1  
Old 02-01-2006
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  
Old 02-01-2006
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  
Old 02-01-2006
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
tried to do on what OS?
# 5  
Old 02-01-2006
solaris 5.8
# 6  
Old 02-02-2006
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  
Old 01-06-2009
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
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Copying the content of a filesystem to different Harddrive

my server runs solaris 10 , one of the partition in my primary harddrive is 99% full , i want to move the contents of it to the second harddrive which has higher capacity. what is the best way to move the contents to 2nd drive ? which command should i use cpio/dd/tar/ufsdump .... please guide me... (1 Reply)
Discussion started by: skamal4u
1 Replies

2. UNIX for Dummies Questions & Answers

Copying the content of a filesystem to different Harddrive

my server runs solaris 10 , one of the partition in my primary harddrive is 99% full , i want to move the contents of it to the second harddrive . what is the best way to move the contents to 2nd drive ? which command should i use cpio/dd/tar/ufsdump .... please guide me with the command and the... (0 Replies)
Discussion started by: skamal4u
0 Replies

3. Solaris

Removable External SCSI Harddrive

Hi guys, I have a solaris 9 operating system on a sun solaris machine and one external removable scsi drive connected to it. When i type the following command this is what is displayed: #format AVAILABLE DISK SELECTIONS: 0. c0t0d0 <DEFAULT cyl 17832 alt 2 hd 255 sec 63>... (6 Replies)
Discussion started by: tlee
6 Replies

4. Solaris

Detecting Harddrive Errors

I am looking for some tips or suggestions in how to do the following. 1) From a Solaris server, I run the command iostat -En and receive output that is similiar to the following which shows your disks along with the cdrom/dvdrom: c0t2d0 Soft Errors: 0 Hard Errors: 0 Transport... (1 Reply)
Discussion started by: sunsysadm2003
1 Replies

5. Solaris

installing second harddrive

This is my first post i am a solaris newbie. I just purchased my first sun system. It is a sunblade 1000. It had a fcal 36gb hdd in it already so i purchased a secondary 36gb fcal harddrive to increase my harddrive space however, how do i get it to detect the second harddrive? I have tried boot -r... (2 Replies)
Discussion started by: crzywut
2 Replies

6. UNIX for Dummies Questions & Answers

booting from which harddrive

Hi, both of my /dev/hda and my /dev/hdb contain /boot partition. I'm wondering how to tell which harddrive's /boot is actually being read? Thanks (2 Replies)
Discussion started by: onthetopo
2 Replies

7. UNIX for Dummies Questions & Answers

Adding an additional harddrive in solaris 9

Hello, I have a system which a new harddrive was installed for additional space. I now need to mount the drive and transfer data from /home to the new drive with a mount point named /home. How do I go about doing this? Thanks in advance. (5 Replies)
Discussion started by: GLJ@USC
5 Replies

8. UNIX for Dummies Questions & Answers

Copying a file to my harddrive

I'm loged on to a unix sever over the internet and i want to copy a file from there to my harddrive. How would i go about this because cp does not seem to work. (1 Reply)
Discussion started by: zoolz
1 Replies

9. Linux

Mount a harddrive in linux.

Hey people i'm very new to linux. I just put a extra 200 gig maxtor HD in my computer. Linux can tell it's there...but it says it cant mount it. How do i mount it manually? thanks, John (2 Replies)
Discussion started by: RKJV
2 Replies

10. Filesystems, Disks and Memory

Supplemental harddrive.

Am planning on adding a secodary SCSI hardrive to the existing 20gb drive., that I have. The old drive has Linux on it. Once, the new drive is added, I am planning on having windows on it. Firstly, could this be done ? Has anyone build a system with a similar configuration ? What is requried,... (1 Reply)
Discussion started by: matvrix
1 Replies
Login or Register to Ask a Question