add volume2 shortcut in volume1

Share your awesome tips and tricks here.
GHAZALO
Posts: 23
youtube meble na wymiar Warszawa
Joined: Sat Nov 05, 2022 2:16 pm

Re: add volume2 shortcut in volume1

Post by GHAZALO »

Nazar78 wrote:I've edited the script slightly to work properly as init scripts, not just a simple shell script.

Edited: Note it will run as root at startup hence no need for sudo but you'll need to do one time command(s) to set the mounted target directory's ownership (using chown) and permission (chmod) depending on the apps and users accessing, else normal users can't access it, those depends how you manage your system and data.
i will check tomorrow thanks a lot, as it is late night
yet i need to solve the admin issue
also please folder1 is the shortcut or the directory will be in ?
GHAZALO
Posts: 23
Joined: Sat Nov 05, 2022 2:16 pm

Re: add volume2 shortcut in volume1

Post by GHAZALO »

Nazar78 wrote:Use the shares points created, don't use volume points you will not see it in shares only volume paths as the shares are mounted on the /share path.

Code: Select all

sudo mkdir -p /share/Download/V2-Download;

sudo mount --bind /share/V2 /share/Download/V2-Download;
If that works, copy to the script but remove the sudo as the init scripts will run as root. Read that post again as I've edited.

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-Download;
    mount --bind /share/V2 /share/Download/V2-Download;
fi
I just need to do the vi stuff, right?
User avatar
Nazar78
Posts: 2235
Joined: Wed Jul 17, 2019 10:21 pm
Location: Singapore

Re: add volume2 shortcut in volume1

Post by Nazar78 »

GHAZALO wrote:
Nazar78 wrote:I've edited the script slightly to work properly as init scripts, not just a simple shell script.

Edited: Note it will run as root at startup hence no need for sudo but you'll need to do one time command(s) to set the mounted target directory's ownership (using chown) and permission (chmod) depending on the apps and users accessing, else normal users can't access it, those depends how you manage your system and data.
i will check tomorrow thanks a lot, as it is late night
yet i need to solve the admin issue
Note this "/share/V2" must already exists in your ADM portal shares list.
also please folder1 is the shortcut or the directory will be in ?
I don't understand this question, there's no shortcut file in bind mounts.

The mount command has the same sequence as the ln command, <command> <target-source> <target-name>. E.g. you want to bind mount /share/my-volume2-files in /share/Download/my-volume2-files. Again note "/share/my-volume2-files" is an existing volume2 share you already created in the ADM portal, then you want to mount it to "/share/Download/my-volume2-files" so your apps scan access it from "/share/Download".
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: 2235
Joined: Wed Jul 17, 2019 10:21 pm
Location: Singapore

Re: add volume2 shortcut in volume1

Post by Nazar78 »

GHAZALO wrote:
Nazar78 wrote:Use the shares points created, don't use volume points you will not see it in shares only volume paths as the shares are mounted on the /share path.

Code: Select all

sudo mkdir -p /share/Download/V2-Download;

sudo mount --bind /share/V2 /share/Download/V2-Download;
If that works, copy to the script but remove the sudo as the init scripts will run as root. Read that post again as I've edited.

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-Download;
    mount --bind /share/V2 /share/Download/V2-Download;
fi
I just need to do the vi stuff, right?
vi and `chmod +x /volume1/.@plugins/etc/init.d/custom.sh` to make the script executable.

p.s.: Since you're not very familiar with Linux, you should disable back the admin user after testing and all works as you intended. Asustor now recommends to disable it due to the recent ransomware saga unless of course you know what you're doing and how to protect your network.
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: 23
Joined: Sat Nov 05, 2022 2:16 pm

Re: add volume2 shortcut in volume1

Post by GHAZALO »

hello dear hope u had a great night

following to our discussion i created folder under Download but the folder doesn't reflect the content or not behave accoreding to (volume2/V2) look at the photo the content of the folders different

now 2 things as i give up and this is not what i was looking for
1-how to delete this mounted (from the panel not accepted)
2-how to reverse the admin thing root@xxxx

thanks and i will keep looking for different solutions but not this mounting, the volume2/V2 has data need to bee seeded in transmission or qbittorrent as well as the volume1/Download

thanks again and appreciate all your effort
You do not have the required permissions to view the files attached to this post.
User avatar
Nazar78
Posts: 2235
Joined: Wed Jul 17, 2019 10:21 pm
Location: Singapore

Re: add volume2 shortcut in volume1

Post by Nazar78 »

Probably you didn't do it correctly. You're free now? Let's do a quick remote session I'll show you how to do it easily. We can do this in Google RD or AnyDesk or TeamViewer or anything, you choose just PM me your ID.

To revert, use the `umount /path` command then remove the created directory. Ensure nothing is using the path. Then disable SSH and your admin account.
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: 23
Joined: Sat Nov 05, 2022 2:16 pm

Re: add volume2 shortcut in volume1

Post by GHAZALO »

in fact there is few folders appears in windows i think i created them with ln command

Code: Select all

ln -s /volume1/Download /volume2/V2/ShortCut
how to remove? even windows couldn't delete them

the others (created by sudo) i just restarted the device then from inside the panel deleted normally

thanks man i dropped you message late after and i think you get busy
any way i am going different approach to Jbot all drives
for sorrow such nice machine has a very bad download center other wise the problem is not there at all
Last edited by GHAZALO on Mon Nov 07, 2022 12:33 am, edited 1 time in total.
User avatar
Nazar78
Posts: 2235
Joined: Wed Jul 17, 2019 10:21 pm
Location: Singapore

Re: add volume2 shortcut in volume1

Post by Nazar78 »

You can't delete those links probably its created using root and only writable to root? Then only root can delete them `sudo rm /path/filename`.

Was my movie time, we can do it now, I have a couple of hours before bed time.
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: 23
Joined: Sat Nov 05, 2022 2:16 pm

Re: add volume2 shortcut in volume1

Post by GHAZALO »

i guess you made it

thank you man and really appreciate your efforts
User avatar
Nazar78
Posts: 2235
Joined: Wed Jul 17, 2019 10:21 pm
Location: Singapore

Re: add volume2 shortcut in volume1

Post by Nazar78 »

NP enjoy, yesterday I was texting from my mobile phone so I made it simple but now that I'm in front of my workstation, I've edited the earlier posted script sample to reflect your config I see on your NAS.
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