What's new

amtm Segmentation Fault in AMTM

  • 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!

Gary_Dexter

Senior Member
Hi,

Recently I've been getting Segmentation Faults in AMTM:

1692959287992.png


Everything is still working add-on wise - Skynet, YazFi etc. all still working.

Rebooting makes the issue go away and AMTM loads correctly. but after an undisclosed amount of time, checking AMTM again shows the errors.

Do I need to format the USB or try with a new USB stick and set everything up again?

If so, what are the correct steps to do this?

Cheers!
Gary
 
Hi,

Recently I've been getting Segmentation Faults in AMTM:

View attachment 52638

Everything is still working add-on wise - Skynet, YazFi etc. all still working.

Rebooting makes the issue go away and AMTM loads correctly. but after an undisclosed amount of time, checking AMTM again shows the errors.

Do I need to format the USB or try with a new USB stick and set everything up again?

If so, what are the correct steps to do this?

Cheers!
Gary
This seem to indicate a corrupted USB stick and, unless you already have a new one available, suggest to re-format your USB otherwise suggest to start over with the new one right away.
 
Nightly backup of your Entware USB key is a great thing. My USB SSD drive failed about two weeks ago. Only took 15 minutes to copy back backup to new SSD and reboot - back in business.

I agree with the above, your USB key is likely done. Reformat and reinstall as required.
 
Nightly backup of your Entware USB key is a great thing. My USB SSD drive failed about two weeks ago. Only took 15 minutes to copy back backup to new SSD and reboot - back in business.

I agree with the above, your USB key is likely done. Reformat and reinstall as required.
Hey @Jeffrey Young... could you please give me some more info (step-by-step) what you do to manually backup your SSD? That sounds like a great idea... ;)
 
Hey @Jeffrey Young... could you please give me some more info (step-by-step) what you do to manually backup your SSD? That sounds like a great idea... ;)
Happy too. We are heading back from camp on Sunday. I will post my script (does a daily backup to my NAS). I keep the last month's worth. Bit overkill, but it was an easy script to write that way.
 
I rsync to my NAS as well as to second USB SSD.
I like this idea actually. It is like a "ready to go USB key". I use a RasPi 4B as my NAS. It has free USB slots, I just may.... thanks for idea.
 
Happy too. We are heading back from camp on Sunday. I will post my script (does a daily backup to my NAS). I keep the last month's worth. Bit overkill, but it was an easy script to write that way.
Was wondering how some users like me who doesnt have NAS or Linux machine to do this. Will be super helpful indeed in case of USB drive failure
 
Was wondering how some users like me who doesnt have NAS or Linux machine to do this. Will be super helpful indeed in case of USB drive failure
Use rsync between (2) USB drives connected to router.
 
Was wondering how some users like me who doesnt have NAS or Linux machine to do this. Will be super helpful indeed in case of USB drive failure
You have options. You can use a USB hub on your router and connect a second USB drive to backup to. You also don't need a NAS per say. A share on your local windows computer or MAC will do as well.
 
You have options. You can use a USB hub on your router and connect a second USB drive to backup to. You also don't need a NAS per say. A share on your local windows computer or MAC will do as well.
Thank you, will try this later. I am still stuck with SanDisk USB stick and wanting to change to ssd/hdd, but the usb stick still holding strong.
 
Hey @Jeffrey Young... could you please give me some more info (step-by-step) what you do to manually backup your SSD? That sounds like a great idea... ;)

Here is the script that I use. Like I said, saving the last month of backup images is likely a bit overboard, but it made for a quick script.

The use of tar vs rsync is really one of personal preference. Both will do the job. I like tar as I get nice small compressed backups and all the file structure (ownership, permissions, symbolic links, etc.) are preserved no matter the filesystem the backup is being stored onto. I believe rsync does the same with the proper switches.

Code:
#!/bin/sh
# Last modifed: August 9, 2023

USERNAME="**********"
PASSWORD="**********"
UNC="\\\\192.168.189.5\\users"
EXTDRIVE="/tmp/mnt/WDCloud"
BKDIR="/router/AX88UBackup"
DAY="$(date +%d)"
USBDRIVE="/tmp/mnt/$(nvram get usb_path_sda1_label)"

if ! [ -d $EXTDRIVE ]; then
    mkdir -p $EXTDRIVE
    chmod 777 $EXTDRIVE
fi

if ! mount | grep $EXTDRIVE > /dev/null 2>&1; then
    modprobe md4 > /dev/null    # Required now by some 388.x firmware for mounting remote drives
    mount -t cifs $UNC $EXTDRIVE -o "vers=2.1,username=${USERNAME},password=${PASSWORD}"
    sleep 5
fi

if [ -n "`mount | grep $EXTDRIVE`" ]; then
  
    if ! [ -d "${EXTDRIVE}${BKDIR}" ]; then mkdir -p "${EXTDRIVE}${BKDIR}"; fi
    if ! [ -d "${EXTDRIVE}${BKDIR}/${DAY}" ]; then mkdir -p "${EXTDRIVE}${BKDIR}/${DAY}"; fi

    [ -f ${EXTDRIVE}${BKDIR}/${DAY}/jffs.tar* ] && rm ${EXTDRIVE}${BKDIR}/${DAY}/jffs.tar*
    [ -f ${EXTDRIVE}${BKDIR}/${DAY}/USBDrive.tar* ] && rm ${EXTDRIVE}${BKDIR}/${DAY}/USBDrive.tar*
  
    tar -czf ${EXTDRIVE}${BKDIR}/${DAY}/jffs.tar.gz -C /jffs . >/dev/null
    logger "Script ImageUSB: Finished backing up jffs to ${EXTDRIVE}${BKDIR}/${DAY}/jffs.tar.gz"
  
    tar -zcf ${EXTDRIVE}${BKDIR}/${DAY}/USBDrive.tar.gz -C $USBDRIVE . >/dev/null
    logger "Script ImageUSB: Finished backing up USB Key to ${EXTDRIVE}${BKDIR}/${DAY}/USBDrive.tar.gz"

    sleep 10 
    umount $EXTDRIVE
else
    echo "Failed to run ImageUSB script as mount failed"
fi

Then in my services-start script, I have an entry as follows;

cru a SyncUsbToNas "0 3 * * * /jffs/addons/young/ImageUSB >/dev/null 2>&1"

Hope you find this useful...

Cheers
 
And here is my quick and dirty rsync backup script:

Code:
#!/bin/sh

rsync -av --exclude 'myswap.swp' --exclude 'entware/var/log/*' --exclude 'skynet/skynet.log' \
                                 --password-file=/jffs/scripts/rsync_pass /tmp/mnt/TheS1RsUSB/ rsync@192.168.222.5::NetBackup/TheS1RsUSB/
rsync -av                        --password-file=/jffs/scripts/rsync_pass /jffs/               rsync@192.168.222.5::NetBackup/jffs/

rsync -av --exclude 'myswap.swp' --exclude 'entware'  --exclude 'skynet/skynet.log' \
                                                                  /tmp/mnt/TheS1RsUSB/         /tmp/mnt/rsyncTheS1R/
rsync -av --exclude 'var/log/*'                                   /tmp/mnt/TheS1RsUSB/entware/ /tmp/mnt/rsyncTheS1R/old.entware/

I'm sure that it can be improved.
NOTE: password-file contains rsync user password.
 
Here is the script that I use. Like I said, saving the last month of backup images is likely a bit overboard, but it made for a quick script.

The use of tar vs rsync is really one of personal preference. Both will do the job. I like tar as I get nice small compressed backups and all the file structure (ownership, permissions, symbolic links, etc.) are preserved no matter the filesystem the backup is being stored onto. I believe rsync does the same with the proper switches.

Code:
#!/bin/sh
# Last modifed: August 9, 2023

USERNAME="**********"
PASSWORD="**********"
UNC="\\\\192.168.189.5\\users"
EXTDRIVE="/tmp/mnt/WDCloud"
BKDIR="/router/AX88UBackup"
DAY="$(date +%d)"
USBDRIVE="/tmp/mnt/$(nvram get usb_path_sda1_label)"

if ! [ -d $EXTDRIVE ]; then
    mkdir -p $EXTDRIVE
    chmod 777 $EXTDRIVE
fi

if ! mount | grep $EXTDRIVE > /dev/null 2>&1; then
    modprobe md4 > /dev/null    # Required now by some 388.x firmware for mounting remote drives
    mount -t cifs $UNC $EXTDRIVE -o "vers=2.1,username=${USERNAME},password=${PASSWORD}"
    sleep 5
fi

if [ -n "`mount | grep $EXTDRIVE`" ]; then
 
    if ! [ -d "${EXTDRIVE}${BKDIR}" ]; then mkdir -p "${EXTDRIVE}${BKDIR}"; fi
    if ! [ -d "${EXTDRIVE}${BKDIR}/${DAY}" ]; then mkdir -p "${EXTDRIVE}${BKDIR}/${DAY}"; fi

    [ -f ${EXTDRIVE}${BKDIR}/${DAY}/jffs.tar* ] && rm ${EXTDRIVE}${BKDIR}/${DAY}/jffs.tar*
    [ -f ${EXTDRIVE}${BKDIR}/${DAY}/USBDrive.tar* ] && rm ${EXTDRIVE}${BKDIR}/${DAY}/USBDrive.tar*
 
    tar -czf ${EXTDRIVE}${BKDIR}/${DAY}/jffs.tar.gz -C /jffs . >/dev/null
    logger "Script ImageUSB: Finished backing up jffs to ${EXTDRIVE}${BKDIR}/${DAY}/jffs.tar.gz"
 
    tar -zcf ${EXTDRIVE}${BKDIR}/${DAY}/USBDrive.tar.gz -C $USBDRIVE . >/dev/null
    logger "Script ImageUSB: Finished backing up USB Key to ${EXTDRIVE}${BKDIR}/${DAY}/USBDrive.tar.gz"

    sleep 10
    umount $EXTDRIVE
else
    echo "Failed to run ImageUSB script as mount failed"
fi

Then in my services-start script, I have an entry as follows;

cru a SyncUsbToNas "0 3 * * * /jffs/addons/young/ImageUSB >/dev/null 2>&1"

Hope you find this useful...

Cheers
Wow, thank you both, @Jeffrey Young and @visortgw! Gonna definitely start experimenting and am going to try the route of copying it over to one of my server shares! I really appreciate you sharing this. ;)
 
Check the Entware installation of grep that you probably have in /opt/bin/grep. Force a reinstallation of the package and any of its dependencies.
 
Here is the script that I use. Like I said, saving the last month of backup images is likely a bit overboard, but it made for a quick script.

The use of tar vs rsync is really one of personal preference. Both will do the job. I like tar as I get nice small compressed backups and all the file structure (ownership, permissions, symbolic links, etc.) are preserved no matter the filesystem the backup is being stored onto. I believe rsync does the same with the proper switches.

Code:
#!/bin/sh
# Last modifed: August 9, 2023

USERNAME="**********"
PASSWORD="**********"
UNC="\\\\192.168.189.5\\users"
EXTDRIVE="/tmp/mnt/WDCloud"
BKDIR="/router/AX88UBackup"
DAY="$(date +%d)"
USBDRIVE="/tmp/mnt/$(nvram get usb_path_sda1_label)"

if ! [ -d $EXTDRIVE ]; then
    mkdir -p $EXTDRIVE
    chmod 777 $EXTDRIVE
fi

if ! mount | grep $EXTDRIVE > /dev/null 2>&1; then
    modprobe md4 > /dev/null    # Required now by some 388.x firmware for mounting remote drives
    mount -t cifs $UNC $EXTDRIVE -o "vers=2.1,username=${USERNAME},password=${PASSWORD}"
    sleep 5
fi

if [ -n "`mount | grep $EXTDRIVE`" ]; then
 
    if ! [ -d "${EXTDRIVE}${BKDIR}" ]; then mkdir -p "${EXTDRIVE}${BKDIR}"; fi
    if ! [ -d "${EXTDRIVE}${BKDIR}/${DAY}" ]; then mkdir -p "${EXTDRIVE}${BKDIR}/${DAY}"; fi

    [ -f ${EXTDRIVE}${BKDIR}/${DAY}/jffs.tar* ] && rm ${EXTDRIVE}${BKDIR}/${DAY}/jffs.tar*
    [ -f ${EXTDRIVE}${BKDIR}/${DAY}/USBDrive.tar* ] && rm ${EXTDRIVE}${BKDIR}/${DAY}/USBDrive.tar*
 
    tar -czf ${EXTDRIVE}${BKDIR}/${DAY}/jffs.tar.gz -C /jffs . >/dev/null
    logger "Script ImageUSB: Finished backing up jffs to ${EXTDRIVE}${BKDIR}/${DAY}/jffs.tar.gz"
 
    tar -zcf ${EXTDRIVE}${BKDIR}/${DAY}/USBDrive.tar.gz -C $USBDRIVE . >/dev/null
    logger "Script ImageUSB: Finished backing up USB Key to ${EXTDRIVE}${BKDIR}/${DAY}/USBDrive.tar.gz"

    sleep 10
    umount $EXTDRIVE
else
    echo "Failed to run ImageUSB script as mount failed"
fi

Then in my services-start script, I have an entry as follows;

cru a SyncUsbToNas "0 3 * * * /jffs/addons/young/ImageUSB >/dev/null 2>&1"

Hope you find this useful...

Cheers

Got this working across the network to a share on my server... thanks so much, @Jeffrey Young! This is really my first experience using tar... so I had another question:

What would be the easiest way to restore one of these backups incase of a major issue with the attached storage? Would there be an easy way to run a command using the variables you're capturing in your script above to basically reverse/restore the backup using the same methods back to the same paths? What would that look like? Is there a way to automate this more should something would need to be restored?

Would it be as easy as:
Code:
tar -xf ${EXTDRIVE}${BKDIR}/${DAY}/jffs.tar.gz -C /jffs
tar -xf ${EXTDRIVE}${BKDIR}/${DAY}/SSDDrive.tar.gz -C $SSDDRIVE

Thanks!
 
Last edited:
Got this working across the network to a share on my server... thanks so much, @Jeffrey Young! This is really my first experience using tar... so I had another question:

What would be the easiest way to restore one of these backups incase of a major issue with the attached storage? Would there be an easy way to run a command using the variables you're capturing in your script above to basically reverse/restore the backup using the same methods back to the same paths? What would that look like? Is there a way to automate this more should something would need to be restored?

Thanks!
My attempt at this:
  1. Format new USB drive on router.
  2. Unmount USB drive, and attach to NAS or server.
  3. Mount on NAS or server.
  4. Copy file.tar.gz to newly formatted drive while attached to NAS or server.
  5. Unmount USB on NAS or server.
  6. Reattach/mount on router.
  7. gunzip file.tar.gz
  8. tar xf file.tar
  9. rm file.tar
 

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

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