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!

My setup:
  • SanDisk Ultra-Fit 32 GB 3.0 USB drive in USB 3 port of RT-AC86U
  • formatted as ext2 (fdisk id 83, Linux)
  • 2 GB swap file, created by amtm
Ah at last something I can use! @Adamm is on to something here. This is mine, partition table msdos :eek: even though it was partitioned and formatted in Linux. I've found the tools I need to redo this (gdisk and parted) so I will redo both as soon as I need to reboot for a good reason. I'll try ext4 again as well. I tested ext 2.3.4 previously but those were likely all msdos partition tables as well.
Code:
Model: SanDisk Ultra Fit (scsi)
Disk /dev/sdb: 15.4GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start   End     Size    Type     File system  Flags
 1      1049kB  15.4GB  15.4GB  primary  ext2
 
Fixed! :D

Code:
Model: SanDisk Ultra Fit (scsi)
Disk /dev/sda: 15.4GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name              Flags
 1      17.4kB  15.4GB  15.4GB  ext4         Linux filesystem
 
By switching to ext4/gpt?
Yes, I see an occasional "recovering journal" in the log, but no "not clean". It has gone through four reboots, but again this has plagued me for many moons. Fingers crossed.
 
I've not gone back reading issues in regards to usb drive problems but wanted to let others know.

I have a SanDisk Extreme 32 GB USB 3.0 Flash Drive and use MiniTool Partition Wizard Free Edition (via my windows bootcamp install) and always formatted as ext4/gpt and never have had an issues, even when upgrading router i never unplug flash drive and never had problems.
 
How did you do that?
I'm on Linux, so I use those tools. Gdisk, parted. fdisk.

Many here recommend MiniTool Partition Wizard like @Netbug states. I've used it on an old Win7 laptop.
 
Tried to create gpt/ext4 on the router and seem to have succeeded:
Code:
Model: SanDisk Ultra Fit (scsi)
Disk /dev/sda: 30.8GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name              Flags
 1      17.4kB  30.8GB  30.8GB  ext4         Linux filesystem
However, the disk check script will now fail:
Code:
Unknown filesystem type  on /dev/sda1 - skipping check.
 
Last edited:
That error is probably caused by the fact that the output of fdisk -l /dev/sda is different now?

ext2/mbr on AC68U:
Code:
Disk /dev/sda: 30.7 GB, 30752636928 bytes
255 heads, 63 sectors/track, 3738 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks  Id System
/dev/sda1               1        3738    30025484+ 83 Linux
ext4/gpt on AC86U:
Code:
Found valid GPT with protective MBR; using GPT

Disk /dev/sda: 60063744 sectors,  656M
Logical sector size: 512
Disk identifier (GUID): <REDACTED>
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 60063710

Number  Start (sector)    End (sector)  Size       Code  Name
   1              34        60063710       28.6G   0700  Linux filesystem
Notice the different output at the end; there's no longer a /dev/sda1, so the grep in the script will fail...
 
Last edited:
Hm, fdisk on the AC86U used to have the same actions as on the AC68U:
Code:
Command Action
a       toggle a bootable flag
b       edit bsd disklabel
c       toggle the dos compatibility flag
d       delete a partition
l       list known partition types
n       add a new partition
o       create a new empty DOS partition table
p       print the partition table
q       quit without saving changes
s       create a new empty Sun disklabel
t       change a partition's system id
u       change display/entry units
v       verify the partition table
w       write table to disk and exit
x       extra functionality (experts only)
However, I now only have these:
Code:
Command Action
o       create a new empty DOS partition table
p       print the partition table
q       quit without saving changes
s       create a new empty Sun disklabel
@RMerlin Did anything change in 384.4_2 for the AC86U that may be causing fdisk changes?

@Butterfly Bones Do you have the same limited set of actions on your RT-AC86U with 384.4_2? Does the disk check script still work for you?
 
Last edited:
Notice the different output at the end; there's no longer a /dev/sda1, so the grep in the script will fail...

Thats basically the issue we were discussing previously with the question why the script was failing for some and not others. I just manually edited the script to always use e2fsck -p because I only plug in ext drives.

Code:
#!/bin/sh

CHKCMD="e2fsck -p"
logger -t amtm "Running disk check '$CHKCMD' on $1"
printf "\n$(date) Starting '$CHKCMD install'\n" >> /jffs/amtm-disk-check.log
e2fsck -p "$1" >> /jffs/amtm-disk-check.log 2>&1
logger -t amtm "Disk check done on $1"
 
[USER=52887]@Butterfly Bones[/USER] Do you have the same limited set of actions on your RT-AC86U with 384.4_2? Does the disk check script still work for you?

This is all I see with "fdisk -h" via ssh to the AC86U. I do all my USB formatting on my Linux Mint computer.
Code:
tmp/home/root# fdisk --help
BusyBox v1.24.1 (2018-03-24 13:05:03 EDT) multi-call binary.

Usage: fdisk [-ul] [-C CYLINDERS] [-H HEADS] [-S SECTORS] [-b SSZ] DISK

Change partition table

    -u        Start and End are in sectors (instead of cylinders)
    -l        Show partition table for each DISK, then exit
    -b 2048        (for certain MO disks) use 2048-byte sectors
    -C CYLINDERS    Set number of cylinders/heads/sectors
    -H HEADS
    -S SECTORS

This is the fdisk -h result on my computer.
Code:
Usage:
 fdisk [options] <disk>      change partition table
 fdisk [options] -l [<disk>] list partition table(s)

Display or manipulate a disk partition table.

Options:
 -b, --sector-size <size>      physical and logical sector size
 -B, --protect-boot            don't erase bootbits when create a new label
 -c, --compatibility[=<mode>]  mode is 'dos' or 'nondos' (default)
 -L, --color[=<when>]          colorize output (auto, always or never)
                                 colors are enabled by default
 -l, --list                    display partitions end exit
 -o, --output <list>           output columns
 -t, --type <type>             recognize specified partition table type only
 -u, --units[=<unit>]          display units: 'cylinders' or 'sectors' (default)
 -s, --getsz                   display device size in 512-byte sectors [DEPRECATED]
     --bytes                   print SIZE in bytes rather than in human readable format

 -C, --cylinders <number>      specify the number of cylinders
 -H, --heads <number>          specify the number of heads
 -S, --sectors <number>        specify the number of sectors per track

 -h, --help     display this help and exit
 -V, --version  output version information and exit

Available columns (for -o):
 gpt: Device Start End Sectors Size Type Type-UUID Attrs Name UUID
 dos: Device Start End Sectors Cylinders Size Type Id Attrs Boot End-C/H/S Start-C/H/S
 bsd: Slice Start End Sectors Cylinders Size Type Bsize Cpg Fsize
 sgi: Device Start End Sectors Cylinders Size Type Id Attrs
 sun: Device Start End Sectors Cylinders Size Type Id Flags

For more details see fdisk(8).
 
printf "\n$(date) Starting '$CHKCMD install'\n" >> /jffs/amtm-disk-check.log
You copied over an unescaped variable which has been corrected in the last amtm commit:
Code:
printf "\n$(date) Starting '$CHKCMD $1'\n" >> /jffs/amtm-disk-check.log
 
You copied over an unescaped variable which has been corrected in the last amtm commit:
Code:
printf "\n$(date) Starting '$CHKCMD $1'\n" >> /jffs/amtm-disk-check.log
Will deleting and reinstalling the script fix this now? I ask because after two security updates from RMerlin in as many days I am getting unknown file types again.
Code:
Sat Mar 24 19:19:54 PDT 2018 Unknown filesystem type  on /dev/sda1 - skipping check.
Sun Mar 25 12:52:01 PDT 2018 Unknown filesystem type  on /dev/sda1 - skipping check.
Or I guess I can just edit it myself. My knowledge has gone up by x10 since hanging out and installing these router add-ons. That is a good thing. :D
 
Will deleting and reinstalling the script fix this now? I ask because after two security updates from RMerlin in as many days I am getting unknown file types again.
Code:
Sat Mar 24 19:19:54 PDT 2018 Unknown filesystem type  on /dev/sda1 - skipping check.
Sun Mar 25 12:52:01 PDT 2018 Unknown filesystem type  on /dev/sda1 - skipping check.
Or I guess I can just edit it myself. My knowledge has gone up by x10 since hanging out and installing these router add-ons. That is a good thing. :D
Force updating amtm and then removing and reinstalling the disk check through it will do.
But this is just the entry in the disk check log file.
Instead of something like "e2fsck -p install" it now correctly says "e2fsck -p <device it is checking>".
I made this commit 18 days ago.
 
This is all I see with "fdisk -h" via ssh to the AC86U.
Can you please run frisk /dev/sda (if that’s your USB drive) and type m in interactive mode?

That’s the output I posted and would like to compare.

You can use q afterwards to quit without modifying anything.
 

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