Debian install: backup partition

311 Views Asked by At

I want to re-install my Debian install, for various reasons. Before doing this, I would like to backup my Debian partition, if something goes wrong(highly unlikely). I have backupped entire disks before, but not single partitions. My partition layout:

sda 8:0 0 232,9G 0 disk

├─sda1 8:1 0 35G 0 part

├─sda2 8:2 0 194G 0 part /

└─sda3 8:3 0 4G 0 part

sda1: Windows 8.1

sda2: Debian Jessie

sda3: swap

Can I just bootup a portable Linux drive using a USB Key, and use "dd" to copy "sda2" to my external hard drive?

And since it is the second partition, do I have to do anything with the MBR, if I wish to restore my backupped partition?

Sorry if these questions sound noobish(or if it's a duplicate), but I researched on how to do it, but wanted to be 100% sure before proceeding.

Thank you.

1

There are 1 best solutions below

1
On

Yes, you can do this with dd. I would probably do it like this:

# dd if=/dev/sda2 of=/media/usb/debian-backup.img

where /media/usb/ is the mount point of your external hard drive.

If you don't resize any of your partitions when doing the reinstall, you won't need to touch the MBR.