Richard Fish wrote:
> Jarry wrote:
> 
>>
>> Is it not possible to archive MBR too? That way I could save 5. and
>> 6., and to automate it with some scripts...
> 
> 
> 
> Technically, yes, I guess you could do this.  Although, I don't know if
> I would really recommend it.
> 
> If you are using a stage 1.5 with grub, you would need to archive the
> first 63 blocks of the disk (technically fewer than that, but you would
> have to check grub-install's output to be sure of the exact count, and
> 63 is the safe number).  This is because grub embeds the stage1.5 loader
> after the mbr (first block) and the start of the first partition.
> 
> If you are not using the stage 1.5, or you are using lilo, then you have
> little choice but to reinstall the boot loader.  This is because some
> files in /boot are block mapped into the mbr, and the restore process
> may have changed the layout of these files, so the block map will be
> incorrect.
> 
> I think the safest route is to always let the system write a fresh mbr.
> 
> -Richard
> 

It make sense but is easily bypassable using "hda1" as boot partition
AND it's the first on disk, with a little help from "fdisk" and "dd"
("##" are shell commands "#" comm.inside fdisk):

==== hikky trikky ====
##fdisk /dev/hda
#Command (m for help): u
Changing display/entry units to sectors
#Command (m for help): p

Disk /dev/hda: 40.0 GB, 40027029504 bytes
255 heads, 63 sectors/track, 4866 cylinders, total 78177792 sectors
Units = sectors of 1 * 512 = 512 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *          63      979964      489951   83  Linux
#Command (m for help): q

##dd if=/dev/hda of=MBR-boot.backup bs=512 count=489951
==== hikky trikky ====

MBR-boot.backup now contain your MBR + the boot partition.

now three question:
a) I know noone that use this backup method, is it affidable ?
b) What happen if it need to be restored on another disk
c) HOW do I restore (hint "man dd")

Another hint: always try at least one restore after a choice of backup
method, the rule is "you never know" .

cheers
Francesco
-- 
gentoo-user@gentoo.org mailing list

Reply via email to