add volume2 shortcut in volume1

Share your awesome tips and tricks here.

Moderator: Lillian.W@AST

GHAZALO
Posts: 18
youtube meble na wymiar Warszawa
Joined: Sat Nov 05, 2022 2:16 pm

add volume2 shortcut in volume1

Post by GHAZALO »

Dears

first sorry if this mentioned or solved in the forum before, and hope I am in the correct place to ask this trick or solution

I have 2 volume and I don't want to make them single pool: so the apps such as transmission , qbittorrent..etc read the path of volume1 and of course it can be changed to volume2 in access control but in that case will loose seeding in volume1

is there is a trick to place folder shortcut from volume2 inside volume1 so the apps can read it through volume1 of course in windows easy but when it come back to Asustor explorer it will not read the windows shortcut

of course the app that download and read all volumes and paths is Asustor Download Center but this app is massively failed app specially when it comes to DL/UL in the private trackers: the app shows you are downloading or you are seeding but: not a single byte downloaded or uploaded, so i change to qbittorrent and transmission where they read the paths in volume1 or any volume I choose but not both, of course I am open to any apps to try it, if it gives solution in using full speed for UL/DL in the torrent and use both volumes pathes

the device is : AS1104T so I suppose most of the good apps not there for a reason of price.

thanks and cheers
Image
User avatar
Nazar78
Posts: 2004
Joined: Wed Jul 17, 2019 10:21 pm
Location: Singapore
Contact:

Re: add volume2 shortcut in volume1

Post by Nazar78 »

Usually you could just configure the apps to read from multiple paths i.e. the shares mounted from both volumes, /share/folder1-volume1 and /share/folder2-volume2.

Or you could take a bind approach which is to mount a path from volume2 to volume1.

Code: Select all

sudo mkdir -p /share/folder1-volume1/folder2-volume2;
sudo mount --bind /share/folder2-volume2 /share/folder1-volume1/folder2-volume2;
AS5304T - 16GB DDR4 - ADM-OS modded on 2GB RAM
Internal:
- 4x10TB Toshiba RAID10 Ext4-Journal=Off
External 5 Bay USB3:
- 4x2TB Seagate modded RAID0 Btrfs-Compression
- 480GB Intel SSD for modded dm-cache (initramfs auto update patch) and Apps

When posting, consider checking the box "Notify me when a reply is posted" to get faster response
GHAZALO
Posts: 18
Joined: Sat Nov 05, 2022 2:16 pm

Re: add volume2 shortcut in volume1

Post by GHAZALO »

Nazar78 wrote:Usually you could just configure the apps to read from multiple paths i.e. the shares mounted from both volumes, /share/folder1-volume1 and /share/folder2-volume2.

Or you could take a bind approach which is to mount a path from volume2 to volume1.

Code: Select all

sudo mkdir -p /share/folder1-volume1/folder2-volume2;
sudo mount --bind /share/folder2-volume2 /share/folder1-volume1/folder2-volume2;
Thanks for replying
Please as I am very beginner in NAS world can you lead me to detailed process (tutorial) to follow step by step? all what I know is the normal GUI using

Both solutions seems nice if I am not mistaken
Solution 1 to make the apps read single folder where it contain shortcuts from v1&v2
Solution 2 to make shortcut for 1 into the other which I requested

Cheers
Image
User avatar
Nazar78
Posts: 2004
Joined: Wed Jul 17, 2019 10:21 pm
Location: Singapore
Contact:

Re: add volume2 shortcut in volume1

Post by Nazar78 »

NP.
Solution 1 to make the apps read single folder where it contain shortcuts from v1&v2
Don't be mistaken. What I meant was set the app to read multiple shares. Obviously this is not possible i.e. for transmission to set multiple watch folders. I'm referring to some other typical apps e.g. Plex by adding different shares from different volumes.
Solution 2 to make shortcut for 1 into the other which I requested
You can see many tutorials about this but the basic is the same and it's best to have a good understanding how Linux works, i.e. https://www.youtube.com/watch?v=n8I8qQsQNUc

For Linux based NAS like Asustor, you would just enable SSH access from the Asustor Portal -> Services -> Terminal. Refrain from enabling the EZ-Connect port forwarding unless you understand the high security risks.

Then using any terminal apps like Putty for Windows, SSH into the NAS: username@host-IP:port, where username is your user with admin privilege, host-IP is your NAS hostname or local IP or public IP (if you open SSH to the internet via EZ-connect or port forwarding) and SSH/SFTP/SCP port is default 22.

Then issue the previous commands, I'll add comments:

Code: Select all

# Sudo is to run commands using root.
# Mkdir is to create a folder, the -p switch is to create the subfolders if they don't exist.
sudo mkdir -p /share/folder1-volume1/folder2-volume2;

# Mount is to mount a physical disk, network or path to a specific location. Note this is not persistent, you'll have to redo on every boot, usually added to startup scripts. Search the forum how to add one.
sudo mount --bind /share/folder2-volume2 /share/folder1-volume1/folder2-volume2;
Actually to create a shortcut similar to Windows, is by using the `ln` command i.e. ln -s /path/target /path/link-name which is persistent just like Windows LNK but this will not work on situation like in a container where the other volume is not exposed within.
Almost all command lines have the help switch, -h or --help. Or detailed in man page a.k.a manual (there's no man-db in Asustor but you can just search on the net, i.e. man mount).
AS5304T - 16GB DDR4 - ADM-OS modded on 2GB RAM
Internal:
- 4x10TB Toshiba RAID10 Ext4-Journal=Off
External 5 Bay USB3:
- 4x2TB Seagate modded RAID0 Btrfs-Compression
- 480GB Intel SSD for modded dm-cache (initramfs auto update patch) and Apps

When posting, consider checking the box "Notify me when a reply is posted" to get faster response
GHAZALO
Posts: 18
Joined: Sat Nov 05, 2022 2:16 pm

Re: add volume2 shortcut in volume1

Post by GHAZALO »

thanks for explaining

in fact i did but i receive a permit not allowed or something similar I think the device need to be rooted and I am not into missing with it

thanks for all your effort
Attachments
Capture.JPG
Capture.JPG (87.57 KiB) Viewed 2260 times
Image
GHAZALO
Posts: 18
Joined: Sat Nov 05, 2022 2:16 pm

Re: add volume2 shortcut in volume1

Post by GHAZALO »

I tried also using the direct command as you said similar to Dos (windows) yet no result
Attachments
Capture.JPG
Capture.JPG (129.13 KiB) Viewed 2259 times
Image
User avatar
Nazar78
Posts: 2004
Joined: Wed Jul 17, 2019 10:21 pm
Location: Singapore
Contact:

Re: add volume2 shortcut in volume1

Post by Nazar78 »

Does the user GHAZALO belongs to the administrators group in the Access Control? Only that group can do privileged su/sudo commands. Or simply use the default admin user.
i think having easy way such as placing shared folder or path to 2 volume for some beginner is impossible i have to JBOT drives. beside as you said it is not for good I need to do it every start up that would be painful
It's quite easy after you understand the concept. You don't have to do it manually every start up, do it automatically using init scripts.

Create a simple script, using the vi command i.e.:

Code: Select all

sudo vi /usr/local/etc/init.d/S00custom-mount.sh
. You'll need to learn how to use vi, press i to insert new text, then when done, press escape then press :wq then enter (w is write to file and q is quit, search the net how to master this, there's also other command line editors like nano which you can install by using Entware in the Asustor App Central). Or install WinSCP for Windows (GUI based), where you can use SFTP to login, then create new file or edit using a good GUI editor that understands CR/LF i.e. Notepad++ (change to CR mode for Linux).

/usr/local/etc/init.d/S00custom-mount.sh contents:

Code: Select all

#!/bin/sh

# My first shell script.
# <- This denote comments.
# The first line of this file is called shebang, which is to run this script with the specified executables, in this case sh or shell. 

if [ "$1" = "start" ];then
    mkdir -p /share/Download/V2 /volume1/Download/V2
    mount --bind /share/V2 /share/Download/V2
    mount --bind /share/V2 /volume1/Download/V2
elif [ "$1" = "stop" ];then
    umount /share/Download/V2 /volume1/Download/V2
else
    echo "Usage: $0 <start|stop>"
    exit 1
fi

exit $?
Then set the script to executable:

Code: Select all

sudo chmod +x /usr/local/etc/init.d/S00custom-mount.sh
This script will run on every boot, before all the apps starts, which will also mount your binds automatically.
Below will ensure proper un-mount when the system reboot/shutdown else the path might get locked during reboot/shutdown.

Code: Select all

sudo ln -s /usr/local/etc/init.d/S00custom-mount.sh /usr/local/etc/init.d/K00custom-mount.sh
p.s.: /share/folder1-volume1 is an example, its the existing share that you already create.

Edited: I've edited the script slightly to work properly as init scripts, not just a simple shell script.
Last edited by Nazar78 on Mon Nov 07, 2022 2:25 am, edited 5 times in total.
AS5304T - 16GB DDR4 - ADM-OS modded on 2GB RAM
Internal:
- 4x10TB Toshiba RAID10 Ext4-Journal=Off
External 5 Bay USB3:
- 4x2TB Seagate modded RAID0 Btrfs-Compression
- 480GB Intel SSD for modded dm-cache (initramfs auto update patch) and Apps

When posting, consider checking the box "Notify me when a reply is posted" to get faster response
User avatar
Nazar78
Posts: 2004
Joined: Wed Jul 17, 2019 10:21 pm
Location: Singapore
Contact:

Re: add volume2 shortcut in volume1

Post by Nazar78 »

GHAZALO wrote:I tried also using the direct command as you said similar to Dos (windows) yet no result
After issuing the `ln` command it works but when you issue `cd` you're currently not in the correct `pwd ` (print working directory). Try giving the full path: `cd /volume2/V2/V2-ShortCut` (note unlike Windows, Linux is case-sensitive, foobar and FooBar are two different filenames or paths).

No worries it's common for beginners, just play around you'll get better with CLI (command line interface). Be careful though with certain commands like `rm -rf` (force remove files and folders recursively), always confirm again before issuing it or using it in a script especially startup scripts.
Last edited by Nazar78 on Sun Nov 06, 2022 3:02 am, edited 1 time in total.
AS5304T - 16GB DDR4 - ADM-OS modded on 2GB RAM
Internal:
- 4x10TB Toshiba RAID10 Ext4-Journal=Off
External 5 Bay USB3:
- 4x2TB Seagate modded RAID0 Btrfs-Compression
- 480GB Intel SSD for modded dm-cache (initramfs auto update patch) and Apps

When posting, consider checking the box "Notify me when a reply is posted" to get faster response
GHAZALO
Posts: 18
Joined: Sat Nov 05, 2022 2:16 pm

Re: add volume2 shortcut in volume1

Post by GHAZALO »

I am the Only user and yes I initialize the device with this user GHAZALO
yet not sure if there is system or other automatically created users
Attachments
Capture.JPG
Capture.JPG (68.92 KiB) Viewed 2254 times
Image
User avatar
Nazar78
Posts: 2004
Joined: Wed Jul 17, 2019 10:21 pm
Location: Singapore
Contact:

Re: add volume2 shortcut in volume1

Post by Nazar78 »

GHAZALO wrote:
Nazar78 wrote:Does the user GHAZALO belongs to the administrators group in the Access Control? Only that group can do privileged su/sudo commands. Or simply use the default admin user.
I am the Only user and yes I initialize the device with this user
yet not sure if there is system or other automatically created users
The error operation is not permitted only means that, the user doesn't have sudo access (doesn't belong to the admin group) or you've entered the wrong password.

You could try to change to the user root using:

Code: Select all

sudo su -
Screenshot 2022-11-06 030822.png
Screenshot 2022-11-06 030822.png (24.8 KiB) Viewed 2254 times
Go to the Access Control panel to determine this user is in the admin group, you can also change the default admin password and use it to login. IIRC when I first got my NAS, the default it admin, not sure about now but if you can control the NAS using this user then probably it's already admin? Not sure you'll need to check.
AS5304T - 16GB DDR4 - ADM-OS modded on 2GB RAM
Internal:
- 4x10TB Toshiba RAID10 Ext4-Journal=Off
External 5 Bay USB3:
- 4x2TB Seagate modded RAID0 Btrfs-Compression
- 480GB Intel SSD for modded dm-cache (initramfs auto update patch) and Apps

When posting, consider checking the box "Notify me when a reply is posted" to get faster response
Post Reply

Return to “Tips & Tricks”