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!

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
Strange you have the same drive as I do just twice as big. Mine works.
 
The only method I can see to making this work is having the script require the parted utility from entware and phrasing that output instead.

Code:
admin@RT-AC86U-2EE8:/jffs/scripts# parted /dev/sda print
Model: WD Elements 25A2 (scsi)
Disk /dev/sda: 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

admin@RT-AC86U-2EE8:/jffs/scripts#

In theory that should solve everyone's issues at once no-matter what method they used to format their device.
 
The only method I can see to making this work is having the script require the parted utility from entware and phrasing that output instead.
That will not work, the disk check runs before devices are mounted.
 
Last edited:
I was having the same problem with the disk check as described in preceding messages. After playing with it for a while, I concluded the problem was not with FORMATTING but with PARTITIONING.

I set up the flash drive a long time ago -- but apparently it was partitioned as FAT32 (the out-of-box default) and I just used mkfs.ext2 to format it without re-partitioning. Mkfs.ext2 is perfectly happy to format a partition marked FAT32 with EXT2, and Mount looks at the file system and sees EXT2... But "Fdisk -l" looks at the partition type code in the partition table, and therefore still reports it as FAT32.

So my fix was:
1. Pop in another USB flash drive in the second USB port,
2. Use fdisk to delete the existing partition, create a new partition, and make sure it was type 83,
3. Format it with mkfs.ext2,
4. Mount it as /tmp/mnt/NEW,
5. Use rsync to copy everything from the old drive to /tmp/mnt/NEW,
6. Umount /tmp/mnt/NEW,
7. Use tune2fs to set the label the same as my old drive's label,
8. Turn off the router,
9. Pull both drives out and put the "new" one where the "old" one was,
10. Turn on the router.

SUCCESS. Fdisk now properly reports it as "Linux", and the disk check is run at reboot.

Now it seems like one MIGHT be able to just use Fdisk to change the partition code -- not sure if that is "destructive" to any data or not. In theory, just changing the partition type code to 83 would have fixed it, but I was uncomfortable trying that because I wasn't positive it wouldn't cause data loss.

The NEW PROBLEM: I sometimes get the "Could not start Entware", because the disk check (when not clean) takes longer than the 30 seconds allowed by the loop in services-start. It seems to take about 35 seconds. Any reason to not just change the "I=30" to "I=60" in services-start?
 
Last edited:
I was having the same problem with the disk check as described in preceding messages. After playing with it for a while, I concluded the problem was not with FORMATTING but with PARTITIONING.

Apparently the flash drive I was using was partitioned as FAT32 -- then I used mke2fs or mkfs.ext2 to format it. Mount looks at the file system and sees EXT2, but "Fdisk -l" apparently just looks at the partition code and therefore reports it as FAT32.

So my fix was:
1. Pop in another USB flash drive in the second USB port,
2. Use fdisk to delete the existing partition, create a new partition, and make sure it was type 83,
3. Format it with mkfs.ext2,
4. Mount it as /tmp/mnt/NEW,
5. Use rsync to copy everything from the old drive to /tmp/mnt/NEW,
6. Umount /tmp/mnt/NEW,
7. Use tune2fs to set the label the same as my old drive's label,
8. Turn off the router,
9. Pull both drives out and put the "new" one where the "old" one was,
10. Turn on the router.

SUCCESS. Fdisk now properly reports it as "Linux", and the disk check is run at reboot.

Now it seems like one MIGHT be able to just use Fdisk to change the partition code -- not sure if that is "destructive" to any data or not. In theory, just changing the partition type code to 83 would have fixed it, but I was uncomfortable trying that because I wasn't positive it wouldn't cause data loss.

The NEW PROBLEM: I sometimes get the "Could not start Entware", because the disk check takes longer than the 30 seconds allowed by the loop in services-start. It seems to take about 35 seconds. Any reason to not just change the "I=30" to "I=60" in services-start?
Scroll down to "Gotchas" here.
https://github.com/RMerl/asuswrt-merlin/wiki/USB-Disk-Check-at-Boot
 
The NEW PROBLEM: I sometimes get the "Could not start Entware", because the disk check takes longer than the 30 seconds allowed by the loop in services-start. It seems to take about 35 seconds. Any reason to not just change the "I=30" to "I=60" in services-start?
I also wish that this script along with the timer was gone for good to start rc-unslung.
AB-Solution 4 will finally make that dream come true - when its out.

Edit: Just increase it.
 
Yeah, already saw that... But I'm using ab-solution -- and if I'm reading that correctly, increasing the delay loop is the only real solution, right?
I'll defer to one of the script pros on that. I only saw that once maybe a month ago on my 68u after i started with the original script. Never saw that again or now with the 86u. I booted many times yesterday cleaning up the mess I made for myself trying to upgrade to Entware-3x. the wrong horribly wrong way. :oops:
 
I was having the same problem with the disk check as described in preceding messages. After playing with it for a while, I concluded the problem was not with FORMATTING but with PARTITIONING.

Apparently the flash drive I was using was partitioned as FAT32 -- then I used mke2fs or mkfs.ext2 to format it. Mount looks at the file system and sees EXT2, but "Fdisk -l" apparently just looks at the partition code and therefore reports it as FAT32.

So my fix was:
1. Pop in another USB flash drive in the second USB port,
2. Use fdisk to delete the existing partition, create a new partition, and make sure it was type 83,
3. Format it with mkfs.ext2,
4. Mount it as /tmp/mnt/NEW,
5. Use rsync to copy everything from the old drive to /tmp/mnt/NEW,
6. Umount /tmp/mnt/NEW,
7. Use tune2fs to set the label the same as my old drive's label,
8. Turn off the router,
9. Pull both drives out and put the "new" one where the "old" one was,
10. Turn on the router.

SUCCESS. Fdisk now properly reports it as "Linux", and the disk check is run at reboot.
Yes increasing to 60 is a good idea.
Now it seems like one MIGHT be able to just use Fdisk to change the partition code -- not sure if that is "destructive" to any data or not. In theory, just changing the partition type code to 83 would have fixed it, but I was uncomfortable trying that because I wasn't positive it wouldn't cause data loss.

The NEW PROBLEM: I sometimes get the "Could not start Entware", because the disk check (when not clean) takes longer than the 30 seconds allowed by the loop in services-start. It seems to take about 35 seconds. Any reason to not just change the "I=30" to "I=60" in services-start?
Yes increase to 60 to make things load right.
 
thelonelycoder said:
Just increase it.
Done! Thanks. (Also good to hear AB4 will provide a new method!)

I'll defer to one of the script pros on that. I only saw that once maybe a month ago on my 68u after i started with the original script. Never saw that again or now with the 86u. I booted many times yesterday cleaning up the mess I made for myself trying to upgrade to Entware-3x. the wrong horribly really wrong way. :oops:
I hear you... I'm not a "linux guy" and am out of my element here.... I learned way more than I wanted to about Fdisk and partitions today. One thing I learned is that if you type "fdisk /dev/sdb1" it is perfectly happy to create new partitions within the partition sdb1" -- cool, but not what I wanted. After banging my head on the table several times, I finally realized I needed "/dev/sdb" for fdisk, but "/dev/sdb1" for mkfs.ext2. All makes perfect sense, and the people with Linux experience reading this can rightfully tell me what a dumb noob I am! :rolleyes:
 
Not me calling you a dumb noob. I've used Linux off and on for 20+ years and still screw up big time. Just cannot resist the "oh, look, a new version" syndrome. :D But I learn well that way.
 
I have pushed an amtm update, no version change

This removes the ability to install Entware through amtm for the time being until things have settled down with the abruptly made changes by the Entware maintainers.
Due to the now obsolete firmware built in entware-setup.sh script that amtm uses, the ability to install Entware through it will be pushed into the far future as @john9527 and @RMerlin need to incorporate the changes in a new release of the firmware.
 
I got an error as my premount isn't empty. I have those 2 lines but can't remember what script added them and what they do..
Any help please ? Thanks:
logger -t $(basename $0) "started [$@]"

grep -q $1 /proc/mounts || e2fsck -p $1 2>&1 | logger -t e2fsck
 
I got an error as my premount isn't empty. I have those 2 lines but can't remember what script added them and what they do..
Any help please ? Thanks:
logger -t $(basename $0) "started [$@]"

grep -q $1 /proc/mounts || e2fsck -p $1 2>&1 | logger -t e2fsck
This is my 4000 th post on SNB!

This code is a simplified version of that script. Save it and remove the file or keep it.
If it served you well and you don't want the separate logfile then I woud keep it.
 
And thanks @Adamm for your recent changes, that cat was useless for the display of the log file. sed and awk can do most of what one does with grep and cat and a pipe.
 
Dumb question, why even when installed sometimes typing amtm does not launch the terminal GUI? but ab-solutionterminalngui does?

Sent from my SM-G935FD using Tapatalk
 

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