What's new

no swap configured after reboot

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

jata

Senior Member
I have created a new / clean install of merlin 384.17 on my RT-AC86U and it has been working perfect for one week.

Now I have tried to use amtm to add a USB thumb drive and swap file. It's a brand new 32gb USB 3.1 drive.

Process I followed is:
format USB as ntfs on pc

on router...
format JFFS partition at next boot - yes
reboot x2 times with 5mins apart
reboot and add USB to USB 3 port on router
use amtm to format USB - following all recommended settings
reboot then use amtm to create 2GB swap
check in the router GUI and swap is configured
reboot...

Following this reboot the GUI no longer reports there is a swap - no swap configured

amtm shows no swap either...

Please help...
 
after further investigation i see that when ever I install scripts after creating the swap file - there is always a message saying...

added missing swap file entry to /jffs/scripts/post-mount

I think this is related to the issue I have when I reboot the router.

Does this help understand the issue?
 
It's a bit odd that it isn't sticking, what does your /jffs/scripts/post-mount file look like ("ls -l /jffs/scripts/post-mount" and "cat /jffs/scripts/post-mount")? I would have said it was because the drive is NTFS, but it looks like you reformatted it with amtm, was that to ext3/ext4?
 
Try changing the usb drive might potentially be faulty see if that is the issue.
 
thanks for the help guys - much appreciated.

admin@RT-AC86U:/tmp/home/root# ls -l /jffs/scripts/post-mount

-rwxr-xr-x 1 admin root 10 May 7 18:13 /jffs/scripts/post-mount

admin@RT-AC86U:/tmp/home/root# cat /jffs/scripts/post-mount

#!/bin/sh
 
also I have tried both USB ports. Same issue.

I will try with a different USB drive to see if that makes any difference.

I'm thinking there should be a entry in the post-mount file but it's empty
 
@jata

After you wipe the jffs you have to reflash the firmware to get amtm back.

Stop wiping the jffs.

After reflashing .17 install Diversion and use Diversion to format the USB to EXT4 with Journaling (turned on) 2GB swap. Then install any of the other scripts you want.
 
It's hard to tell which bit amtm is failing on, but it should have added the swap file before the "added missing swap file" line. Are there any weird characters in your drive name? What does "find /tmp/mnt/*/myswap.swp" show?
 
OK so tried installing diversion but same issue after reboot
 
also the swap file is on the USB drive - it just is not mounting it after a restart...

I have named my USB drive as SD32GB

admin@RT-AC86U:/tmp/home/root# find /tmp/mnt/*/myswap.swp

/tmp/mnt/SD32GB/myswap.swp
 
OK so tried installing diversion but same issue after reboot

From amtm use "i" and install "dc" (disk check)
Reboot router and use "dcl" to check log.

Use the GUI to mount disk.

Also try running the USB 3.0 port in USB 2.0 mode, a GUI change.
 
Last edited:
so I used amtm and re-created the swap file and this time there are some entries in the post-mount file - see below.

#!/bin/sh
swapon /tmp/mnt/SD32GB/myswap.swp # Added by amtm
. /jffs/addons/diversion/mount-entware.div # Added by Diversion

rebooted and swap is correctly recognised so looks like this issue is resolved but I'm not sure I could reproduce the fix!
 
I think I might know what caused it. The line to add the swapon command is
Code:
sed -i "2i swapon $swl # Added by amtm" /jffs/scripts/post-mount
which inserts it in the second line. But if there's only one line (eg '#!/bin/sh') then it wont get added. This might be more reliable
Code:
sed -i "1a swapon $swl # Added by amtm" /jffs/scripts/post-mount
 
Thanks for all the help. I think what you are suggesting is a change to amtm code/scripts?
 
I have created a new / clean install of merlin 384.17 on my RT-AC86U and it has been working perfect for one week.

Now I have tried to use amtm to add a USB thumb drive and swap file. It's a brand new 32gb USB 3.1 drive.

Process I followed is:
format USB as ntfs on pc

on router...
format JFFS partition at next boot - yes
reboot x2 times with 5mins apart
reboot and add USB to USB 3 port on router
use amtm to format USB - following all recommended settings
reboot then use amtm to create 2GB swap
check in the router GUI and swap is configured
reboot...

Following this reboot the GUI no longer reports there is a swap - no swap configured

amtm shows no swap either...

Please help...
try formatting with AMTM as ext2 with only 1 partition, that way everything is on the one partition. the ext2 is just to check something...
 
@jata

After you wipe the jffs you have to reflash the firmware to get amtm back.

Stop wiping the jffs.

After reflashing .17 install Diversion and use Diversion to format the USB to EXT4 with Journaling (turned on) 2GB swap. Then install any of the other scripts you want.
Wiping the /jffs partition does not remove amtm on a firmware that comes with it.
It merely resets amtm, same as r does.
 
I think I might know what caused it. The line to add the swapon command is
Code:
sed -i "2i swapon $swl # Added by amtm" /jffs/scripts/post-mount
which inserts it in the second line. But if there's only one line (eg '#!/bin/sh') then it wont get added. This might be more reliable
Code:
sed -i "1a swapon $swl # Added by amtm" /jffs/scripts/post-mount
I'll check that, I made a small change in that area in the amtm 3.1.7 release.
 
Fixed thanks @Dabombber , use uu to force update amtm.
 
Wiping the /jffs partition does not remove amtm on a firmware that comes with it.
It merely resets amtm, same as r does.

@thelonelycoder

That's not what just happened to me on my new AX58U. I had to reflash .17 to get amtm back.

I've only had it for 2+ days and have had some issues migrating. But amtm was missing after a jffs wipe.

When I used Putty it was not there. If it's hard baked there would be no reason to use the line code to reinstall amtm.

I'm at a loss trying to explain it further.

What steps should I have done at that point?


Thanks.
 
Last edited:
@thelonelycoder

That's not what just happened to me on my new AX58U. I had to reflash .17 to get amtm back.

I've only had it for 2+ days and have had some issues migrating. But amtm was missing after a jffs wipe.

When I used Putty it was not there. If it's hard baked there would be no reason to use the line code to reinstall amtm.

I'm at a loss trying to explain it further.

What steps should I have done at that point?


Thanks.
Type "amtm" without the quotes. The base amtm file comes with the firmware and cannot be removed or altered on the router.
It might be that you had the standard amtm installed and there was a profile entry for /jffs/scripts/amtm which was still active.
In any case, starting the firmware version with "/usr/sbin/amtm" (also without the quotes) will work in every case.
 

Sign Up For SNBForums Daily Digest

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