What's new

amtm Disk Check cannot fix the errors on USB flash

  • 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!

netware5

Very Senior Member
Hi guys! The Entware won't update. I decided to check the AMTM Disk Check log.
Code:
Wed Jun 14 21:39:09 DST 2023 Waited 26s for NTP to sync date
Wed Jun 14 21:39:09 DST 2023 Probing 'ext2' on device /dev/sda1
Running disk check v3.1, with command 'e2fsck -p' on /dev/sda1
Data contains a file system with errors, check forced.
Data: Inode 475023, i_blocks is 16, should be 8.  FIXED.
Data: Deleted inode 475162 has zero dtime.  FIXED.
Data: Deleted inode 475169 has zero dtime.  FIXED.
Data: Deleted inode 475171 has zero dtime.  FIXED.
Data: Deleted inode 475226 has zero dtime.  FIXED.
Data: Deleted inode 475247 has zero dtime.  FIXED.
Data: Deleted inode 475268 has zero dtime.  FIXED.
Data: Inode 498745, i_blocks is 24, should be 8.  FIXED.
Data: Inode 498760, i_blocks is 1952, should be 1904.  FIXED.
Data: Unattached inode 475036


Data: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
        (i.e., without -a or -p options)
Wed Jun 14 21:39:17 DST 2023 Disk check done on /dev/sda1

Fri Jun 16 19:37:54 DST 2023 Waited 89s for NTP to sync date
Fri Jun 16 19:37:54 DST 2023 Probing 'ext2' on device /dev/sda1
Running disk check v3.1, with command 'e2fsck -p' on /dev/sda1
Data contains a file system with errors, check forced.
Data: Unattached inode 475036


Data: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
        (i.e., without -a or -p options)
Fri Jun 16 19:38:06 DST 2023 Disk check done on /dev/sda1

Fri Jun 16 20:02:51 DST 2023 Waited 24s for NTP to sync date
Fri Jun 16 20:02:51 DST 2023 Probing 'ext2' on device /dev/sda1
Running disk check v3.1, with command 'e2fsck -p' on /dev/sda1
Data contains a file system with errors, check forced.
Data: Unattached inode 475036


Data: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
        (i.e., without -a or -p options)
Fri Jun 16 20:03:04 DST 2023 Disk check done on /dev/sda1

Then try to run e2fsck manually, but it says that filesystem is mounted. Then I unmounted it. Now e2fsck says the device is busy. Any ideas what to do?
 
Time to use an SSD in an external USB enclosure. Looks like the drive is done.
 
Then try to run e2fsck manually, but it says that filesystem is mounted. Then I unmounted it. Now e2fsck says the device is busy. Any ideas what to do?
Disable custom scripts in the GUI and reboot the router. Then unmount the drive (if it's mounted) from the GUI. Now run e2fsck again.
 
Disable custom scripts in the GUI and reboot the router. Then unmount the drive (if it's mounted) from the GUI. Now run e2fsck again.
Did it and now the file system is clean. Thank you for the advice! But the problem with Entware update persisted. The AMTM says that 35 packages should be updated, but after running update nothing happens. Solved the problem by running manually "opkg upgrade" and everything went fine. Maybe there is a problem with AMTM script for Entware update?
 
Could be - but as others have noted here in the thread - that disk might be on its last legs...

I would consider replacing it - can be another thumb drive perhaps, but I would suggest either spinning rust (HDD) or an SSD...
 
Could be - but as others have noted here in the thread - that disk might be on its last legs...

I would consider replacing it - can be another thumb drive perhaps, but I would suggest either spinning rust (HDD) or an SSD...
Yes, the flash might be on its last legs and I am prepared for that. But this does not explain why when the disk FS is clean the AMTM failed to upgrade Entware packages while the opkg manual upgrade went fine.
 
What commands do you use for disk check on the router
 
What commands do you use for disk check on the router
That depends on which filesystem type you are using. In the case above the OP was using an ext2, 3 or 4 filesystem so the appropriate command was e2fsck. If you enable the amtm dc option it will automatically run the correct command when the filesystem is mounted.
 
That depends on which filesystem type you are using. In the case above the OP was using an ext2, 3 or 4 filesystem so the appropriate command was e2fsck. If you enable the amtm dc option it will automatically run the correct command when the filesystem is mounted.
05DA7990-ED48-446A-8D11-1D46092302F3.png

Not sure how to use this
 
I’m aware but I’m tryna run a disk check on my usb how do I do that
Reboot the router. On startup, just before each filesystem is mounted it will perform a disk check. You can see the results of the disk check by either looking in the syslog or using the dcl option in amtm.
 
Hi!

My USB drive is going to die soon. The check tool reports errors (EXT2) but I cannot repair them because the drive is automatically mounted - Entware and scripts are installed on it. I am going to replace it by a SSD. But how can I unmount the drive and repair it in the meantime without tempering with Entware?
 
Hi!

My USB drive is going to die soon. The check tool reports errors (EXT2) but I cannot repair them because the drive is automatically mounted - Entware and scripts are installed on it. I am going to replace it by a SSD. But how can I unmount the drive and repair it in the meantime without tempering with Entware?
Turn off the router and pull the drive out, then restart the router.
 
Hi!

My USB drive is going to die soon. The check tool reports errors (EXT2) but I cannot repair them because the drive is automatically mounted - Entware and scripts are installed on it. I am going to replace it by a SSD. But how can I unmount the drive and repair it in the meantime without tempering with Entware?
See post #3.
 
Alternatively, configure the Entware filesystem to be checked almost every reboot automatically. Adjust the device name of this example if necessary.
See settings
Code:
tune2fs -l /dev/sda1
Change settings
Code:
tune2fs -c 1 -i 1d /dev/sda1
Also, consider journaled ext4 next time.
 
Last edited:

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