Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to copy MBR from old harddrive to new harddrive? Post 302274152 by drak on Tuesday 6th of January 2009 10:43:28 PM
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
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

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

8. 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

9. 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

10. 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
MBRLABEL(8)						    BSD System Manager's Manual 					       MBRLABEL(8)

NAME
mbrlabel -- update disk label from MBR label(s) SYNOPSIS
mbrlabel [-fqrw] [-s sector] device DESCRIPTION
mbrlabel is used to update a NetBSD disk label from the Master Boot Record (MBR) label(s) found on disks that were previously used on DOS/Windows systems (or other MBR using systems). mbrlabel scans the MBR contained in the very first block of the disk (or the block specified through the -s flag), then walks through every extended partition found and generates additional partition entries for the disk from the MBRs found in those extended partitions. Each MBR partition which does not have an equivalent partition in the disk label (equivalent in having the same size and offset) is added to the first free partition slot in the disk label. A free partition slot is defined as one with an fstype of 'unused' and a size of zero ('0'). If there are not enough free slots in the disk label, a warning will be issued. The raw partition (typically partition c, but d on i386 and some other platforms) is left alone during this process. By default, the proposed changed disk label will be displayed and no disk label update will occur. Available options: -f Force an update, even if there has been no change. -q Performs operations in a quiet fashion. -r In conjunction with -w, also update the on-disk label. -s sector Specifies the logical sector number that has to be read from the disk in order to find the MBR. Useful if the disk has remapping drivers on it and the MBR is located in a non-standard place. Defaults to 0. -w Update the in-core label if it has been changed. See also -r. SEE ALSO
disklabel(8), dkctl(8), fdisk(8), mbr(8) HISTORY
The mbrlabel command appeared in NetBSD 1.4. BSD
April 5, 2010 BSD
All times are GMT -4. The time now is 05:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy