[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: tar ate my symlinks



Brian Victor said:
> I backed up my debian installation with the following:
>
> tar --preserve -cv / | ssh 192.168.2.10 'cat > linuxbackup.tar.bz2'

may I ask why? I have never heard of someone attempting such
a task in that manor. I would say that the above is the source of
the problems. Checking tar's manpage reveals no mention of the
preserve option either.  I just tested using tar -cvf making a tar
file with symlinks and extracted it with tar -xvf and the symlinks
were preserved. You probably do not want to try to tar up the
entire root partition as that includes /proc which is generally a
real bad thing to try to backup.

I would reccomend tarring to a file then copying the file over.
Or, rsync(preferred rsync -av), or use NFS and tar to the NFS mount.

As for fixing your system, if all the files are chmod'd 000 your
pretty much screwed as far as getting it back to a normal state,
you may be able to run apt-get and have it reinstall all packages
to hopefully restore all permissions, otherwise if it was my system
I would backup the data I wanna keep & reinstall.

I hosed a redhat box in a similar way once, did a chown -R root.root
on the /root directory, but somehow there was a symlink in the root
directory which went to / which changed the ownership on every file
on the system. I also did a chmod on it as well, spent several hours
trying to get hte system back to normal, most of it was working but
in the end a buncha stuff was broken. Wasn't worth it trying to
continue, so we reinstalled.

nate





Reply to: