![]() |
Tar gives error when creating a tar file archive
As root, I executed the following command in the / directory:
Code:
tar cvf /bkroot/backup.tar ../proc/1118/root ./proc/1118/exe ./proc/1118/mounts ./opt/ ./floppy/ ./cdrom/ ./initrd/ ./vmlinuz.old ./sys/ ./bkroot/ ./bkroot/lost+found/ tar: ./bkroot/backup.tar: file is the archive; not dumped tar: Error exit delayed from previous errors Then it ended with the above error. What is the right command (apparently mine is wrong since it ended with an error) to backup everything from / down to all subdirectories to /bkroot/backup.tar ? Thanks :) |
keep it simple
tar cvf backup.tar * |
I'm only have sufficient disk space on /bkroot, which is on another physical harddisk. So, to use your command, I'll have to do
Code:
cd /bkrootThanks again ! Quote:
|
i guess it would be for example
Code:
tar cvf - . | gzip >/bkroot/backup.tar.gz |
I've the verbose output while it is archiving piped to grep ^tar with the following results:
tar: ./tmp/.X11-unix/X64: socket ignored tar: ./tmp/.X11-unix/X0: socket ignored tar: ./tmp/.font-unix/fs7100: socket ignored tar: ./dev/log: socket ignored tar: ./proc/kcore: File shrank by 545927168 bytes; padding with zeros tar: ./proc/2/exe: Cannot readlink: No such file or directory tar: ./proc/3/exe: Cannot readlink: No such file or directory tar: ./proc/4/exe: Cannot readlink: No such file or directory tar: ./proc/5/exe: Cannot readlink: No such file or directory tar: ./proc/6/exe: Cannot readlink: No such file or directory tar: ./proc/7/exe: Cannot readlink: No such file or directory tar: ./proc/94/exe: Cannot readlink: No such file or directory tar: ./proc/124/exe: Cannot readlink: No such file or directory tar: ./proc/951/exe: Cannot readlink: No such file or directory tar: ./proc/1432/fd/4: Cannot stat: No such file or directory tar: ./bkroot/backup.tar: file is the archive; not dumped tar: Error exit delayed from previous errors Any advice? Thanks :) |
Quote:
What distro are you running? You do not need to backup all directories. Like lost+found, /tmp and even /proc. See man pages for tar on excluding directories. |
I'm trying to transfer my entire system to a new harddisk. If I exclude /proc, /dev, lost+found, can my new harddisk boot up without those directories? Will they be created on the new harddisk's first boot-up?
Thanks ! Running Debian 'Sarge' Quote:
|
Why not mount the drive and copy the files using the cp command. You can preserve permissions as well as copy subdirectories.
|
Assuming /dev/hdb2 is my new harddisk, is the following command correct to copy the entire system(everything from / directory onwards) ?
Code:
mount /dev/hdb2 /bkroot && cp -pR / /bkrootQuote:
|
Make it commands and it should work
mount /dev/hdb2 /bkroot cp -pR /* /bkroot/ |
The system seems to be in a indefinite loop during the copy process. I'm not sure, but I suspect it is because /bkroot is a sub directory of /, so by coping recursively, it will fall into a indefinitely loop? Just a guess...
Is there any arguement that can be used to exclude /bkroot in the copy process? Thanks :) Quote:
|
| All times are GMT -5. The time now is 06:31 AM. |