Jump to content
erikatcuse

One Share name for all disks

30 posts in this topic Last Reply

Recommended Posts

Taken from the request page

 

You can get much of the functionality you are looking for by creating a single folder ( a directory under Linux ) and then placing in it symbolic links to the other disks in your unRaid array.  Then, you can mount the one disk with that folder and get to all your content via a single "drive letter" under windows.

 


cd /mnt/disk1 
mkdir disks 
ln -s /mnt/disk1 disks
ln -s /mnt/disk2 disks 
ln -s /mnt/disk3 disks 
ln -s /mnt/disk4 disks 
ln -s /mnt/disk5 disks 
ln -s /mnt/disk6 disks 
ln -s /mnt/disk7 disks 
ln -s /mnt/disk8 disks 
ln -s /mnt/disk9 disks 
ln -s /mnt/disk10 disks 
ln -s /mnt/disk11 disks 

 

 

Now, a listing of the disk1 drive from a windows based machine will show a sub-folder named disks, and in it will be sub-folders for disk1, 2,3, 4, etc.

 

This might make it a lot easier for some of the media software as it will only need to deal with one drive letter in windows (the drive letter for disk1 can get to all the data on all the data drives through the sub-folder).

 

Joe L.

   

unless you delete the new directory or symbolic links, they will still be there after a reboot.  You need only type those commands I gave once.  The new folder and the symbolic links are on /mnt/disk1 and protected by the unRaid array  Grin They should survive almost anything except an explicit "rm" command.

 

So...  no need for any new lines in the "go" script.

 

Each sub-folder in this new "disks" folder still represents a physical disk, and its own storage... so you can fill each in turn under your control. You cannot "span" disks with a single file.  So if you have two disks each with 2Gig free space you cannot create a new 4Gig file.  You can create two 2Gig files, one on each physical disk.  In other words, you can run out of space in one sub-folder (one physical disk) and still have space in other sub-folders (other physical disks)

 

 

Share this post


Link to post

Taken from the request page

 

You can get much of the functionality you are looking for by creating a single folder ( a directory under Linux ) and then placing in it symbolic links to the other disks in your unRaid array.  Then, you can mount the one disk with that folder and get to all your content via a single "drive letter" under windows.

 


cd /mnt/disk1 
mkdir disks 
ln -s /mnt/disk1 disks
ln -s /mnt/disk2 disks 
ln -s /mnt/disk3 disks 
ln -s /mnt/disk4 disks 
ln -s /mnt/disk5 disks 
ln -s /mnt/disk6 disks 
ln -s /mnt/disk7 disks 
ln -s /mnt/disk8 disks 
ln -s /mnt/disk9 disks 
ln -s /mnt/disk10 disks 
ln -s /mnt/disk11 disks 

 

 

Now, a listing of the disk1 drive from a windows based machine will show a sub-folder named disks, and in it will be sub-folders for disk1, 2,3, 4, etc.

 

This might make it a lot easier for some of the media software as it will only need to deal with one drive letter in windows (the drive letter for disk1 can get to all the data on all the data drives through the sub-folder).

 

Joe L.

   

unless you delete the new directory or symbolic links, they will still be there after a reboot.  You need only type those commands I gave once.  The new folder and the symbolic links are on /mnt/disk1 and protected by the unRaid array  Grin They should survive almost anything except an explicit "rm" command.

 

So...  no need for any new lines in the "go" script.

 

Each sub-folder in this new "disks" folder still represents a physical disk, and its own storage... so you can fill each in turn under your control. You cannot "span" disks with a single file.  So if you have two disks each with 2Gig free space you cannot create a new 4Gig file.  You can create two 2Gig files, one on each physical disk.  In other words, you can run out of space in one sub-folder (one physical disk) and still have space in other sub-folders (other physical disks)

 

 

 

Hi

Ordering my starter set here soon. New at linux commands but basically i could do the following, and it will work?

 

cd /mnt /disk1

mkdir movies

 

ln -s /mnt/disk1 movies

ln -s /mnt/disk2 movies

ln -s /mnt/disk3 movies

 

mkdir tvshows

ln -s /mnt/disk4 tvshows

ln -s /mnt/disk5 tvshows

ln -s /mnt/disk6 tvshows

 

mkdir music

ln -s /mnt/disk7 music

 

 

windows would see these as 3 windows shared folders:

 

'movies' would contain files in disk 1, 2, and 3

'tvshows' would contain files in disk 4, 5, and 6

'music' would contain files in disk 7

 

 

will this work or is the disk1 in "cd /mnt/disk1" not able to span to more than one set of sub directories (E.G. 'movies') as this was the first set of disks i set the command for?

 

thanks!!

Share this post


Link to post

after running the commands you listed you would see the following as viewed from your windows machine

 

You would still see network shares from the unRaid tower for disk1, disk2, disk3, disk4, disk5, etc...

 

If you map //tower/disk1 to a drive on your windows PC, let's say drive "S" and then used windows file explorer to look in drive "S" you would see three folders.  The three folders would be  movies, tvshows, and music.

 

In the movies folder would be three sub-folders, disk1, disk2, and disk3

In the tvshows folder would be three sub-folders, disk4, disk5, and disk7

In the music folder would be one sub-folder disk7.

 

In each of the sub-folders you would see the files and folders on that disk.  Yes, in the movies\disk1 folder you would find a movies folder and in it a disk1 folder and in it a movies folder and in it a disk1 folder, etc. This might confuse some software attempting to scan all the sub-folders. In this case, if it had no limit on the sub-directory tree depth it might scan forever.  If this is the case you might need to leave disk1 out of the movies/tvshows/music folders (assuming they were created on disk1) to prevent from creating a loop in the file structure that might catch an unaware program on your pc doing a scan in an endless loop.

 

Also in drive "S" you would see all the files stored on disk1.  So if you stored movies on it they would show at the root of the "S" drive as well as in the movies\disk1 folder.

 

To keep from seeing the other files at the root of the drive "S" I would do this

 

cd /mnt/disk1

mkdir sharedfolders

mkdir sharedfolders/movies

mkdir sharedfolders/tvshows

mkdir sharedfolders/music

 

Then make the symbolic links to the others disks as you described:

ln -s /mnt/disk2 sharedfolders/movies

ln -s /mnt/disk3 sharedfolders/movies

ln -s /mnt/disk4 sharedfolders/movies

 

ln -s /mnt/disk5 sharedfolders/tvshows

ln -s /mnt/disk7 sharedfolders/tvshows

 

ln -s /mnt/disk8 sharedfolders/music

 

Now, from windows map a new shared drive "S" from \\tower\disk1\sharedfolders

 

It will now have in it the folders for movies, tvshows, and music and each of those in turn folders for disk2, disk3, disk4, etc

(note this time I left out disk1 to keep from creating an endless loop in the directory sub-tree)

 

Lots of possibilities exist.  Just remember a link to a folder is just that a subsequent pointer to the same data stored on a disk.  The data blocks holding your movie will be freed when the last link to them is removed.  If you modify the data in a file through a link it will be modified exactly as if you modified it via the name it was created.  The data blocks are the same.

 

Joe L.

 

Share this post


Link to post

Joe,

 

Although I am not entirely sure I know what this all means until I get the system up can apply this method, I would like to say, thanks! in anticipation :)

 

needless to say, the starter set is being ordered today...

 

Thanks

 

Share this post


Link to post

Sort of related... Would it be possible to have 1 shared folder contain all the contents of a specific disks folders?  The ultimate goal would be to have a share called allmovies, which contains the contents of a MOVIES folder which exists on each drive.

 

The mapped drive would simply yeild a complete list of all the contents of all movies folder of each drive.

 

See, sort of related :)

 

Thanks,

Aaron

Share this post


Link to post
Would it be possible to have 1 shared folder contain all the contents of a specific disks folders?  The ultimate goal would be to have a share called allmovies, which contains the contents of a MOVIES folder which exists on each drive.
Aaron,

Sure, the symbolic link command "ln -s" can be used to make a link to a directory at the top of a directory tree (as I showed in prior examples) or to individual files or subdirectories.

 

So if you had /mnt/disk1/"Dirty Dancing.iso" and /mnt/disk1/"King Kong.iso" and /mnt/disk3/"The Haunting.iso" you could do this"

 

mkdir /mnt/disk1/allmovies

 

ln -s /mnt/disk1/"Dirty Dancing.iso" /mnt/disk1/allmovies/"Dirty Dancing.iso"

ln -s /mnt/disk1/""King Kong.iso" /mnt/disk1/allmovies/""King Kong.iso"

ln -s /mnt/disk3/"The Haunting.iso" /mnt/disk1/allmovies/"The Haunting.iso"

 

Now you could browse the "allmovies" folder and see the three movies.

 

Think of these "links" as being nearly identical to the "shortcuts" on windows.  In this post http://lime-technology.com/forum/index.php?topic=112.msg606#msg606 Tom describes a batch program he uses to make windows shortcuts to all the movies on his server.  A benefit of this is that the windows box does not have to wait for the unRaid server disks to spin up to read the list of available movies.  Of course, once he selects a movie the disk it is on must spin up so it can play, but the other disks can stay spun down.

 

Lots of ways to solve the same problem.  Tom's solution works if you are using a media center PC to play your movies, the solution I described in this post might work if you are using a networked DVD player (where you cannot create "shortcuts")

 

Joe L.

 

 

 

 

Share this post


Link to post

Ah, that's a very viable solution.  At first it appears very daunting to have to do 200+ ISO's, but if there's a batch script, very cool!

 

I really appreciate the feedback.

Share this post


Link to post

Is there a way to make symbolic links in linux, like shortcuts in windows? This way if the files, say VOBs, "overflow" into another drive the links would in theory keep a clear directory structure and one would not loose gigs of space.

Share this post


Link to post

Hello,

 

I used these commands -

 

cd /mnt/disk1

mkdir disks

ln -s /mnt/disk1 disks

ln -s /mnt/disk2 disks

ln -s /mnt/disk3 disks

ln -s /mnt/disk4 disks

ln -s /mnt/disk5 disks

ln -s /mnt/disk6 disks

ln -s /mnt/disk7 disks

ln -s /mnt/disk8 disks

ln -s /mnt/disk9 disks

ln -s /mnt/disk10 disks

ln -s /mnt/disk11 disks

 

 

from the 1st post here -

 

i am soon upgrading and do not want the disks folder i created to show - how would i get rid of this via command?

 

thanks

 

 

Share this post


Link to post

I've been trying to work out a way to get symbolic links to the user share folders.

 

<snip>

 

To keep from seeing the other files at the root of the drive "S" I would do this

 

cd /mnt/disk1

mkdir sharedfolders

mkdir sharedfolders/movies

mkdir sharedfolders/tvshows

mkdir sharedfolders/music

 

Then make the symbolic links to the others disks as you described:

ln -s /mnt/disk2 sharedfolders/movies

ln -s /mnt/disk3 sharedfolders/movies

ln -s /mnt/disk4 sharedfolders/movies

 

ln -s /mnt/disk5 sharedfolders/tvshows

ln -s /mnt/disk7 sharedfolders/tvshows

 

ln -s /mnt/disk8 sharedfolders/music

 

Now, from windows map a new shared drive "S" from \\tower\disk1\sharedfolders

 

It will now have in it the folders for movies, tvshows, and music and each of those in turn folders for disk2, disk3, disk4, etc

(note this time I left out disk1 to keep from creating an endless loop in the directory sub-tree)

 

<snip>

 

I have a just bought a media player that has a very limited number of share points (4 total).  As I have 3 UnRaids (and other PC locations) this limits me somewhat and I'd like to create a single share point per UnRaid if possible. 

I have a few questions...

 

1/ Regarding the possibility of an endless loop.. I can see how that could happen.  Could the folder containing the symbolic links be stored on the USB key this way there couldn't be an endless loop of content? or would that slow streaming access to USB levels?

 

2/ Would it be possible to create a symbolic link to a user share?  I have MANY disks in my unraid machines and I would prefer it if the list of movies, music etc. was not sub-divided into the disk location subfolders.

 

3/ Can symbolic links span different machines on the network?  Tower1, Tower2 & Tower2 for example?

 

I'd like to create a folder called "media", hopefully on the USB key, and under that have:-

 

media/dvd

media/recordedtv

media/podcasts

media/losslessmusic/

media/musicvideos

media/karaoke

etc. with all the sub folders being user shares

 

That way I can link to the "media" folder from the remote box and keep the content divided into the relevant categories without the Disk sub-folders.

 

Is this possible?

 

Also...

 

4/ The manual for my new mediaplayer box offers NFS share and SAMBA share options.  Are NFS share supported on UnRaid?

 

Thanks,

 

Mark.

Share this post


Link to post

As a test I tried:-

 

cd /boot

mkdir media

cd media

mkdir dvd

mkdir hidef

mkdir music

 

ln -s /mnt/user/dvd /boot/media/dvd

 

and got:-

 

"creating symbolic link `/boot/media/dvd/dvd' to `/mnt/user/dvd': Operation not permitted

 

So apparently that can't work  :(

 

Now if symbolic links can span the network I could potentially get around the endless loop problem by storing the symbolic links for each "media" folder on a different unraid machine I guess?

 

//tower1/disk1/media contains links to //tower2 user shares

//tower2/disk1/media contains links to //tower3 user shares

etc.

 

Could this be a solution?  It's not ideal but I don't have a Disk in any of my UnRaids that doesn't contain files I need included in the symbolic link.

 

Thanks,

 

Mark.

Share this post


Link to post

Actually, I was thinking... I have 1gb of Ram in my servers.  How difficult would it be to configure a ramdisk to contain the folder with the symbollic lnks?

 

Thanks,

 

Mark.

Share this post


Link to post

Sort of related... Would it be possible to have 1 shared folder contain all the contents of a specific disks folders?  The ultimate goal would be to have a share called allmovies, which contains the contents of a MOVIES folder which exists on each drive.

 

The mapped drive would simply yeild a complete list of all the contents of all movies folder of each drive.

 

Could you just map a network drive to a user share

 

In my case I'm limited because I need my media player to see a single ahare point for ALL MEDIA TYPES.  After some trial & error I've got this sorted with the user shares in a way I'm VERY happy with:-

 

 

How to create a single share point that contains all the user shares you require

 

Make a note of which user shares you want under the single network share, in this example I want to use the user shares "dvd", "tv" & "hidef"

 

You can list your user shares by connecting to the UnRaid server via telnet (user name: root <-- I know you know but some people don't  ;))

 

and typing:-

 

ls -l /mnt/user  <-- That's a small "L" not a capital "i" ;)

 

Then you can create symbolic links (Linux equivalent of shortcuts) to them.  In this example I've decided to create a folder called "media" to hold my shortcuts:-

 

mkdir /mnt/disk1/media

ln -s /mnt/user/dvd  /mnt/disk1/media

ln -s /mnt/user/tv  /mnt/disk1/media

ln -s /mnt/user/hidef  /mnt/disk1/media

 

Now from your PC you can browse to //tower/disk1/media and map a network drive.  The "media" folder will hold the subfolders containing all the user shares you have specified.

 

On my TViX box you can't map to a root directory, so for that I simply mapped M: to //tower/disk1/ and specified the path on the TVix Box as "M:\media".  It worked a treat!

 

If there is a way to combine the contents of all the folders you specify on your UnRaid into 1 single list I'd also love that, but I can't work out how to do it.  As mentioned earlier please be careful not to create an "endless loop.  An example wheere this could occur may be:-

 

/mnt/disk1/ holds a folder called "Media"

/mnt/disk1/media contains a shortcut to /mnt/disk1/... which holds the folder called Media that contains the shortcut to disk1 etc.etc.

 

Hope this helps,

 

Mark.

Share this post


Link to post

If there is a way to combine the contents of all the folders you specify on your UnRaid into 1 single list I'd also love that, but I can't work out how to do it.  As mentioned earlier please be careful not to create an "endless loop.  An example where this could occur may be:-

 

/mnt/disk1/ holds a folder called "Media"

/mnt/disk1/media contains a shortcut to /mnt/disk1/... which holds the folder called Media that contains the shortcut to disk1 etc.etc.

 

Hope this helps,

 

Mark.

If you create an endless loop in your folders, your media scans will take a really long (infinite) time.  Now, it will be scan that loop of folders really fast with today's faster disks and processors, but it might still seem to take forever to finish  ;D

Share this post


Link to post

Am i correct in thinking that this post is exactly what "user shares" are in the latest versions?

 

Jon

Share this post


Link to post

You are correct.  At the time I wrote how to make symbolic links to the other disks the "users shares" did not exist.

 

Joe L.

Share this post


Link to post

I think my tower might be in one of the endless loops described above.

 

I have a user share named 'Movies' on disk3, disk5, disk6, disk7, disk8

 

disk3/Movies was used as a folder to have symbolic links to disk5, disk6, disk7, disk8 and I recently discovered user shares.

 

I wanted to remove the folder disk3/Movies and create a symbolic link to the user share 'Movies'. So I removed the symbolic links to the other 4 discs and deleted the folder disk3/Movies.

 

I then typed in "ln -s /mnt/user/movies /mnt/disk3/Movies

 

This was about 3 hours ago and my server became unresponsive. I restarted the server and I can get to the web interface and see the 'Starting...' message and the read count for all the hard drives going up when I refresh.

 

I can now access the shares and telnet properly but the web interface still says 'Starting...' and will not let me edit anything.

 

How do I cancel this symbolic link or get my server back?

 

You seem to have re-discovered that infinite loops still seem to take forever to complete, even with today's faster CPUs.  ;)

 

I would say your best bet would be to disable user shares, then remove the link you created, then re-enable the user-shares.

 

You can kill user shares by the following command

killall shfs

 

You can then remove the link you created (but be careful here...)

first change directory to /mnt/disk3

do an ls -l Movies and see if it is a symbolic link.   If it is, it will have a "->" pointing to the actual directory.

If it is a symbolic link, you can just use the rm command to remove it.

if Movies is a symbolic link a simple

rm Movies

will delete it.

 

Then, after you clean up the link, you can re-start user shares with:

/usr/local/sbin/shfs /mnt/user

 

Good luck..

 

Joe L.

Share this post


Link to post

Thank you for the help Joe. I did what you suggested earlier without killall shfs and then restarted.

 

My tower is still running through the loop and now when I run ls -l Movies in /mnt/disk3 I receive total 0.

 

The bright side is that I can access the shares still, but the web interface is still 'Starting...'

Share this post


Link to post

Thank you for the help Joe. I did what you suggested earlier without killall shfs and then restarted.

 

My tower is still running through the loop and now when I run ls -l Movies in /mnt/disk3 I receive total 0.

 

The bright side is that I can access the shares still, but the web interface is still 'Starting...'

The odds are the "Movies" directory is still a link to /mnt/user/movies, so it looks empty.

 

Did you have movie files in the /mnt/disk3/Movies folder before you created the symbolic link?

 

Joe L.

Share this post


Link to post

Yes, I had a folder /disk3/Movies which contained symbolic links to the other drives with movies (this was created before user shares)

Share this post


Link to post

Yes, I had a folder /disk3/Movies which contained symbolic links to the other drives with movies (this was created before user shares)

You will probably need to cd /mnt/disk3/Movies and then remove the symbolic links in it to the other drives.

 

Joe L.

Share this post


Link to post

That was the first thing I did.

 

I removed the symbolic links in the /disk3/Movies folder and then I deleted it.

 

My next step was to run

ln -s /mnt/user/Movies /mnt/disk3/

 

I did not receive a message when I typed this in. The problem was that I could not access my shares any longer. I rebooted the machine and typed in

rm /mnt/disk3/Movies

 

The shares became available sometime before or after I typed in the previous command but definitely after I rebooted.

Share this post


Link to post

I've been relying on the dir command to see if there is a Movies folder in /mnt/disk3 and it has not shown up with a Movies folder.

 

I just tried to cd /mnt/disk3/Movies and found out that it still thought there was a physical Movies folder there. I ran rm -r Movies

 

It doesnt appear to have changed much though. I still can access my disks and cannot access the web interface

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.