WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: need all boot record and all boot loader backup tool  (Read 1870 times)

Offline ibug

  • Jr. Member
  • **
  • Posts: 76
need all boot record and all boot loader backup tool
« on: February 05, 2012, 11:17:31 AM »
is there any way to read or copy only boot record with any boot loader files
 in all supported partitions or file systems
 without copying whole partition with whole Operating System
and of course to copy those data back in exactly those place

Offline netnomad

  • Hero Member
  • *****
  • Posts: 1026
Re: need all boot record and all boot loader backup tool
« Reply #1 on: February 06, 2012, 03:39:34 AM »
hi,

you can save the mbr and the bootsector in a file:

backup image of the bootsector of disk and partition
dd if=/dev/sdx of=disk.mbr bs=512 count=1
dd if=/dev/sdxY of=part.bot bs=512 count=1

writing back your saved images to disk
dd if=disk.mbr of=/dev/sdx bs=512
dd if=part.bot of=/dev/sdxY bs=512

be careful, in my example sdx could mean hda or sda or something resembling.
sdxY could mean hda1 odr sda1, all that depends on your configuration!
be careful, double-check it, decide and do it on your own risk.

my tinycore offers no boot-directory, so there is nothing to safe.
if you use a distribution with a /boot-directrory, then you will find some files under /boot,
so then you can backup your kernel and it's files like System*, config*, initrd* and vmlinuz*.
« Last Edit: February 06, 2012, 03:50:13 AM by netnomad »

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: need all boot record and all boot loader backup tool
« Reply #2 on: February 06, 2012, 03:51:31 AM »
It is not necessarily enough. You may expect bootsectors at the beginning of partitions too above the beginning of the drive.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline ibug

  • Jr. Member
  • **
  • Posts: 76
Re: need all boot record and all boot loader backup tool
« Reply #3 on: February 06, 2012, 06:44:38 AM »
hi,

you can save the mbr and the bootsector in a file:

backup image of the bootsector of disk and partition
dd if=/dev/sdx of=disk.mbr bs=512 count=1
dd if=/dev/sdxY of=part.bot bs=512 count=1

writing back your saved images to disk
dd if=disk.mbr of=/dev/sdx bs=512
dd if=part.bot of=/dev/sdxY bs=512

be careful, in my example sdx could mean hda or sda or something resembling.
sdxY could mean hda1 odr sda1, all that depends on your configuration!
be careful, double-check it, decide and do it on your own risk.

my tinycore offers no boot-directory, so there is nothing to safe.
if you use a distribution with a /boot-directrory, then you will find some files under /boot,
so then you can backup your kernel and it's files like System*, config*, initrd* and vmlinuz*.

it will not work for ext2 or reiserFS
it will not work for all Fat32 which can have 3072 boot sector size

it coult not work even for MBR
 if you did hear about HardDisks with 2048 hardware sector size
 but this is not good example

of course most OS like windows and DOS need only 512

but does it exist something to read boot sector of partition
and check which boot loader in what version did create this boot sector
then seek where are files or data to load by this boot sector
save this data or files not including files which do not need to be stored in exact place

and the worst thing when recoverying this boot data or files to other placed and smaller partition
it youst edit location of this boot data in to new location inside smaller partition

not saying it can convert MBR boot loader in it partition boot loader
but if it works with lilo syslinux grub grub4dos partition boot loaders
in every version on many kind of partitions

probably useing script and some good text hex editor it can be accomplish