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!

1) Make sure you are not in a directory on the drive. "cd" will take you out.
2) Kill stubby and whatever else is running from the drive
3) /bin/umount -f /tmp/mnt/sda1
4) /usr/sbin/e2fsck -f -p /dev/sda1
5) /bin/mount /dev/sda1 /tmp/mnt/USB-Drive
Hopefully the filesystem was just mounted wrong.

Thanks, I am in the root folder, but how do I kill stubby or the other scripts?
 
Code:
# ps | grep pixelserv
13349 nobody   21964 S    pixelserv-tls 192.168.50.254 -l 4
15236 HdB34266  5320 S    grep pixelserv
# ps | grep stubby
 1840 HdB34266  7332 S    stubby -g -v 5 -C /opt/etc/stubby/stubby.yml 2>/opt/var/log/stubby.log
15241 HdB34266  5320 S    grep stubby
# ps | grep dnsmasq
 4832 nobody   69404 S    dnsmasq --log-async
15355 HdB34266  5320 S    grep dnsmasq
# ps | grep smb
 4848 HdB34266 11584 S    nmbd -D -s /etc/smb.conf
 4849 HdB34266 11880 S    /usr/sbin/smbd -D -s /etc/smb.conf
15379 HdB34266  5320 S    grep smb
# kill 13349 1840 4832 4848 4849
 
Thanks EmeraldDeer! I just renamed the USB drive back to "USB-Drive" via
Code:
tune2fs -L "USB-Drive" /dev/sda1

That makes it work again. I honestly don't know why the name changed to "sda1".

Also, I realized that every time I reboot the router it never (!) mounts the USB Drive. I always have to unplug it and plug it in again once the router is running. Maybe that way somehow something got corrupted?

Edit: Just saw your post from yesterday. Will reformat and reinstall everything with ext4.

I assume I have to set a partition for entware that is 3x the size of the RAM and my current partition is just too big (new partition should be around 1.5 GB then vs 30 GB now)?

How do I change the defaults for filesystem check treshold from 20 mounts and six months to 1 mount and 1 day?
 
Last edited:
Thanks EmeraldDeer! I just renamed the USB drive back to "USB-Drive" via
Code:
tune2fs -L "USB-Drive" /dev/sda1

That makes it work again. I honestly don't know why the name changed to "sda1".

Do you think it could be the format, ext3, would ext4 be better?

Also, I realized that every time I reboot the router it never (!) mounts the USB Drive. I always have to unplug it and plug it in again once the router is running. Maybe that way somehow something got corrupted?
So the Filesystem volume name actually was changed? I do not know how that could happen. I did not know the command to do that until you just showed me.
If the problem was just size, then you would only have a mounting problem on the number of mounts specified in "Mount count" from the output of tune2fs -l /dev/sda1. Since you have the problem every reboot, there is something else wrong.
I started completely over, wiping the USB drive and reinitializing JFFS. I used the layout from my post earlier today:
https://www.snbforums.com/threads/a...erlin-terminal-menu.42415/page-25#post-464323
 
So the Filesystem volume name actually was changed? I do not know how that could happen. I did not know the command to do that until you just showed me.
If the problem was just size, then you would only have a mounting problem on the number of mounts specified in "Mount count" from the output of tune2fs -l /dev/sda1. Since you have the problem every reboot, there is something else wrong.
I started completely over, wiping the USB drive and reinitializing JFFS. I used the layout from my post earlier today:
https://www.snbforums.com/threads/a...erlin-terminal-menu.42415/page-25#post-464323

Yes will start over too, but could you tell me please how exactly do I change defaults for filesystem check thresholds from 20 mounts and six months to 1? Is it a menu setting in amtm?
 
Yes will start over too, but could you tell me please how exactly do I change defaults for filesystem check thresholds from 20 mounts and six months to 1? Is it a menu setting in amtm?
As far as I know, only command line:
tune2fs -c 1 -i 1d /dev/sda1
 
Something IS mounted which I do not understand.
However, my opinion is that your Entware filesystem is too big. I know because the same thing happened to me. There is no permanent solution. But the problem will only manifest itself every twentieth mount. Until then, the filesystem will not actually be checked.
But for now the task is to get the old filesystem back. My guess:
1) /bin/umount /tmp/mnt/sda1
2) /usr/sbin/e2fsck -f -p /dev/sda1
3) /bin/mount /dev/sda1 /tmp/mnt/USB-Drive
Just an FYI, I have my entire 120 GB SSD as one big partition (with Entware) and I've never had an issue. Before that I had a 32GB flash drive and never had a problem. I'm not certain your experience is typical.

Also, amtm should install a script that forces a fsck on every boot. At least it did on my system.
 
Weird. Maybe it is because I installed amtm first and then Diversion.

@cmkelley when you do a reboot is your USB Drive automatically being detected and mounted by the router? It never mounts it for me and I have to unplug the drive and plug it in again once the router is restarted. I assume something messed up the drive while doing so a few times.

Maybe it is because I should use USB3 instead of USB2?
 
The post above got me thinking about what are the proper steps for an initial install of Diversion from scratch? Based on what I've learned over the last few weeks on SNB I'll wager a guess. Please comment.

1. Enable JFFS custom scripts and configs
2. Install amtm
3. Use amtm to format the flash drive
4. Use amtm to create swap file (how big?) (is this necessary if only running Diversion)
5. Use amtm to install disk check script
6. Use amtm to install Diversion (this will also install Entware and pixelserv-tls)
Done!

Alternate scenario. I currently have Diversion and amtm installed on a non-Linux created ext2 flash drive. Before completing the steps above do I...
1. Need to uninstall Diversion (and will that uninstall pixelserv-tls)?
2. Need to uninstall amtm?
3. Format JFFS?

As you can probably tell I am a complete Linux noob.
 
Weird. Maybe it is because I installed amtm first and then Diversion.

@cmkelley when you do a reboot is your USB Drive automatically being detected and mounted by the router? It never mounts it for me and I have to unplug the drive and plug it in again once the router is restarted. I assume something messed up the drive while doing so a few times.

Maybe it is because I should use USB3 instead of USB2?
Yes, my USB drive is always automatically detected and mounted.

The only time I had a problem with my USB drive being recognized, I turned off the router, waited like 5 minutes, then turned it back on and all was well. I'd avoid plugging that USB drive into any other computer that doesn't natively support ext2/3/4. OS-X is more or less FreeBSD, support for Linux filesystems is an add-on that was marginal last time I checked*.

I don't much go for the multiple partition thing, your mileage may vary. What I would recommend, in order:
  1. Wipe your jffs
  2. Install amtm
  3. Using amtm (all of these things are available from the amtm menu):
    1. Format your flash drive either ext2, ext3, or ext4. Do not use any other filesystem than one of these three. My preference is ext4 with journaling**.
    2. Turn on the disk check script in the amtm menu (2nd choice under "amtm system tools")
    3. Install a swap file on the flash drive, size 1x memory (1st choice under "amtm system tools")
    4. Install Entware
    5. Install Diversion
    6. Install whatever else you want from amtm
  4. PROFIT!!! (just kidding)
With the disk check script from amtm, you won't have to fiddle with tune2fs. :) Even if you didn't use amtm for anything else, that alone is worth it. Plug your flash drive into the USB3 port and use USB3 if if doesn't cause other problems for you (there's a ton of threads on that subject)

Also, never plug that flash drive into any other computer that isn't running Linux (even then, I'd avoid it if at all possible). Set up a samba share and get whatever you need off the flash drive that way. Or learn the magic of scp.

* explaining why this is has a high probability of starting a flame war even worse than vi vs. emacs.

** In my opinion, journaling makes it easier/more likely to recover from issues and is not a noticeable performance hit for 99% of use cases.
 
Last edited:
The post above got me thinking about what are the proper steps for an initial install of Diversion from scratch? Based on what I've learned over the last few weeks on SNB I'll wager a guess. Please comment.

1. Enable JFFS custom scripts and configs
2. Install amtm
3. Use amtm to format the flash drive
4. Use amtm to create swap file (how big?) (is this necessary if only running Diversion)
5. Use amtm to install disk check script
6. Use amtm to install Diversion (this will also install Entware and pixelserv-tls)
Done!

Alternate scenario. I currently have Diversion and amtm installed on a non-Linux created ext2 flash drive. Before completing the steps above do I...
1. Need to uninstall Diversion (and will that uninstall pixelserv-tls)?
2. Need to uninstall amtm?
3. Format JFFS?

As you can probably tell I am a complete Linux noob.
If you can stand losing everything on your jffs, formatting the jffs will have the same effect as removing diversion/pixelserv/etc. All the start scripts run from jffs. So you can do that, then start from your step 2 (install amtm).

I'd use a swap file (1x memory) regardless. Unless you're using a flash drive that's way too small in the first place, it will take up a trivial amount of space on the flash drive.
 
I only have Diversion installed so I don't think it would be an issue formatting jffs (no white or black list to preserve). I noticed two posts up in your response to Blackbox you mention installing Entware in step 4 and then Diversion in step 5. I thought Diversion installed Entware during it's install. Is there a difference when installing Entware from amtm vs Diversion?
 
I only have Diversion installed so I don't think it would be an issue formatting jffs (no white or black list to preserve). I noticed two posts up in your response to Blackbox you mention installing Entware in step 4 and then Diversion in step 5. I thought Diversion installed Entware during it's install. Is there a difference when installing Entware from amtm vs Diversion?
Not to my knowledge. I just prefer to do one thing at a time, unless there is a reason to do otherwise.
 
After some testing it seems like USB2 caused the hickups. I set the USB port to USB3 and the USB drive gets detected even after a reboot w/o problems. Will reinstall from scratch and report back if any other problems occur. Thanks.
 
---------------------------------------------------
/jffs/amtm-disk-check.log has this content:

START FILE, --- lines are not part of file
---------------------------------------------------

Sat May 5 07:05:13 DST 2018 Starting 'e2fsck -p /dev/sda1'
SWAP contains a file system with errors, check forced.
SWAP: The bad block inode looks invalid.

SWAP: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
(i.e., without -a or -p options)

Mon Jan 14 13:11:08 UTC 2019 Unknown filesystem type on /dev/sdb1 - skipping check.

Mon Jan 14 13:11:08 UTC 2019 Unknown filesystem type on /dev/sdb2 - skipping check.

Sat May 5 07:05:10 DST 2018 Starting 'e2fsck -p /dev/sda1'
SWAP contains a file system with errors, check forced.
SWAP: The bad block inode looks invalid.

SWAP: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
(i.e., without -a or -p options)

Sat May 5 07:05:11 DST 2018 Starting 'e2fsck -p /dev/sda1'
SWAP contains a file system with errors, check forced.
SWAP: The bad block inode looks invalid.

SWAP: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
(i.e., without -a or -p options)

Sat May 5 07:05:13 DST 2018 Starting 'e2fsck -p /dev/sda1'
SWAP contains a file system with errors, check forced.
SWAP: The bad block inode looks invalid.

SWAP: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
(i.e., without -a or -p options)
---------------------------------------------------
END FILE



Why do I get this when I run "dcl"?
 
---------------------------------------------------
/jffs/amtm-disk-check.log has this content:

START FILE, --- lines are not part of file
---------------------------------------------------

Sat May 5 07:05:13 DST 2018 Starting 'e2fsck -p /dev/sda1'
SWAP contains a file system with errors, check forced.
SWAP: The bad block inode looks invalid.

SWAP: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
(i.e., without -a or -p options)

Mon Jan 14 13:11:08 UTC 2019 Unknown filesystem type on /dev/sdb1 - skipping check.

Mon Jan 14 13:11:08 UTC 2019 Unknown filesystem type on /dev/sdb2 - skipping check.

Sat May 5 07:05:10 DST 2018 Starting 'e2fsck -p /dev/sda1'
SWAP contains a file system with errors, check forced.
SWAP: The bad block inode looks invalid.

SWAP: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
(i.e., without -a or -p options)

Sat May 5 07:05:11 DST 2018 Starting 'e2fsck -p /dev/sda1'
SWAP contains a file system with errors, check forced.
SWAP: The bad block inode looks invalid.

SWAP: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
(i.e., without -a or -p options)

Sat May 5 07:05:13 DST 2018 Starting 'e2fsck -p /dev/sda1'
SWAP contains a file system with errors, check forced.
SWAP: The bad block inode looks invalid.

SWAP: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
(i.e., without -a or -p options)
---------------------------------------------------
END FILE



Why do I get this when I run "dcl"?


This seems to be key:
“Unknown filesystem type on/dev/sdb1 - skipping check.”

How did you format the drive; how old is it and which make and what size?
 
1) Make sure you are not in a directory on the drive. "cd" will take you out.
2) Kill stubby and whatever else is running from the drive
3) /bin/umount -f /tmp/mnt/sda1
4) /usr/sbin/e2fsck -f -p /dev/sda1
5) /bin/mount /dev/sda1 /tmp/mnt/USB-Drive
Hopefully the filesystem was just mounted wrong.

I was told the -f option isn't worth using. Can cause disk problems. I had no luck using it to bypass the resource busy error.

"The device must be properly unmounted. If the user cannot unmount the device then they shouldn't proceed. Using the -f option won't help. Do not use the -l option of umount either. This option was suggested at one point but must not be used. It will cause problems, especially with devices that have multiple partitions." -- Source: Disk formatting #unmounting-disks on the Wiki

I do like the idea of using e2fsck -f -p /dev/sda1
 
Hallo,

When i am in my Merlin AsusWRT router (via ssh) it seems that the terminal cannot resolve any hostnames. Therefore the installations fail. Whats the take here please and how do i fix that? I suppose its just one flag to set/one liner ? Thanks in advance!
 
Hallo,

When i am in my Merlin AsusWRT router (via ssh) it seems that the terminal cannot resolve any hostnames. Therefore the installations fail. Whats the take here please and how do i fix that? I suppose its just one flag to set/one liner ? Thanks in advance!
What are your WAN DNS settings?
 
This seems to be key:
“Unknown filesystem type on/dev/sdb1 - skipping check.”

How did you format the drive; how old is it and which make and what size?

Some older Kingston DT 100 G2 USB 2.0 stick formatted to EXT2. I formatted it on computer with EaseUS Partition Manager.
 

Latest threads

Sign Up For SNBForums Daily Digest

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