backup & restore partition tables on Linux environments [dd]

Posted by

To backup and restore disk partition tables, you need to use the command “dd” with two options:

if and of.

if = “input”
of = “output”

For example,

# dd if=/dev/sda of=backup bs=512 count=1
it will backup the MBR on the first disk, including 64-bit partition which is part of it.

# dd if=backup of=/dev/sda bs=512 count=1

those commands will only import the primary partition table. it does not deal with any partition tables stored in the other partitions.


Options are:

–help display this help and exit
–version output version information and exit

GNU coreutils online help: <;
For complete documentation, run: info coreutils ‘dd invocation’

[root@b0ydC home]# dd –version
dd (coreutils) 8.22
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <;.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Paul Rubin, David MacKenzie, and Stuart Kemp.
[root@b0ydC home]#

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s