loadYOURSELF

loadYOURSELF

Entries Tagged ‘backup’

Linux mbr record backup with sfdisk included extened partition infos

You can backup your system partition table with sfdisk which you can also inlude extended partitions.

backup partition table

sfdisk -d /dev/sda > my-sda.sf

restore partition table

sfdisk /dev/sda < my-sda.sf --force

you can download the sfdisk source from

ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.15/

and you can compile it for your desktop PC or for your embedded device. (cross compiling)

Buy me a beer

MBR backup with dd command @ LINUX

MBR is the master boot record of your disks. It includes also partition table. If you want to create one to one partition table and don’t want to copy all your disk you can use the commands below

to backup your mbr

dd if=/dev/sdX of=mbr.bin bs=512 count=1

to restore back your mbr

dd if=mbr.bin of=/dev/sdX bs=1 count=64 skip=446 seek=446

Buy me a beer

Backup entire disk (mbr included) with dd (linux command) and gzip

BACKUP DISK

dd if=/dev/sdX | gzip > a.gz

RESTORE BACK

gzip -dc  a.gz | dd of=/dev/sdX

Buy me a beer