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!

That could be the common issue here, I use MiniTool Partition Wizard to format the drive
I'm reluctant to add more filesystem support ATM for lack of time to test these identifiers. Don't want the disk-check to run the wrong test on a disk.
But it you have the time, or anyone else for that matter, change the case statement around line 320 in the disk_check() function in amtm to include it. Then remove and re-install dc to write the new disk-check file.

Be cautious though, your data is more important than the result a failed test....
 
So @Adamm to expand on the above:
The criteria to run the check is the argument passed on to pre-mount during boot: The device location as seen by fdisk -l
And then the case statement is used to determine if a supported disk is found by: System with fdisk -l
The disk-check also only runs on USB mounted disks, be they thumb drives, SSD's or HDD's. No internal filesystems are checked, like the jffs partition.
Disk /dev/sda: 15.7 GB, 15728640000 bytes
64 heads, 32 sectors/track, 15000 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

Device Boot Start End Blocks Id System
/dev/sda1
1 7500 7679984 83 Linux
/dev/sda2
7501 15000 7680000 83 Linux
 
Forgot to escape the $1 positional parameter in the code, I have pushed an update to GitHub.
Use u and dc twice for the logfile to correctly report the device path the test is run on (it says "install" instead of path ATM).
 
What's your output of
Code:
fdisk -l
Code:
Disk /dev/sda1: 30.7 GB, 30752620544 bytes
64 heads, 32 sectors/track, 29327 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

Disk /dev/sda1 doesn't contain a valid partition table
 
Code:
Disk /dev/sda1: 30.7 GB, 30752620544 bytes
64 heads, 32 sectors/track, 29327 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

Disk /dev/sda1 doesn't contain a valid partition table
That's unfortunate and may be the cause of many of the disk failures we've seen around here.
Additionally, that error prevents the auto-run of the disk-check.

I do not have a cure, someone with better understanding of filesystems will have to offer more insight and a solution.
A search for the error returns many results.
 
PS: Come to think of it; this flash drive might actually be formatted using mke2fs on the router itself (because I could not assign a label).
 
Question,

What I did was install AB-Solution, entware & pixel serv, swap file (from ABS menu), finally amtm & dc
Is it really necessary to avoid issues to do entware>amtm>swap>ab>pixelserv?

Thanks,

Sent from my SM-G935FD using Tapatalk
 
Question,

What I did was install AB-Solution, entware & pixel serv, swap file (from ABS menu), finally amtm & dc
Is it really necessary to avoid issues to do entware>amtm>swap>ab>pixelserv?

Thanks,

Sent from my SM-G935FD using Tapatalk
The order should be amtm>ab-solution (while in ab-solution install pixelsrv-tls by using "ps" this intsalls entware)>add swap>done.
 
The above is to avoid issues.
 
So @Adamm to expand on the above:
The criteria to run the check is the argument passed on to pre-mount during boot: The device location as seen by fdisk -l
And then the case statement is used to determine if a supported disk is found by: System with fdisk -l
The disk-check also only runs on USB mounted disks, be they thumb drives, SSD's or HDD's. No internal filesystems are checked, like the jffs partition.

So I spent a bunch of time trying to track down what the issue is here, and the only conclusion I've come to is that the script uses a pretty unreliable method of detection.

I think part of the issue comes down to fdisk limitations dealing with GPT partitions. I'm going to assume you use MBR, or maybe I'm wrong. I tried formatting with a number of tools and even Ubuntu in a VM, each time the same result when it was a GPT partition.
 
So I spent a bunch of time trying to track down what the issue is here, and the only conclusion I've come to is that the script uses a pretty unreliable method of detection.

I think part of the issue comes down to fdisk limitations dealing with GPT partitions. I'm going to assume you use MBR, or maybe I'm wrong. I tried formatting with a number of tools and even Ubuntu in a VM, each time the same result when it was a GPT partition.
I only copied the code from the original script and assumed it works for most. I certainly never had a problem with my devices.
Maybe there's a better way to detect the device before it's mounted. I have open ears and eyes.
 
I only copied the code from the original script and assumed it works for most. I certainly never had a problem with my devices.
Maybe there's a better way to detect the device before it's mounted. I have open ears and eyes.

Well I think a good starting point is to see on devices where this does work, are you using a MBR partition or a GPT partition?
 
Well I think a good starting point is to see on devices where this does work, are you using a MBR partition or a GPT partition?
How do you tell the difference?
 
Well I think a good starting point is to see on devices where this does work, are you using a MBR partition or a GPT partition?
MBR, on all of them.
Will do some testing tomorrow, what should I partition them with?
Some pointers would help.
 
How do you tell the difference?

Naively on the router to check this you would need to download a tool like parted from entware;

Code:
opkg install parted

Then run;

Code:
parted -l

Which would give a result similar to;

Code:
admin@RT-AC86U-2EE8:/jffs/scripts# parted -l
Model: WD Elements 25A2 (scsi)
Disk /dev/sdb: 2000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name                  Flags
 1      1049kB  2000GB  2000GB  ext4         Basic data partition  msftdata
 
Mine looks like this using your above commands:
Code:
Model: SanDisk Ultra Fit (scsi)
Disk /dev/sda: 15.4GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start   End     Size    Type     File system  Flags
 1      16.4kB  15.4GB  15.4GB  primary  ext2
The rest of the results were:
Code:
Error: /dev/mtdblock0: unrecognised disk label
Model: Unknown (unknown)
Disk /dev/mtdblock0: 524kB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:

Error: /dev/mtdblock1: unrecognised disk label
Model: Unknown (unknown)
Disk /dev/mtdblock1: 1573kB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:

Error: /dev/mtdblock2: unrecognised disk label
Model: Unknown (unknown)
Disk /dev/mtdblock2: 65.0MB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:

Error: /dev/mtdblock3: unrecognised disk label
Model: Unknown (unknown)
Disk /dev/mtdblock3: 63.2MB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:

Error: /dev/mtdblock4: unrecognised disk label
Model: Unknown (unknown)
Disk /dev/mtdblock4: 67.1MB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:
 
MBR, on all of them.
Will do some testing tomorrow, what should I partition them with?
Some pointers would help.

Just partition any drive with a GPT partition table, then format a ext* partition like normal. Just about every partitioning tool has an option of what table type to use, a quick google with your tool/os of choice will give you a good guide.


FYI; its just the detection that's "broken", the filesystem check its-self works as expected.

Code:
admin@RT-AC86U-2EE8:/tmp/home/root# e2fsck -p /dev/sda1
Elements: Backing up journal inode block information.

Elements: clean, 411/488374272 files, 30567798/488369920 blocks
admin@RT-AC86U-2EE8:/tmp/home/root#
 
Partition Table: msdos

This line indicates you are using MBR (so I also assume the script works for you).

Code:
bsd
dvh
gpt    - this is a GPT partition table
loop   - this is raw disk access without a partition table
mac
msdos  - this is a standard MBR partition table
pc98
sun
 
These are my results in amtm:
Code:
 ---------------------------------------------------
 /jffs/amtm-disk-check.log has this content:

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

 Tue Mar  6 11:44:51 GMT 2018 Starting 'e2fsck -p /dev/sda1'
 EXT2: clean, 585/940240 files, 351399/3753902 blocks
 ---------------------------------------------------
 END FILE
 
For me (the script fails):
Code:
# parted -l /dev/sda1
Model: SanDisk Ultra Fit (scsi)
Disk /dev/sda: 30.8GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start   End     Size    Type     File system  Flags
 1      16.4kB  30.8GB  30.8GB  primary  ext2         lba
 

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