What's new

amtm amtm - the Asuswrt-Merlin Terminal Menu

  • 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 suggest you grep the contents of /proc/partitions instead which returns the size in KiB (not blocks as the header suggests :rolleyes:). Alternatively you could use /sys/block/<device>/size which returns the size in blocks (you'd also have to detect the block size).
Or blockdev, works on john's and merlins fw:
Code:
blockdev --getsize64 /dev/sda
 
@Jack Yaz After installing NTPMerlin and enable it, My NAS is unable to synchronize with NTP server (NAS is setup to check pool.ntp.org).
1-Should I make NAS check on 192.168.1.1 now that all traffic is redirected to ntpmerlin?
 
@Jack Yaz After installing NTPMerlin and enable it, My NAS is unable to synchronize with NTP server (NAS is setup to check pool.ntp.org).
1-Should I make NAS check on 192.168.1.1 now that all traffic is redirected to ntpmerlin?

Yes you could do that but it’s not necessary if you have enabled redirection in ntpmerlin settings. Thanks to redirection my offline nas syncs with the router despite still being configured to sync with default internet servers pool.ntp.org.
 
Yes you could do that but it’s not necessary if you have enabled redirection in ntpmerlin settings. Thanks to redirection my offline nas syncs with the router despite still being configured to sync with default internet servers pool.ntp.org.
Strange that my qnap nas shows my sync issues with ntpmerlin enabled. Don't know how to troubleshoot it

Sent from my SM-G965F Duos
 
Strange that my qnap nas shows my sync issues with ntpmerlin enabled. Don't know how to troubleshoot it

Sent from my SM-G965F Duos

Try rebooting the NAS and/or the router. I would try rebooting the NAS first. ;)

My QNAP is up for 38 days and I've changed a few routers back and forth in the last 2 weeks on my network and it is still syncing with no issues.
 
Issue: USB drive showing up as unmounted after formatting it to ext using amtm

I just installed amtm on my Asus RT-AC87U router running Asuswrt-Merlin's 384.10 firmware and ran "Format disk" to reformat a SanDisk Ultra Fit 128GB USB 3.0 Flash Drive from NTFS to ext, so I could install Diversion, Skynet and Stubby DNS.

At first, I had to reformat my flash drive from exFAT to NTFS on Windows 10. Then, using amtm (via PuTTY), I reformatted it to ext2. However, even though that action was done without any issues, amtm couldn't find the USB drive anymore after the required reboot.

I checked my router's GUI and the flash drive showed up as connected to USB 3.0 with the correct name, but it was listed as "unmounted". After searching these forums, I decided to reformat the drive to ext4, as per Merlin's recommendation. I had to format it back to NTFS on my PC before going through the entire amtm process once more, but the issue persisted.

I tried manually rebooting the router through the GUI and even powering the device off and then on multiple times, as well as unplugging and plugging back in the flash drive, either to the USB 3.0 port in the front or the USB 2.0 port in the back. I can't get the drive to show up as "mounted" and be recognizable in amtm no matter what. I can't install anything to my router or even format the drive again without going through the process of first reformatting it back to NTFS on Windows.

Any help is appreciated. Thanks in advance.
 
Issue: USB drive showing up as unmounted after formatting it to ext using amtm

I just installed amtm on my Asus RT-AC87U router running Asuswrt-Merlin's 384.10 firmware and ran "Format disk" to reformat a SanDisk Ultra Fit 128GB USB 3.0 Flash Drive from NTFS to ext, so I could install Diversion, Skynet and Stubby DNS.

At first, I had to reformat my flash drive from exFAT to NTFS on Windows 10. Then, using amtm (via PuTTY), I reformatted it to ext2. However, even though that action was done without any issues, amtm couldn't find the USB drive anymore after the required reboot.

I checked my router's GUI and the flash drive showed up as connected to USB 3.0 with the correct name, but it was listed as "unmounted". After searching these forums, I decided to reformat the drive to ext4, as per Merlin's recommendation. I had to format it back to NTFS on my PC before going through the entire amtm process once more, but the issue persisted.

I tried manually rebooting the router through the GUI and even powering the device off and then on multiple times, as well as unplugging and plugging back in the flash drive, either to the USB 3.0 port in the front or the USB 2.0 port in the back. I can't get the drive to show up as "mounted" and be recognizable in amtm no matter what. I can't install anything to my router or even format the drive again without going through the process of first reformatting it back to NTFS on Windows.

Any help is appreciated. Thanks in advance.
Unplug it, then plug it back in. Look at the syslog for clues.
 
Unplug it, then plug it back in. Look at the syslog for clues.

Hi, thelonelycoder. Thanks for the reply.

I unplugged the flash drive from the USB 2.0 and plugged it back into the USB 3.0 port. So many things popped up in the System Log afterwards that I can't even post them here, as it would exceed the character limit.

I uploaded the log using TextUploader here. Would you mind taking a look? I'm a layman when it comes to this.

Edit: I just remembered that I tried changing USB modes from 3.0 to 2.0 after my initial post (which also didn't fix the issue) and didn't change it back before unplugging the drive from the 2.0 port and plugging it into the 3.0 port again. The log may reflect that in some way.

Should I have USB mode set to 2.0 or 3.0?
 
Issue: USB drive showing up as unmounted after formatting it to ext using amtm

I just installed amtm on my Asus RT-AC87U router running Asuswrt-Merlin's 384.10 firmware and ran "Format disk" to reformat a SanDisk Ultra Fit 128GB USB 3.0 Flash Drive from NTFS to ext, so I could install Diversion, Skynet and Stubby DNS.

At first, I had to reformat my flash drive from exFAT to NTFS on Windows 10. Then, using amtm (via PuTTY), I reformatted it to ext2. However, even though that action was done without any issues, amtm couldn't find the USB drive anymore after the required reboot.

I checked my router's GUI and the flash drive showed up as connected to USB 3.0 with the correct name, but it was listed as "unmounted". After searching these forums, I decided to reformat the drive to ext4, as per Merlin's recommendation. I had to format it back to NTFS on my PC before going through the entire amtm process once more, but the issue persisted.

I tried manually rebooting the router through the GUI and even powering the device off and then on multiple times, as well as unplugging and plugging back in the flash drive, either to the USB 3.0 port in the front or the USB 2.0 port in the back. I can't get the drive to show up as "mounted" and be recognizable in amtm no matter what. I can't install anything to my router or even format the drive again without going through the process of first reformatting it back to NTFS on Windows.

Any help is appreciated. Thanks in advance.

I have seen this many times with many different USB drives. Just use another one (try a different brand, different capacity, etc.). There is no point in trying to 'fix' this, it needs to be reliable each time, every time. This is not an amtm issue. It is a compatibility issue with the USB drive and the router itself.

A 4GB, 8GB or 16GB drive is all you need for amtm + swap file + scripts. The older USB drives I find to be more compatible. I recommend Ext4 with journaling enabled for amtm + supported scripts with an additional 2GB swap file (again; amtm created) before any further scripts are installed.

I would also recommend you use the USB 2.0 mode, even if using the USB 3.0 port. The speed of the router and the scripts are not impacted measurably at all in normal use. ;)

The biggest speed difference is when creating the swap file and when initially installing scripts. When scripts are updated, there are a few seconds extra spent there too, but this doesn't happen often enough to warrant using the USB 3.0 mode and the possible interference caused to the 2.4GHz band.
 
I have seen this many times with many different USB drives. Just use another one (try a different brand, different capacity, etc.). There is no point in trying to 'fix' this, it needs to be reliable each time, every time. This is not an amtm issue. It is a compatibility issue with the USB drive and the router itself.

A 4GB, 8GB or 16GB drive is all you need for amtm + swap file + scripts. The older USB drives I find to be more compatible. I recommend Ext4 with journaling enabled for amtm + supported scripts with an additional 2GB swap file (again; amtm created) before any further scripts are installed.

I would also recommend you use the USB 2.0 mode, even if using the USB 3.0 port. The speed of the router and the scripts are not impacted measurably at all in normal use. ;)

The biggest speed difference is when creating the swap file and when initially installing scripts. When scripts are updated, there are a few seconds extra spent there too, but this doesn't happen often enough to warrant using the USB 3.0 mode and the possible interference caused to the 2.4GHz band.

Hi,L&LD. Thanks for chiming in.

The issue only started after the reformat to ext (either 2 or 4). As long as the drive is formatted in Windows to NTFS, it's recognizable by the router. Any idea what could be the incompatibility?

The only reason I'm using this drive is because it's small ("plug-and-stay", as SanDisk calls it), even though it has a much larger storage capacity than necessary (128GB). All my other flash drives are SanDisk (Cruzer), so if it's an issue with the manufacturer, changing drives wouldn't fix it.

I forgot to add this bit of information to my original post, but I tried changing the USB mode from 2.0 to 3.0 and that didn't help. And in my last format attempt using amtm, I selected ext4 with journaling enabled. No idea how to create a swap file, though. Is it done automatically?
 
Hi,L&LD. Thanks for chiming in.

The issue only started after the reformat to ext (either 2 or 4). As long as the drive is formatted in Windows to NTFS, it's recognizable by the router. Any idea what could be the incompatibility?

The only reason I'm using this drive is because it's small ("plug-and-stay", as SanDisk calls it), even though it has a much larger storage capacity than necessary (128GB). All my other flash drives are SanDisk (Cruzer), so if it's an issue with the manufacturer, changing drives wouldn't fix it.

I forgot to add this bit of information to my original post, but I tried changing the USB mode from 2.0 to 3.0 and that didn't help. And in my last format attempt using amtm, I selected ext4 with journaling enabled. No idea how to create a swap file, though. Is it done automatically?

Creating a swap file in amtm is very easy. Just start amtm and type 'sw'. ;)

The manufacturer isn't the issue. Its the nand or the chipset used in the particular USB drive model that may be the issue. ;)

Each manufacturer may use many different sources and quality levels of both. ;)

I would start from the beginning. Save anything from the following affected areas below before proceeding!

  • Format the USB drive as NTFS in your computer (which os are you using, btw).
  • Enable the 'format the jffs partition on next boot' option (make sure you click the Apply button at the bottom of that page) and then proceed to reboot the router and wait for 10 minutes after it comes up and then reboot the router again. After an additional 5 to 10 minutes, I would do one more reboot.
  • After the final boot up, wait for at least 5 minutes and then install the amtm script in the jffs partition.
  • Insert the USB drive (again, I recommend setting the USB mode to USB 2.0 for the USB 3.0 port).
  • Using amtm, format the drive to Ext4 with journaling enabled. Make sure you also use a drive label with no special characters or spaces.
  • After the router has rebooted, wait for at least 10 minutes for the router to settle.
  • Even if the USB drive didn't mount, simply remove it and wait a minute or two and then re-insert it into the same USB port (if necessary, you need to do the above steps using the other USB port, don't switch from one port to another, mid set up).
  • After the drive mounts, create a 2GB swap file in amtm using the 'sw' command. Wait for it to finish (this takes a while).
  • Now, enable the disk checker in amtm by using the 'dc' command.
  • Wait at least for another 5 or 10 minutes and then reboot the router and then check the disk checker log with the 'dcl' command in amtm after it has booted up.
  • During this waiting period, above, you can continue to install scripts. If you are going to use Diversion (or even if you think you might in the future), I would install Diversion and allow it to install Entware and pixelserv-tls too at this time (if you don't want to use Diversion right now, simply disable it).

See if the above steps resolve this issue for you. If not, a more drastic M&M Config of the whole router may work. But again, in my experience, getting a USB drive that just 'works' is far easier. ;)

(Unless you haven't performed a full reset to factory defaults and a minimal and manual configuration for many firmware upgrades now). :)

Hope to see positive results here soon. :)
 
I honestly feel like crying.

I tried plugging in a few different flash drives, but none of them were showing up in the router’s GUI (not even as unmounted).

I made sure to format them to NTFS again on my PC (running Windows 10, as mentioned in my initial post), but the router still wouldn’t recognize them (they were working fine under Windows).

Rebooted the router and now I can’t even access it anymore. 192.168.1.1 results in nothing. Wi-Fi is gone (no discoverable SSIDs). I have no internet, as the modem, although working properly, is set up in bridge by my ISP, per my request (I’m writing this message on my phone).

I tried resetting the router to its factory settings (as an absolute last resort, as I’ve made several changes since the last configuration backup) and the power light blinked after holding the reset button for 5 seconds, as it should, but nothing changed afterwards. I still have no access to the router (via Ethernet or Wi-Fi), and resetting it again doesn’t make the power light blink anymore - is stays on no matter how long I hold the reset button.

I’m tired and desperate. I even tried removing the router from the network entirely and connecting it exclusively to my PC, via Ethernet. Tried all 4 LAN ports and even the WAN port (before and after the reset) - nothing.

Please, I need help. My phone’s internet is unreliable and I depend on a proper connection for work.
 
I honestly feel like crying.

I tried plugging in a few different flash drives, but none of them were showing up in the router’s GUI (not even as unmounted).

I made sure to format them to NTFS again on my PC (running Windows 10, as mentioned in my initial post), but the router still wouldn’t recognize them (they were working fine under Windows).

Rebooted the router and now I can’t even access it anymore. 192.168.1.1 results in nothing. Wi-Fi is gone (no discoverable SSIDs). I have no internet, as the modem, although working properly, is set up in bridge by my ISP, per my request (I’m writing this message on my phone).

I tried resetting the router to its factory settings (as an absolute last resort, as I’ve made several changes since the last configuration backup) and the power light blinked after holding the reset button for 5 seconds, as it should, but nothing changed afterwards. I still have no access to the router (via Ethernet or Wi-Fi), and resetting it again doesn’t make the power light blink anymore - is stays on no matter how long I hold the reset button.

I’m tired and desperate. I even tried removing the router from the network entirely and connecting it exclusively to my PC, via Ethernet. Tried all 4 LAN ports and even the WAN port (before and after the reset) - nothing.

Please, I need help. My phone’s internet is unreliable and I depend on a proper connection for work.


EeK, just checking in. How are you making out? Is everything/something working now?
 
@EeK before going out and buying a new drive consider following the disk formatting wiki guide to manually ensure it’s properly zeroed and partitioned.

Here’s the basic order I’d do things.

- backup jffs then format jffs so no scripts could be attempting to access the USB resource
- Reboot
- Plug USB in to PC and format disk FAT or NTFS
- Plug USB in to router, it should be detected
- At CLI use dd to Zero disk (see wiki)
- Hard reboot router
- Open pc web browser to your router network administration page and use router to format the USB to FAT (don’t use your pc)
- Soft Reboot
- Now your USB should be partitioned properly for the router.
- Try the amtm script fd again. If it doesn’t work, follow the wiki step by step to do the whole entire job manually from start to finish.
 
I honestly feel like crying.

I tried plugging in a few different flash drives, but none of them were showing up in the router’s GUI (not even as unmounted).

I made sure to format them to NTFS again on my PC (running Windows 10, as mentioned in my initial post), but the router still wouldn’t recognize them (they were working fine under Windows).

Rebooted the router and now I can’t even access it anymore. 192.168.1.1 results in nothing. Wi-Fi is gone (no discoverable SSIDs). I have no internet, as the modem, although working properly, is set up in bridge by my ISP, per my request (I’m writing this message on my phone).

I tried resetting the router to its factory settings (as an absolute last resort, as I’ve made several changes since the last configuration backup) and the power light blinked after holding the reset button for 5 seconds, as it should, but nothing changed afterwards. I still have no access to the router (via Ethernet or Wi-Fi), and resetting it again doesn’t make the power light blink anymore - is stays on no matter how long I hold the reset button.

I’m tired and desperate. I even tried removing the router from the network entirely and connecting it exclusively to my PC, via Ethernet. Tried all 4 LAN ports and even the WAN port (before and after the reset) - nothing.

Please, I need help. My phone’s internet is unreliable and I depend on a proper connection for work.

Sounds much more likely this would be a faulty router then. Take a video on your phone to show the store salesperson what happens after factory reset. Hopefully they won’t feel bothered to try it themself. That’ll possibly speed up the returns / exchange process.
 
@EeK before going out and buying a new drive consider following the disk formatting wiki guide to manually ensure it’s properly zeroed and partitioned.

Here’s the basic order I’d do things.

- backup jffs then format jffs so no scripts could be attempting to access the USB resource
- Reboot
- Plug USB in to PC and format disk FAT or NTFS
- Plug USB in to router, it should be detected
- At CLI use dd to Zero disk (see wiki)
- Hard reboot router
- Open pc web browser to your router network administration page and use router to format the USB to FAT (don’t use your pc)
- Soft Reboot
- Now your USB should be partitioned properly for the router.
- Try the amtm script fd again. If it doesn’t work, follow the wiki step by step to do the whole entire job manually from start to finish.

hes well beyond that - may need a new router!!
 
@EeK

I hope you've got the router back to a stable state. I won't be able to respond for a few hours, but just in case you still need some help with this, I hope the following will be enough to get you going again.

I think you may have gotten the router into its recovery mode instead of just resetting it.

Try this:
  • Unplug the router from everything, including any USB drives, Ethernet cables (LAN & WAN) and the power plug too (unplug from both the router itself and remove the ac power plug from the wall socket too).
  • Leave the router like this for at least 10 minutes. Now, plug into the ac wall socket, connect the power plug to the router itself, turn on the power switch and wait. It may take a long time to boot up. Just keep monitoring for your old SSID or the default (open) Asus SSID if you happened to actually reset it in one of those attempts.
  • When the router comes up, connect with WiFi and immediately do a full reset to factory defaults via the GUI. Making sure to also check the box that says 'initialize all settings too...' right beside the Reset button.
  • Wait for it to boot up again and then 'format the jffs on next boot' and reboot the router at least twice.
  • At this point, I would flash the same version of the firmware that is already installed (yes, do it again).
  • When the router boots up, it should be as stable as it can be.
The above should get you to a good/known state with your router.

If nothing has worked so far, I would be assuming a hardware failure at this point. :(

Hoping for the best here.
 
Thanks for the replies, everyone.

@L&LD

I still haven't been able to gain access to the router. Tried various reset methods (reset button, 30-30-30, WPS button), but it's still unreachable. No way to ping it, no SSIDs, nothing. I was able to connect my PC directly to the modem and have internet access, though, so I'm a little less desperate now.

It appears that my modem reverted to its default state (as I was able to connect to the internet without the need for the router), even though I literally never touched it during the entire process (the fiber can be very finicky and I always make sure to be extremely careful around the network devices). On Windows, ipconfig gives me a very unusual default gateway, which does not grant me access to the modem's GUI, and no other more standard addresses work. Some services are unreachable, as well. Not sure what exactly is going on.

Strangely, something similar has happened before. One day, out of the blue, that same router stopped working. I wasn't messing with it and had never used the USB ports until today, but faced the exact same issues: couldn't ping it or access its GUI in any way, or even reset it. My ISP had sent an update to their modem and I assumed that it ended up bricking my router, somehow. I simply asked them to revert the modem to its default settings and removed my router from the network, after wasting as much time as today trying to fix it by myself.

It was only recently, after leaving the router unplugged for months, that I decided to try reviving it one last time. And, to my surprise, the reset worked on the first try. No fancy methods, just plugged it to an outlet, turned it on and then pressed and held down the reset button for 5 seconds. Power LED started blinking and I was able to access the GUI and configure everything to my liking. Asked my ISP to change their modem to bridge again and all was good - that is, until the USB fiasco.

I will try leaving the router completely unplugged, like you suggested, and will follow the rest of your recommendations tomorrow, when I'll report back to you. I really appreciate your help.

@Zonkd

I will also try your suggestions when (if?) I get my router working again. Unfortunately, I'm not in the US, where the router was purchased. And even so, I bought it in November of 2014, so it's been out of warranty for a while.

If there's no way to fix it, what other routers would you recommend? I may have become slightly traumatized with Asus, after two bad experiences, but I still like their functionality. Are there any other models that are more reliable than the RT-AC87U?
 
Last edited:

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