You are not logged in.

#1 2011-08-15 10:05:31

thisoldman
Member
From: Pittsburgh
Registered: 2009-04-25
Posts: 1,172

Examine the MBR

This post might belong in the 'Try This' subforum.

As part of my disaster recovery strategy, I backup the MBRs of my hard drives using variations of this command:

dd if=/dev/sda of=/mnt/backup/mbr_sda.bin bs=512 count=1

What I find interesting is the information that the 'file' command gives about the MBR when run on these backup files.  I've edited the output of the file command to give manageable line lengths in the forum [⁣code] box.

### MBR with GRUB:
$ file /mnt/backup/mbr_sda.bin
/mnt/backup/mbr_sda.bin: x86 boot sector; GRand Unified Bootloader, stage1 version 0x3,
stage2 address 0x2000, stage2 segment 0x200; partition 1: ID=0x83, active, starthead 32,
startsector 2048, 204800 sectors; partition 2: ID=0x82, starthead 223, startsector 206848,
4194304 sectors; partition 3: ID=0x5, starthead 244, startsector 4401152, 620740608 sectors,
code offset 0x48

### MBR with Windows 7 boot loader:
$ file /mnt/backup/mbr_sdc.bin
/mnt/backup/mbr_sdc.bin: x86 boot sector; partition 1: ID=0x7, active, starthead 1, startsector 63,
167772802 sectors; partition 2: ID=0x83, starthead 254, startsector 167782860, 444775590 sectors;
partition 3: ID=0x83, starthead 254, startsector 612558450, 12578895 sectors, code offset 0xc0,
OEM-ID "      м", Bytes/sector 190, sectors/cluster 124, reserved sectors 191, FATs 6,
root entries 185, sectors 64514 (volumes <=32 MB) , Media descriptor 0xf3, sectors/FAT 20644,
heads 6, hidden sectors 309755, sectors 2147991229 (volumes > 32 MB) , physical drive 0x7e,
dos < 4.0 BootSector (0x0)

### No boot loader:
$ file /mnt/backup/mbr_sdb.bin
/mnt/backup/mbr_sdb.bin: x86 boot sector; partition 1: ID=0xf, starthead 1, startsector 63,
625137282 sectors, code offset 0xb8

Last edited by thisoldman (2011-08-15 10:06:01)

Offline

Board footer

Powered by FluxBB