Jump to content

Is Symlinking under shares / within shares safe/supported/etc


Recommended Posts

Let's say I have lots of movies in

/mnt/user/Movies

 

and they're in folders based on what format they're in, DivX/DVDR/etc

 

/mnt/user/Movies/DVD/MovieA

/mnt/user/Movies/DVD/MovieB

/mnt/user/Movies/DivX/MovieD

 

and I want to create a folders to sort things by year

 

/mnt/user/Movies/byYear/2008

/mnt/user/Movies/byYear/2010

 

within those folders I want to create symlinks to the movies where they are stored

 

/mnt/user/Movies/byYear/2008/MovieA -> /mnt/user/Movies/DVD/MovieA

/mnt/user/Movies/byYear/2008/MovieD -> /mnt/user/Movies/DivX/MovieD

/mnt/user/Movies/byYear/2010/MovieB -> /mnt/user/Movies/DVD/MovieB

 

How will unRAID handle that, and will it share properly over SMB to my player? I'd like to do similar things with TV and music as well, mainly because my music is sorted by artist, and I'd like to have folders for genre and such... I need to know that if I make a bunch of symlinks it won't mess things up, and that things will still be accessible via the SMB shares.

 

Cheers,

  Kyrin

Link to comment

As long as the links are in the user shares I don't see a problem with it.. I have some symlinks and they work fine.. You might have to watch your split levels if your symlinks are on the split level.

I'm sure someone will correct me if I am wrong :)

Link to comment

As long as the links are in the user shares I don't see a problem with it.. I have some symlinks and they work fine.. You might have to watch your split levels if your symlinks are on the split level.

I'm sure someone will correct me if I am wrong :)

 

Last time I tried a symbolic line on a user shared it failed.  I just tried again and it gives me:

root@Tower:/mnt/user/Movies# ln -s 10.nfo  ../Movies_New/

ln: creating symbolic link `../Movies_New/10.nfo': Too many levels of symbolic links

 

I even tried a symbolic link on a disk share to another directory on a disk share, it did not work for me back then either, but it might have been SAMBA not following the symbolic link.

 

You can create hard links on the disk shares.  You'll need to create the byYear/year directories on each disk they apply to, and then do something like

ln /mnt/disk1/Movies/DVD/MovieA /mnt/disk1/Movies/byYear/2008

 

The movie will then show up in the user-shares as expected.

 

I use a scheme almost exactly like this to have my movie collection show up as a single list under \\tower\Movies and also as alpha ranges as \\Tower\Movies A-D, \\tower\Movies E-J, etc.  I have way too many movies to comfortably list via a single list on my older media players.

 

I also do the same for holiday movies...  My script for those look like this sample:

for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
do
  rm /mnt/disk$i/Movies-Xmas/*.[Aa][Vv][ii]
  rm /mnt/disk$i/Movies-Xmas/*.[ii][ss][Oo]
  rm /mnt/disk$i/Movies-Xmas/*.[Mm][Pp][Gg]
  rmdir /mnt/disk$i/Movies-Xmas
done

echo "
BELLS_OF_ST_MARYS.ISO
CHRISTMAS_CAROL-ALISTER_SIMS.ISO
CHRISTMAS_CAROL-GEORGE_C_SCOTT.ISO
ELF-1.ISO
HOLIDAY_INN.ISO
HOME_ALONE-1.ISO
HOME_ALONE-2.ISO
MIRACLE_ON_34TH_STREET-NEW.ISO
MIRACLE_ON_34TH_STREET-ORIG.ISO
THE_SANTA_CLAUSE-1.ISO
THE_SANTA_CLAUSE-2.ISO
THE_SANTA_CLAUSE-3.ISO
WHITE_CHRISTMAS.ISO
" | while read movie
do
if [ "$movie" != "" ]
then
  a=`ls /mnt/disk*/Movies/"$movie"`
  if [ "$a" != "" ]
  then
    d=`dirname "$a"`
    cd "$d"
    mkdir -p ../Movies-Xmas
    ln "$a" ../Movies-Xmas
  fi
fi
done

 

Joe L.

Link to comment

Last time I tried a symbolic line on a user shared it failed.   I just tried again and it gives me:

root@Tower:/mnt/user/Movies# ln -s 10.nfo  ../Movies_New/

ln: creating symbolic link `../Movies_New/10.nfo': Too many levels of symbolic links

 

I even tried a symbolic link on a disk share to another directory on a disk share, it did not work for me back then either, but it might have been SAMBA not following the symbolic link.

 

You are correct.. I have the symlinks on my raid5 server that I am currently moving the data from.. (sorry for the mixup)

Link to comment

I just created a few symlinks in a user share and they got created just fine.. (via mc)

 

for example:

 

the link /mnt/user/Movies/1New is linked to /mnt/user/Movies/2081 and I can access it via SBM just fine

Interesting... I never tried from inside "mc"

 

I just tried it from in "mc" and it too worked.... however, when I looked closer, I found the link was made from the disk share to the user share (not that it matters)

root@Tower:/mnt/user/Movies# ls -l /mnt/user/Movies/10*

-rwx------ 1 root root      26430 Mar 10 21:15 /mnt/user/Movies/10.tbn*

 

root@Tower:/mnt/user/Movies# ls -l /mnt/user/Movies-Halow/10*

lrwxrwxrwx 1 root root 23 Apr 13 16:04 /mnt/user/Movies-Halow/10.tbn -> /mnt/user/Movies/10.tbn*

 

root@Tower:/mnt/user/Movies# ls -l /mnt/disk*/Movies-Halow/10.*

lrwxrwxrwx 1 root root 23 Apr 13 16:04 /mnt/disk11/Movies-Halow/10.tbn -> /mnt/user/Movies/10.tbn*

Link to comment

I wonder if the restriction is that you can't use relative paths... Although, now that I've added things to my XBMC library, I'm pondering if I need to do this anymore...

 

I would say no, let XBMC do it for you instead of doing it via the links on the unRAID machine.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...