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