Unix Technical Forum

dd-ing MBRs

This is a discussion on dd-ing MBRs within the Slackware Linux Support forums, part of the Unix Operating Systems category; --> Here's a quick one. On a disk with partitions hda1 through hda4, will dd-ing 512 bytes of hda and ...


Go Back   Unix Technical Forum > Unix Operating Systems > Slackware Linux Support

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-19-2008, 08:01 AM
Reed Loefgren
 
Posts: n/a
Default dd-ing MBRs

Here's a quick one.

On a disk with partitions hda1 through hda4, will dd-ing 512 bytes of
hda and 512 bytes of hda1 produce the same file?

Regards,

r
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-19-2008, 08:01 AM
Henrik Carlqvist
 
Posts: n/a
Default Re: dd-ing MBRs

"Reed Loefgren" <rloef@interfold.com> wrote:
> On a disk with partitions hda1 through hda4, will dd-ing 512 bytes of
> hda and 512 bytes of hda1 produce the same file?


The first 512 bytes of /dev/hda contains the master boot record and the
partition table. The first 512 bytes of /dev/hda1 might contain a boot
record. However, if so, this boot record differs from the master boot
record. The first 512 bytes of /dev/hda1 does not contain any partition
table unless /dev/hda1 is an extended partition. If you only have
/dev/hda1 to /dev/hda4 you don't have any logical partitions and probably
only primary partitions.

regards Henrik

--
The address in the header is only to prevent spam. My real address is:
hc2(at)uthyres.com Examples of addresses which go to spammers:
jonas@webtech.se info@emailpromo.biz root@localhost
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-19-2008, 08:01 AM
Eef Hartman
 
Posts: n/a
Default Re: dd-ing MBRs

Reed Loefgren <rloef@interfold.com> wrote:
> On a disk with partitions hda1 through hda4, will dd-ing 512 bytes of
> hda and 512 bytes of hda1 produce the same file?


No.
The 512 bytes of hda is the MBR (also called master partition table),
the one for hda1 will get the boot block (block 0) OF that partition.

On _most_ disks the MBR will be cylinder 0, track 0, sector 1 and the
boot block for hda1 0, 1, 1 (so one track further).
The rest of track 0 is unused, except for boot managers.
--
************************************************** ******************
** Eef Hartman, Delft University of Technology, dept. EWI/TW **
** e-mail: E.J.M.Hartman@math.tudelft.nl, fax: +31-15-278 7295 **
** snail-mail: P.O. Box 5031, 2600 GA Delft, The Netherlands **
************************************************** ******************
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-19-2008, 08:02 AM
Reed Loefgren
 
Posts: n/a
Default Re: dd-ing MBRs

Thanks to both of you for the clarification. I lost the backup drive
to a mysteriously corrupted boot block on our reiserfs-ed mail server
and am trying to get a rescue scheme designed for future use, (the
disk has been replaced-ext3.)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 07:18 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com