What's new

BACKUPMON BACKUPMON v1.5.10 -Mar 1, 2024- Backup/Restore your Router: JFFS + NVRAM + External USB Drive! (**Thread closed due to age**)

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

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.
 
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.
I think the -f option is to force a NFS filesystem to disconnect.

You're right with the -l option. It only disconnects when not busy.
 
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.
There's no 'fuser'
I don't know how to check the entware repo.
 
There's no 'fuser'
I don't know how to check the entware repo.
It is just another tool to help figure out what has the share busy.

At camp, so I can't check myself, but

Code:
opkg update
opkg list | grep fuser

Should tell you
 
This is the output, I don't know what to do with it....

Code:
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.
 
So, the psmisc package has fuser. You can try installing the package, then run

fuser -km <mount point>

Then try to unmount the share.

To install the package, run opkg install psmisc

If you are uncomfortable with it, don't. The dev can play further with it at a later time. More interested if QoS is causing reboots at the moment.
 
To install the package, run opkg install psmisc
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.
 
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.
At the very least, we know the process holding the share.
 
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.
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
 
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
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).
 
“modprobe: module md4 not found in modules.dep”
@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. ;)
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).
This should do the trick:

Code:
      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?

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?
 
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?
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.
 
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.
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?
 
@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.


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
 
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?
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.

As far as the sockets errors, I did find this about the subject with tar

"Sockets are zero level files that are used by daemon processes to communicate with each other. They are created and destroyed as necessary when the daemons start and stop. They can safely be ignored."
 
@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.


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
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?
So what result do you get when you run this command?

Code:
find /lib -name md4.ko

I'll add the -l switch to umount and see if that behaves better... I haven't had an issue yet with it not dismounting right away.

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.
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.

EDIT: please go ahead and update v0.6 again... it's got the "umount -l" switches added. ;)
 
Last edited:

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top