NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
eton
Apr 15, 2023Luminary
Making a folder appear as a volume in OS 6 GUI?
If a folder is created via SSH under /data/ like /data/New-folder, it will not appear as a normal share in ReadyNAS OS 6's web GUI. What needs to be edited to make that folder become a normal share? ...
StephenB
Apr 20, 2023Guru - Experienced User
tigerten wrote:
you can create volume under SSH for ReadyDATA. I would assume possible with ReadyNAS as well.
Yes.
Netgear has a utility called rnutil. It has quite a few "personalities"
event_push push a system event to the UI
get_disk_info print a list of all attached disks and disk information
check_ups_drv check and possibly start network ups drivers
rn_shutdown shutdown readynasd and system gracefully
rn_lcd LCD display
remote_access start a remote access session for tech support
volume_util perform volume operations
mkhomedir_helper home subvolume creator for PAM
disk_event_handler handler for disk events
hotplug_event notifier for hotplug events
md_event notifier for MD RAID events
start_raids start all MD RAID arrays
volume_schedule start volume schedule job
spindown_schedule start spindown schedule job
backup_md backup MD RAID superblocks
bit_rot_event bit rot events
firmware_update check for firmware update
apt_wait Wait for an APT lock to release
create_system_log Create system log archive
diagnostics Run system diagnostics
blink Locate the NAS with LEDs
bluetooth_event Bluetooth events
dump_sysflags List systype flags or check if flag is set for system
clamav_event ClamAV events
antivirus_scan_rootfscan antivirus in rootfs
The personality is determined by the executable file name. For instance, /usr/bin/volume_util is a link to rnutil, and when you execute the link you can run the volume_util command set. (you can alternatively run rnutil volume_util directly).
The volume_util commands are:
root@NAS:~# volume_util help
Usage: volume_util [-c NAME] [-c NAME D1,..,DN] [-c NAME LEVEL D1,..,DN]
[-c NAME LEVEL D1,..,DN KEY_FILE] [-d NAME|UUID]
[-x NAME|UUID] [-e] [-e TYPE] [-v NAME LEVEL D1,...,DN]
[-f NAME DISK] [-S DISK] [-F DISK] [-s TYPE..]
-c Create pool
NAME is the desired pool name
LEVEL is the desired RAID level (0,1,5,6,10)
D1,..,DN is the list of disk channels to use, zero-based
you may specify the disk by controller and channel, so
'0,1' means chassis 0, channels 0 and 1
'1:3,1:4' means chassis 1, channels 3 and 4
if you do not specify any channels, all available channels will be used
KEY_FILE is the encryption key passphrase file for encrypted volumes
-d Delete pool
NAME is the desired pool name
UUID is the UUID of the desired pool
-x Export pool
NAME is the desired pool name
UUID is the UUID of the desired pool
-e Expand pool
TYPE is one of 'auto', 'expand', 'extend', or 'xraid'
auto - automatically do all forms of expansion
expand - expand to fill all space on all current disks (disk replacement)
extend - extend pool to use available new disks (disk addition)
xraid - grow pool to use available space on some current disks
(partial disk replacement)
-f Flex-RAID add parity
NAME is the desired pool name
D1,..,DN is the list of disk channels to use, zero-based
you may specify the disk by controller and channel, so
'0,1' means chassis 0, channels 0 and 1
'1:3,1:4' means chassis 1, channels 3 and 4
-E Flex-RAID expand
NAME is the desired pool name
D1,..,DN is the list of disk channels to use, zero-based
you may specify the disk by controller and channel, so
'0,1' means chassis 0, channels 0 and 1
'1:3,1:4' means chassis 1, channels 3 and 4
-v Vdev expand pool
NAME is the desired pool name
LEVEL is the desired RAID level (0,1,5,6,10)
D1,..,DN is the list of disk channels to use, zero-based
you may specify the disk by controller and channel, so
'0,1' means chassis 0, channels 0 and 1
'1:3,1:4' means chassis 1, channels 3 and 4
-S Make a disk a hot spare
DISK is the disk channel to use, zero-based
-F Format disk
DISK is the disk channel to use, zero-based
-r Automatically repair degraded pools
-O Forcibly optimize swap array
-s Show volume information
TYPE is any combination of 'disk', 'raid', 'pool', or 'enclosure'
separated by a space so '-s disk raid' would show disks and raids
What rnutil doesn't seem to have is a mechanism to create a public share.You can create a home folder for a user account with rnutil mkhomedir_helper - which is a specialized share, but not public.
root@NAS:~# mkhomedir_helper
Usage: mkhomedir_helper <username>
root@NAS:~#
There possibly could be some other tool that can create a public share, but I don't know what it is.
As Sandshark says, there is a repair script that Netgear support uses that might give you more clues.
If you download it to the NAS with wget, you will need to add the --no-check-certificate option.
eton
Apr 20, 2023Luminary
Thanks StephenB!
Interesting command: rnutil, but I have never before encountered arguments being named personalities. Although the arguments in this case are sub programs.
I browsed through script, but could not find how a new share was made available in the web admin:
https://gitlab.codycook.us/readynas-scripts/share_lun_ui_fix.sh/-/blob/master/share_lun_ui_fix.sh
And there we had a real engineer at Netgear: Cody Cook https://codycook.us/#resume
- StephenBApr 20, 2023Guru - Experienced User
eton wrote:
I browsed through script, but could not find how a new share was made available in the web admin:
It appears to be rebuilding config files in /volume/._shares/sharename
Looking at one of my shares, these are the files needed
root@NAS:/data/._share/Backup# ls -als total 44 0 drwxr-xr-x 1 root root 324 Apr 20 11:00 . 0 drwxr-xr-x 1 root root 482 Feb 28 16:41 .. 4 -rw-r--r-- 1 admin admin 179 Feb 28 16:41 afp.conf 4 -rw-r--r-- 1 admin admin 116 Apr 20 11:00 custom_snapshot_management.conf 4 -rw-r--r-- 1 admin admin 175 Apr 20 11:00 custom_snapshot_schedule.conf 4 -rw-r--r-- 1 root root 6 Feb 28 16:41 datasettype.conf 4 -rw-r--r-- 1 admin admin 65 Sep 23 2018 fs.conf 4 -rw-r--r-- 1 admin admin 113 Feb 28 16:41 ftp.conf 4 -rw-r--r-- 1 admin admin 110 Feb 28 16:41 nfs.conf 0 drwxr-xr-x 1 admin admin 2 Feb 22 2021 .pvcache 4 -rw-r--r-- 1 root root 8 Feb 28 16:41 recycle.conf 4 -rw-r--r-- 1 admin admin 138 Feb 28 16:41 samba.conf 4 -rw-r--r-- 1 root root 1 Feb 28 16:41 snapdir.conf 4 -rw-r--r-- 1 root root 14 Apr 20 11:00 snapshot.conf root@NAS:/data/._share/Backup#Not sure if that is all that is needed, but it is a start.
- etonApr 20, 2023Luminary
Yes, I know that each share has got settings in a hidden directory. In my case: /data/._share/{ShareName}
I copied settings from a share I made via web admin to my test share (created via CLI). But it still does not show up in web admin. Not even after reboot.
- etonApr 20, 2023Luminary
I think I have found where web admin stores shares info:
sqlite3 --header --column /var/readynasd/db.sq3 'select * from "share"' sqlite3 --header --column /var/readynasd/db.sq3 'select id,zfs_name,type,name,path from "share" Order by name' sqlite3 --header --column --separator "|" --list /var/readynasd/db.sq3 'select id,zfs_name,type,name,path from "share" Order by name' | column -t -s "|"And there are more database files in /var/readynasd/
# ls -lA /var/readynasd/ total 12384 -rw-r----- 1 root admin 8212480 Apr 20 21:16 db.sq3 -rw-r--r-- 1 root root 16384 Apr 20 21:26 event.sq3 -rw-r--r-- 1 root admin 131 Sep 27 2022 .flash_update_info -rw-r--r-- 1 root root 4406801 Apr 20 21:31 loadavg.dat -rw-r--r-- 1 root root 42 May 9 2020 .localsid -rw-r--r-- 1 root root 1589 Apr 18 22:11 pilgrim.list -rw-r--r-- 1 root root 8192 May 9 2020 smart.sq3 drwxr-xr-x 1 root root 168 May 9 2020 stats -rw-r--r-- 1 root root 7 Sep 27 2022 .update_from -rw-r--r-- 1 root root 15001 Apr 20 21:16 usage.datThe sq3 files are related to readynasd.Restart with systemctl restart readynasd
- SandsharkApr 21, 2023Sensei
If you aren't willing/able to create the share via the GUI, I don't know why you care that the share be visible in it. Studying that script told me a lot about the "under the hood" workings of a ReadyNAS share. But since the share is intended to find "lost" shares and make them visible to the GUI, I believe it should do the same with your share created via the back door,
- etonApr 21, 2023Luminary
Sandshark I am doing this out of curiosity. I am fine with creating new share via gui, but would like to know how to do it via cli. And it gets extra enticing when there is no publicly known method.
Yes I understand that that script solves a problem that is very close to this case. I found some interesting stuff there, but did not understand all of it.
- etonApr 22, 2023Luminary
I managed to make the BTRFS subvolume that was created via CLI visible in the web admin 😄
I added it like this
sqlite3 /var/readynasd/db.sq3 INSERT INTO share (id, zfs_name, type, volume_id, name, path, user_access, group_access, everyone_access, non_owner_delete, user_id, group_id, update_ts) VALUES (13, 'data/TestTest', 'share', 'data', 'TestTest', '/data/TestTest', 7, 7, 7, 0, 99, 99, CURRENT_TIMESTAMP); .exit - tigertenApr 24, 2023Luminary
Amazing expedition!
You might be able to figure out why the USB drive is not showing up as external under media with virtual ReadyNAS.
I can mount to a subvolume under DATA, but not under the default media/USB_HDD. Wee, I would say I can mount it to under media manually, but it does show up in the UI.
Related Content
NETGEAR Academy
Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!