# Backing up partition using dd and changing files

I'm a Linux newbie. From what I've read, you can back up an entire partition like this:

dd if=/dev/sda1 of=/media/external/backup


Can anyone tell me if I need to worry about files being changed while doing this? Could it be that some critical system file might get changed during the dd operation and then when you want to restore the backup, it won't work?

I'm on Ubuntu 12.04.

-
Generally the device you want to backup should be unmounted before further processing since it is possibly that not everything in the buffer is written to the storage medium. To reduce the risk of a corrupted backup you can run sync before but it is not advisable. –  user1146332 Sep 17 '12 at 14:28
Is it possible to unmount /dev/sda1 even if it is the partition where Linux is installed? –  Magnus Sep 17 '12 at 14:30
The usual way to backup the root partition is to boot from another partition or another medium (rescue disc, usb stick, tape, etc.) and start the backup from there. I recommend further to take a look at fsarchiver. It's a file based backup tool and you can restore the backup on another partition that is at least equally sized. dd in contrast is sector based and you can restore the data only on partitions that equals the source partition of the backup (equal amount of sectors). –  user1146332 Sep 17 '12 at 14:36
–  Gilles Sep 17 '12 at 23:41