Subj : Re: backing up /dev with tar To : comp.os.linux From : chaotic_thought Date : Fri Jul 09 2004 07:26 pm joint52@yahoo.com (jfr) wrote in message news:... > Is this possible [backing up /dev with tar]? I tried it on my system with GNU tar 1.13.94; block and character special devices were backed up and restored without problem. But the best way is not to take some stranger's word for it but to verify it be will correct on your system: $ su root # mkdir -p /tmp/dev.test # tar -cf /dev.tar /dev/* # cd /tmp/dev.test # tar -xf /dev.tar Those commands will create a new directory called /tmp/dev.test that will be used to test your tar'd copy of the /dev directory. The first tar command creates an archive called /dev.tar which holds a copy of all the files in /dev; the second tar command extracts that archive to the test directory. In theory, the contents of the directories should be the same: # cd /tmp/dev.test # ls -l > /dev.test.ls # cd /dev # ls -l > /dev.ls Those commands save the contents of the long directory listing (ls -l) which outputs all information necessary to recreate (manually or otherwise) all the block and character special devices in the /dev directory. By saving two copies, the original called /dev.ls and the untarred version called /dev.test.ls, you can compare them to see if they are the same. # cd / # if which vimdiff; then \ # vimdiff dev.ls dev.test.ls; \ # else \ # diff dev.ls dev.test.ls; \ # fi Of course, you don't really have to type the if/else/fi if you know whether or not you want to use vimdiff and if you know it is installed. I recommend it since it allows you to investigate the differences interactively. Otherwise, just executing 'diff dev.ls dev.test.ls' will show you the differences relative to dev.ls (the listing of your original /dev directory). If running 'diff' produces no output, that means the two directories are identical, thus it is safe to use your version of tar to backup your /dev directory, including special permissions/owners/groups, etc. QED. .