8

After searching this site, and reading the Ubuntu community documentation, I've decided to use a simple tar command such as

sudo tar -cvpzf serverbackupMMDDYYYY.tgz --exclude=/proc --exclude=/lost+found --exclude=/mnt --exclude=/sys --exclude=/media --exclude=/backups --exclude=/boot --exclude=/dev  --exclude=/home -exclude=/tmp --exclude=serverbackupMMDDYYYY.tgz / 

To backup my system. While researching how to backup my system it seemed some people recommended excluding /dev (as I'm doing above) and others warned that there could be problems doing that (but they didn't elaborate).

What are the pros and cons of including or excluding /dev in a backup?

I tested a full backup/restore and didn't run into any problems excluding /dev myself, but I also think I took more steps than necessary to restore. After inserting a non broken hard drive I reinstalled Ubuntu and then extracted the backup over the fresh install.

2 Answers 2

9

Some directories are irrelevant into a backup. For example:

  • /dev/*
  • /proc/*
  • /sys/*
  • /tmp/*
  • *lost+found

They are created during the boot, and are related specific with your devices and/or your running processes.

While its irrelevant to backup or not - your kernel will recreate those directories when boot from restored backup - you probably will save a little time if you do not backup it.

1
  • None of the nodes in dev are real files, and none of them contain much that isn't generated.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .