Jeffrey Young
Very Senior Member
I'm not at home, so I can't check, but does the firmware have
fuser
? If not, see if the entware repo has a fuser
package.fuser
? If not, see if the entware repo has a fuser
package.I think the -f option is to force a NFS filesystem to disconnect.I don't think that really unmounts it, just pretends to.
I did try "umount -f", but that made a right mess, disconnected the NAS but left the mount point which couldn't be deleted.
There's no 'fuser'I'm not at home, so I can't check, but does the firmware havefuser
? If not, see if the entware repo has afuser
package.
It is just another tool to help figure out what has the share busy.There's no 'fuser'
I don't know how to check the entware repo.
opkg update
opkg list | grep fuser
opkg list | grep fuser
fuse-utils - 2.9.9-2b - FUSE (Filesystem in UserSpacE) This package contains the FUSE utilities. - fusermount - ulockmgr_server
fuse3-utils - 3.10.5-2 - fuse3 (Filesystem in UserSpacE) This package contains the FUSE utilities. - fusermount3 - mount.fuse3
psmisc - 23.4-2a - psmisc is a set of additional small useful utilities that use the proc filesystem like fuser, killall, prtstat, pstree.
fuser -km <mount point>
opkg install psmisc
OK, I installed it & tried "fuser -vm" and this is the output..To install the package, runopkg install psmisc
fuser -vm /tmp/mnt/NAS/public
USER PID ACCESS COMMAND
/tmp/mnt/NAS/public: RT-AC86U-admin kernel mount /tmp/mnt/NAS/public
RT-AC86U-admin 1585 f.... sysstate
At the very least, we know the process holding the share.OK, I installed it & tried "fuser -vm" and this is the output..
Code:fuser -vm /tmp/mnt/NAS/public USER PID ACCESS COMMAND /tmp/mnt/NAS/public: RT-AC86U-admin kernel mount /tmp/mnt/NAS/public RT-AC86U-admin 1585 f.... sysstate
I won't try the "-km" option just yet, I have the router running with QoS disabled so I want to see if it still crashes in that state.
@Stephen Harrington ... what does this return for you?“modprobe: module md4 not found in modules.dep”
nvram get buildno | grep -o '^[^.]\+'
I had hoped my build checker would have caught this... I'm interested to see why it failed, because I'm reasonably sure that @Stephen Harrington is running 388? This logic seems to work on both my AX6000 (388) and AC86U (386).The modprobe will fail if you are on 386 base as it is not needed. Nothing to worry about. I also think only certain 388 firmware routers need it.
BUILD="$(nvram get buildno | grep -o '^[^.]\+')"
if [ $BUILD -eq 388 ]; then
modprobe md4 > /dev/null # Required now by some 388.x firmware for mounting remote drives
fi
Maybe just check to see if the file md4.ko exists. If if exists, load it. The file does not exist in the library on the 386 code base. i.e. (find /lib -name md4.ko).I had hoped my build checker would have caught this... I'm interested to see why it failed, because I'm reasonably sure that @Stephen Harrington is running 388? This logic seems to work on both my AX6000 (388) and AC86U (386).
Code:BUILD="$(nvram get buildno | grep -o '^[^.]\+')" if [ $BUILD -eq 388 ]; then modprobe md4 > /dev/null # Required now by some 388.x firmware for mounting remote drives fi
@Stephen Harrington ... please download v0.6 again. I made some changes to the way modprobe is used per @Jeffrey Young's suggestion below. You can redownload in the update menu, and it will overwrite it.“modprobe: module md4 not found in modules.dep”
This should do the trick:Maybe just check to see if the file md4.ko exists. If if exists, load it. The file does not exist in the library on the 386 code base. i.e. (find /lib -name md4.ko).
if [ $(find /lib -name md4.ko | wc -l) -gt 0 ]; then
modprobe md4 > /dev/null # Required now by some 388.x firmware for mounting remote drives
fi
I'm dying to know if disabling QoS fixed your router from rebooting?OK, I'll give it a go and see what happens.
I'm dying to know if disabling QoS fixed your router from rebooting?
I would try the -l option with umount. That way as soon as sysstate is done with the share, it will unmount automatically. If I understand the option correctly.Still going at the moment,
Looking good but have to give it a while to be sure.
Did you see my earlier post regarding the output of 'fuser -vm' showing the process holding the NAS share open?
Running fuser again no longer shows that process (sysstate?)
Would using "fuser -km" to kill that process be safe if you wanted to be sure the NAS could be unmounted after running the backup?
Would love your opinion on why the sysstate stays active on @alan6854321's router, but not anyone else's thus far. Do you think this -l switch should become a default, or just leave as-is?I would try the -l option with umount. That way as soon as sysstate is done with the share, it will unmount automatically. If I understand the option correctly.
BACKUPMON v0.6
Normal Backup starting in 10 seconds. Press [S]etup or [X] to override and enter RESTORE mode
Backing up to \\192.168.1.200\NetBackup mounted to /tmp/mnt/backups
Backup directory location: /asusrouter -- Frequency: Weekly
[Normal Backup Commencing]...
Messages:
STATUS: External Drive (\\192.168.1.200\NetBackup) mounted successfully under: /tmp/mnt/backups
STATUS: Daily Backup Directory successfully created.
STATUS: Finished backing up JFFS to /tmp/mnt/backups/asusrouter/Thu/jffs.tar.gz.
tar: ./entware/var/syslog-ng.ctl: socket ignored
tar: ./entware/var/run/syslog-ng/syslog-ng.ctl: socket ignored
STATUS: Finished backing up EXT Drive to /tmp/mnt/backups/asusrouter/Thu/AMTM-USB.tar.gz.
STATUS: Finished copying backupmon.sh script to /tmp/mnt/backups/asusrouter.
STATUS: Finished copying backupmon.cfg script to /tmp/mnt/backups/asusrouter.
STATUS: Finished copying exclusions script to /tmp/mnt/backups/asusrouter.
STATUS: Finished copying restore instructions.txt to /tmp/mnt/backups/asusrouter.
umount: can't unmount /tmp/mnt/backups: Device or resource busy
STATUS: External Drive (\\192.168.1.200\NetBackup) unmounted successfully.
####
# Backup AMTM-USB (USB Port 1) SSD/uSD and JFFS to NAS via RSync
rsync -av --delete --progress --exclude 'myswap.swp' --password-file=/jffs/scripts/rsync_pass /tmp/mnt/AMTM-USB nas@192.168.1.200::NetBackup
rsync -av --delete --progress --password-file=/jffs/scripts/rsync_pass /jffs nas@192.168.1.200::NetBackup
Have not got a clue about sysstate. If I understand the -l option, it is pretty safe. The share will simply get unmounted when sysstate is done with it.Would love your opinion on why the sysstate stays active on @alan6854321's router, but not anyone else's thus far. Do you think this -l switch should become a default, or just leave as-is?
Socket errors are only warnings with no consequence.@Viktor Jaep yes, I’m on 388.4 as per my sig, and yes the updated 0.6 got rid of the mod probe error. Socket errors are still there, and I note that the script had trouble unmounting the share this time, but got it eventually?
Code:BACKUPMON v0.6 Normal Backup starting in 10 seconds. Press [S]etup or [X] to override and enter RESTORE mode Backing up to \\192.168.1.200\NetBackup mounted to /tmp/mnt/backups Backup directory location: /asusrouter -- Frequency: Weekly [Normal Backup Commencing]... Messages: STATUS: External Drive (\\192.168.1.200\NetBackup) mounted successfully under: /tmp/mnt/backups STATUS: Daily Backup Directory successfully created. STATUS: Finished backing up JFFS to /tmp/mnt/backups/asusrouter/Thu/jffs.tar.gz. tar: ./entware/var/syslog-ng.ctl: socket ignored tar: ./entware/var/run/syslog-ng/syslog-ng.ctl: socket ignored STATUS: Finished backing up EXT Drive to /tmp/mnt/backups/asusrouter/Thu/AMTM-USB.tar.gz. STATUS: Finished copying backupmon.sh script to /tmp/mnt/backups/asusrouter. STATUS: Finished copying backupmon.cfg script to /tmp/mnt/backups/asusrouter. STATUS: Finished copying exclusions script to /tmp/mnt/backups/asusrouter. STATUS: Finished copying restore instructions.txt to /tmp/mnt/backups/asusrouter. umount: can't unmount /tmp/mnt/backups: Device or resource busy STATUS: External Drive (\\192.168.1.200\NetBackup) unmounted successfully.
Another efficient alternative over the “bloaty” SMB may be for your script to offer NFS as an alternative mounting strategy for those of us that can use it?
Up until yesterday when I started using BackupMon I had a very basic script I ran occasionally, based on rsync and advice and sample code from @visortgw, which all happened in this thread for reference.
AMTM / Entware USB Backup?
Looking for ideas/scripts to automate or “make more easy and convenient” (so I actually do it) the backup of my AMTM / Entware / Swap USB device, which in my case is a main/backup pair of Sandisk Max Endurance 64GB micro SD cards in matching Sandisk uSD-to-USB 3.0 adapters. I’m generally pretty...www.snbforums.com
My very crude final code here:-
usb-backup-nas.sh
Code:#### # Backup AMTM-USB (USB Port 1) SSD/uSD and JFFS to NAS via RSync rsync -av --delete --progress --exclude 'myswap.swp' --password-file=/jffs/scripts/rsync_pass /tmp/mnt/AMTM-USB nas@192.168.1.200::NetBackup rsync -av --delete --progress --password-file=/jffs/scripts/rsync_pass /jffs nas@192.168.1.200::NetBackup
So what result do you get when you run this command?@Viktor Jaep yes, I’m on 388.4 as per my sig, and yes the updated 0.6 got rid of the mod probe error. Socket errors are still there, and I note that the script had trouble unmounting the share this time, but got it eventually?
find /lib -name md4.ko
I will definitely look into this more... but it seems with rsync, it basically just copies over the contents of an entire drive. I do like the fact that tar compresses the whole thing while preserving permissions, etc. into 1 file, and makes for less clutter and saves drive space. I will work on figuring out a way to add more metadata to the backup files next so they don't overwrite themselves if you make multiple backups on the same day.Another efficient alternative over the “bloaty” SMB may be for your script to offer NFS as an alternative mounting strategy for those of us that can use it?
Up until yesterday when I started using BackupMon I had a very basic script I ran occasionally, based on rsync and advice and sample code from @visortgw, which all happened in this thread for reference.
Welcome To SNBForums
SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.
If you'd like to post a question, simply register and have at it!
While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!