1 |
On Sun, 28 Feb 2010 13:10:02 +0100, Mick wrote about Re: [gentoo-user] |
2 |
Re: Who believes in cylinders?: |
3 |
|
4 |
>On Saturday 27 February 2010 18:20:24 Etaoin Shrdlu wrote: |
5 |
>> On Saturday 27 February 2010, BRM wrote: |
6 |
>> > Stage 1 focuses solely on loading Stage 2, |
7 |
>> > and has historically been limited to a total size[1] to 512 bytes, |
8 |
>> |
9 |
>> It's actually less than that, because the first 64 bytes of sector 0 |
10 |
>> contain the partition table, so the maximum size of a stage1 |
11 |
>> bootloader is 510 - 64 = 446 bytes. |
12 |
> |
13 |
>Yep, that's why dd if=/dev/sda of=~/partition_table.img bs=446 count=1 |
14 |
>will make you a nice back up of your partition table, |
15 |
|
16 |
Actually, it will backup your primary bootstrap code. Try: |
17 |
|
18 |
dd if=/dev/sda of=~/partition_table.img bs=1 skip=446 count=64 |
19 |
|
20 |
Note that you will need to be root or in the "disk" group (or |
21 |
equivalent on your system), so that you have access to /dev/sda as a |
22 |
raw device file. [As ever, sudo is your friend.] |
23 |
|
24 |
Also note that this backup will only contain the primary partitions and |
25 |
any extended partition on that disk; all the logical drives within the |
26 |
extended partition are mapped by secondary partition tables in their |
27 |
local bootstrap records (LBRs). This makes for a more complicated |
28 |
process to backup the complete partition table for the disk. |
29 |
|
30 |
Worse still, all of my machines have at least 4 hard drives -- some as |
31 |
many as 7. So this process has to be repeated for each physical disk. |
32 |
|
33 |
Many years ago I wrote an OS/2 program to handle all of this. Perhaps I |
34 |
should blow the dust off it, convert it to use POSIX functions and |
35 |
publish it as FOSS. |
36 |
|
37 |
> while bs=512 will back up your complete MBR. |
38 |
|
39 |
True. |
40 |
-- |
41 |
Regards, |
42 |
|
43 |
Dave [RLU #314465] |
44 |
====================================================================== |
45 |
dwnoon@××××××××.com (David W Noon) |
46 |
====================================================================== |