removable USB disk retain same share name

Got a feature request? Great! Post your ideas here!
Post Reply
daemonlord
Posts: 4
youtube meble na wymiar Warszawa
Joined: Fri Jul 22, 2016 4:12 pm

removable USB disk retain same share name

Post by daemonlord »

Hi,
Currently when I (re)connect a USB disk/stick the system automatically assigns a share name like USB1 or USB2 depending on the whether there is already a device attached.
I'm using scripts to write backups and versioning data to different USB devices attached to my AS602T. These scripts depend on the share name, fe Backups are written to \\storage_device\USB1 and Versioning is written to \\storage_device\USB2.
I need to connect the specific devices for backup and versioning in the correct order :First connect the backup disk so it gets the share name USB1 and then connect the Versioning disk so it gets the share name USB2.

Is it technically possible to create a share name depending on the USB device (serialnr whatsoever) so the device retains its share name? Then it wouldn't matter in which sequence I (re)connect USB devices, even when connecting extra USB disks/sticks (USB3, USB4 etc).

Kind regards,
Andy
sksbir
Posts: 395
Joined: Tue Aug 25, 2015 9:23 pm

Re: removable USB disk retain same share name

Post by sksbir »

Hello
Put an empty file or dir at root of your USB disks, and test the presence of this item in your script

Eg: lab_bckp_disk, lab_work_disk , lab_whatyouwant.....

Example in shell script :
ls /share/USB*/lab_bckp_disk : gives you the real path to your backup disk, and an error if not present
daemonlord
Posts: 4
Joined: Fri Jul 22, 2016 4:12 pm

Re: removable USB disk retain same share name

Post by daemonlord »

Thank you for your reply.

You are saying that it is technically not possible to give a USB device the same (or unique) share name?
That leaves me with a lot of scripting :-( or just manually insert USB devices in the correct sequence.

regards,
Andy
User avatar
orion
Posts: 3485
Joined: Wed May 29, 2013 11:09 am

Re: removable USB disk retain same share name

Post by orion »

I think it's a feasible feature. However, Sksbir just mentioned a easy workaround way in case that the feature is not implemented.
sksbir
Posts: 395
Joined: Tue Aug 25, 2015 9:23 pm

Re: removable USB disk retain same share name

Post by sksbir »

orion wrote:I think it's a feasible feature. However, Sksbir just mentioned a easy workaround way in case that the feature is not implemented.
Right :)
Sorry for my former response a little bit short, because written from a pad. :mrgreen:

under windows / command line, you should write a script like this:

Code: Select all

if exist \\NAS\share\USB1\lab_XXX goto ONUSB1
if exist \\NAS\share\USB2\lab_XXX goto ONUSB2
if exist \\NAS\share\USB3\lab_XXX goto ONUSB3
if exist \\NAS\share\USB4\lab_XXX goto ONUSB4
echo lab_XXX not mounted
goto END
:ONUSB1
set DVPATH=\\NAS\share\USB1
goto DEVOK
:ONUSB2
set DVPATH=\\NAS\share\USB2
goto DEVOK
:ONUSB3
set DVPATH=\\NAS\share\USB3
goto DEVOK
:ONUSB4
set DVPATH=\\NAS\share\USB4

:DEVOK
REM use %DVPATH%  ....
:END
daemonlord
Posts: 4
Joined: Fri Jul 22, 2016 4:12 pm

Re: removable USB disk retain same share name

Post by daemonlord »

Ok I hope Asustor will have a look at this and find some way to make it feasible.
In the meanwhile I will have a look at your script sksbir. Thanks for that.
Post Reply

Return to “Feature Requests”