Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question
add comment

2 Answers 2

up vote 7 down vote accepted

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.

share|improve this answer
add comment
  • None of the nodes in dev are real files, and none of them contain much that isn't generated.
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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