<div dir="ltr"><div><div><div><div><div>I was doing some tests to list broken links and file system loops (I know that you already have, bare with me):<br></div> $ sudo find -L . -type l -exec ls -l '{}' \; > ~/broken.txt<br></div></div><br></div><div>Then I run it on my root and, surprise, I had a few hundred bad links too. When I cancel the command I had already a 33Mb text file.<br><br></div><div>As I notice /proc on the screen, I removed that directory from the results. Then I removed /sys, /run and /var/run.<br><br></div><div>Then I removed from the results a /usr/share/help and some obvious old and temp backups dirs in my home, and I ended up just with a few bad links.<br><br></div><div>So I'm just asking if your situation may be kind of similar, or it is in fact the enormity of (real) bad links. That's some hope, isn't it?<br><br></div>Also the above command plus ' 2> ~/loops.txt' at the end will list file system loops at ~/loops,txt,<br><br></div><div><div><br></div><div><br><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 17, 2016 at 12:47 AM, Ralf Mardorf <span dir="ltr"><<a href="mailto:silver.bullet@zoho.com" target="_blank">silver.bullet@zoho.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Tue, 16 Feb 2016 14:16:35 -0800, rikona wrote:<br>
>I reorganize my disks and that breaks links.<br>
<br>
</span>You seemingly disorganised your disk ;).<br>
<span class=""><br>
>Is there a GUI tool<br>
<br>
</span>I don't know. You likely found hints how to use command line.<br>
<br>
<a href="http://unix.stackexchange.com/questions/34248/how-can-i-find-broken-symlinks" rel="noreferrer" target="_blank">http://unix.stackexchange.com/questions/34248/how-can-i-find-broken-symlinks</a><br>
<br>
[rocketmouse@archlinux Desktop]$ ls -Gg *<br>
-rw-r--r-- 1    0 Feb 17 00:28 a<br>
-rw-r--r-- 1    0 Feb 17 00:28 b<br>
lrwxrwxrwx 1    1 Feb 17 00:29 c -> b<br>
lrwxrwxrwx 1    1 Feb 17 00:29 d -> e<br>
lrwxrwxrwx 1    1 Feb 17 00:30 f -> g<br>
lrwxrwxrwx 1    1 Feb 17 00:30 g -> f<br>
lrwxrwxrwx 1   15 Feb 17 01:27 me_myself_and_i -> me_myself_and_i<br>
lrwxrwxrwx 1   11 Feb 17 00:50 z -> directory_1<br>
<br>
directory:<br>
total 0<br>
-rw-r--r-- 1 0 Feb 17 00:33 a<br>
-rw-r--r-- 1 0 Feb 17 00:33 b<br>
lrwxrwxrwx 1 1 Feb 17 00:34 c -> b<br>
lrwxrwxrwx 1 1 Feb 17 00:34 d -> e<br>
lrwxrwxrwx 1 1 Feb 17 00:34 f -> g<br>
lrwxrwxrwx 1 1 Feb 17 00:34 g -> f<br>
<br>
directory_2:<br>
total 0<br>
[rocketmouse@archlinux Desktop]$ echo; for l in $(find . -type l); do cd $(dirname $l); if [ ! -e "$(readlink $(basename $l))" ]; then echo -n "$l -> "; fi; cd - > /dev/null; if [ ! -e "$(readlink $(basename $l))" ]; then readlink $l; fi; done<br>
<br>
./f -> g<br>
./z -> directory_1<br>
./directory/f -> g<br>
./directory/d -> e<br>
./directory/g -> f<br>
./d -> e<br>
./me_myself_and_i -> me_myself_and_i<br>
./g -> f<br>
<br>
So you get a list of all broken links, but it's also possible to<br>
e.g. find all links against "directory_1" and to change those links to<br>
link against e.g. "directory_2" instead of linking against<br>
"directory_1", but I wouldn't do this. You also could sort and compare<br>
to find circular links, but while this might be easy to solve for<br>
"1 -> 2" vs "2 -> 1" and easier for "me_myself_and_i -> me_myself_and_i",<br>
it becomes tricky when the loops are caused by a chain of links.<br>
<br>
I would be careful with using a script or a GUI tool that automatically<br>
reorganizes links.<br>
<br>
Assumed you used links against /mnt/old/foo and now there<br>
isn't /mnt/old/ anymore, now the links should be against /mnt/new/foo,<br>
then I wouldn't change all links, I would create a link<br>
/mnt/old -> /mnt/new/.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
--<br>
ubuntu-users mailing list<br>
<a href="mailto:ubuntu-users@lists.ubuntu.com">ubuntu-users@lists.ubuntu.com</a><br>
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/ubuntu-users" rel="noreferrer" target="_blank">https://lists.ubuntu.com/mailman/listinfo/ubuntu-users</a><br>
</div></div></blockquote></div><br></div>