whichdisk - a tool to tell you on which disk your file is located


Recommended Posts

Occasionally, I need to know the actual disk a file is located on the share. This can be a pain having to check the location for every disk. So I wrote a script and thought I'd share it. Change the extension to sh and put it somewhere on your UnRAID system. I keep mine on the boot drive.

 

I recommend adding an alias to run this script. For example:

 

alias -p whichdisk=/boot/whichdisk.sh

 

Typing the above command in the shell will let you run the "whichdisk" command from any location.

 

Usage:

whichdisk /mnt/user/myshare/myfile.txt

 

Returns:

It exists at /mnt/disk3/myshare/myfile.txt

 

EDIT: Just a note about this. It searches disks 1-30, since UnRAID can have at most 30 drives in the array. There isn't really a way to enumerate the number of drives to future proof this script, or at least I haven't found one. So, should UnRAID change the maximum number of disks in the array, then this script would need a small update. It should be simple enough for the user to do this themselves; just open the script and change "30" to whatever the new maximum would be.

whichdisk.txt

Link to comment

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.