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.


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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.