Re: poorly set up symlinks

Tim Lovelock (timothy.lovelock@yale.edu)
Sat, 27 Feb 1999 15:43:34 -0500

actually I used cp -ax which I was told would preserve everything, which it
did. The problem was that symlinks that were referened using .. caused
problems since /usr is now stored in /hdd/usr and /usr is a symlink to the
actual directory, so when the symlinks tried to reference root, they were
actually referencing /hdd. It wasn't a problem with symlinks that were set
up in reference to /.

Now the next question is if there is any way to convert all of those
symlinks that aren't referencing correctly...

--Tim

Matthew Hiller wrote:

> Another thing I just realized,
>
> You must've done something like
>
> $ mv /usr /hdd
>
> To change the device that /usr is really on. I don't think
> something like this deals w/ symlinks correctly; there are other ways of
> copying over the tree that do, I think (someone correct me if I'm wrong).
> The two main ones are:
>
> $ cd /hdd
> $ tar -cf - -C / usr | tar -xvpf -
>
> or
>
> $ cp -pr /usr /hdd
>
> They differ in how they handle symlinks. The former will recreate
> links in the new location, the latter converts symlinks to files. (For
> that reason, the former's better.)
>
> (This info is in O'Reilly's Essential System Administration by
> Aeleen Frisch. Picking up this book - or one like it that's more
> Linux-specific - probably wouldn't be a bad idea.)
>
> Matt