What's new

amtm reports pkg_get_installed-Files: Failed to open

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

badtoast

Occasional Visitor
Hi,

I am running into a couple of odd things. My RT-AC86U seem to be working relatively OK (can browse the internet via VPN, access my LAN (and solidly after 4 years), but it has been acting a little funny. My internet kept dropping 1-3x daily the past few days.

When I run amtm and select 'u' to check for script updates, I am receiving this message:

" pkg_get_installed_files: Faily to open //opt/lib/opkg/info/p7zip.list: Input/output error. "

1666301845427.png


When I navigate to that directory, I do NOT see any such file. Does any one know how to restore "p7zip.list"? Do I even need p7zip? I'm not sure if there are any other of the packages depends on p7zip...

I tried to create a file with by that very name using 'nano' but I get an error:

1666302069563.png


I tried:

opkg install p7zip

Which gives me the same message:

"Collected errors:
* pkg_get_installed_files: Failed to open //opt/lib/opkg/info/p7zip.list: Input/output error."

I then tried:

opkg install p7zip --force-reinstall

Which gives me this:

"Installing p7zip (16.02-3) to root...
Downloading https://bin.entware.net/aarch64-k3.10/p7zip_16.02-3_aarch64-3.10.ipk
Collected errors:
* pkg_get_installed_files: Failed to open //opt/lib/opkg/info/p7zip.list: Input/output error.
* pkg_write_filelist: Failed to open //opt/lib/opkg/info/p7zip.list: Input/output error.
* opkg_install_pkg: Failed to extract data files for p7zip. Package debris may remain!
* opkg_install_cmd: Cannot install package p7zip."

-----------------------------------

On a different (maybe related?) note, it appears I may have some USB ext4 errors too. When I run this:

cat /jffs/addons/amtm/amtm-dsik-check.log

I get:

1666302251708.png


Please help!
 
Last edited:
Likely to be a side effect of the corrupted disk filesystem. Do as the error message indicates; unmount the disk and run e2fsck manually.
 
Thanks for your quick reply. I unmounted the USB disk and ran fsck. I gives me this:

fsck (busybox 1.25.1, 2022-07-24 17:39:08 EDT)

When I type e2fsck, I just instruction on how to use e2fsck. It appears I need to provide it with a device (along with options). I plugged my USB flash drive back in and ran:

e2fsck -p /dev/sdb1

Which returned:

/dev/sdb1 is mounted.
e2fsck: Cannot continue, aborting.
 
Make a note of the current device name (as it can change). It appears to currently be /dev/sdb1 whereas it was previously /dev/sda1. Then unmount the disk. Then issue the command as instructed (i.e. without the -p option):

Code:
e2fsck /dev/sdb1

Do you have any other disk partitions, or other disks?
 
I think it changed because I moved the disk from the USB 3.0 slot to the USB 2.0 slot (I read somewhere on the SNB forums that running scripts off USB is best when using USB 2.0 instead of 3.0.

I only have the following:

xxxx@router:/tmp/mnt/PNY_30GB# fdisk -l

Disk /dev/sdb: 31.0 GB, 31029460992 bytes
64 heads, 32 sectors/track, 29592 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 29592 30302192 83 Linux

I tried to unmount (this time using the command line instead of clicking "Safely remove disk" from the GUI). I get the following:

xxxx@router:/tmp/mnt/PNY_30GB# umount /dev/sdb1
umount: can't unmount /tmp/mnt/PNY_30GB: Device or resource busy

I'm guessing this is because other scripts are running. How do I safely stop them?

1666305523507.png
 
Make a note of the current device name (as it can change). It appears to currently be /dev/sdb1 whereas it was previously /dev/sda1. Then unmount the disk. Then issue the command as instructed (i.e. without the -p option):

Code:
e2fsck /dev/sdb1

Do you have any other disk partitions, or other disks?

Only other partition he is likely to have is swap.


umount -l /PATH/OF/BUSY-DEVICE
 
Last edited:
I'm guessing this is because other scripts are running. How do I safely stop them?
Sorry, I don't know as I don't use those scripts. Perhaps the easiest thing to do is to go into the GUI and set "Enable JFFS custom scripts and configs" to "No", apply and then reboot. Afterwards you should be able to unmount the disk via the GUI.
 
Avoid using the gui disk check as far as I know it’s not compatible with entware as the stock asuswrt features uses the older deprecated optware.
 
I'm not a fan of lazy unmounts. The router often ends up doing that eventually anyway and it almost guarantees a corrupted filesystem.

That’s true. I only suggested it since he already has a corrupt file system.
 
OK! I think I got things up and running. I disabled JFFS scripts and configs from the GUI.

Then, I checked for the correct device name and unmounted:

xxxx@router:/tmp/home/root# fdisk -l

Disk /dev/sda: 31.0 GB, 31029460992 bytes
64 heads, 32 sectors/track, 29592 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

Device Boot Start End Blocks Id System
/dev/sda1 1 29592 30302192 83 Linux


xxxx@router:/tmp/home/root# umount /dev/sda1

Then I issued the command "e2fsck /dev/sda1", hitting 'y' for 'yes' for all prompts:

xxxx@router:/tmp/home/root# e2fsck /dev/sda1
e2fsck 1.45.6 (20-Mar-2020)
PNY_30GB contains a file system with errors, check forced.
Pass 1: Checking inodes, blocks, and sizes
Inode 1047293 has corrupt extent header. Clear inode<y>? yes
Inode 1047293, i_blocks is 8, should be 0. Fix<y>? yes
Inode 1047295 has a extra size (32796) which is invalid
Fix<y>? yes
Inode 1047296 has an invalid extent
(logical block 0, invalid physical block 541073506, len 1)
Clear<y>? yes
Inode 1047296 is a zero-length directory. Clear<y>? yes
Inode 1047299 is in use, but has dtime set. Fix<y>? yes
Pass 2: Checking directory structure
Entry 'p7zip.list' in /entware/lib/opkg/info (1046549) has deleted/unused inode 1047293. Clear<y>? yes
Entry 'iface' in /entware/etc/hotplug.d (1047295) has deleted/unused inode 1047296. Clear<y>? yes
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Unattached inode 1047025
Connect to /lost+found<y>? yes
Inode 1047025 ref count is 2, should be 1. Fix<y>? yes
Inode 1047295 ref count is 2051, should be 2. Fix<y>? yes
Unattached inode 1047299
Connect to /lost+found<y>? yes
Inode 1047299 ref count is 65, should be 1. Fix<y>? yes
Pass 5: Checking group summary information
Block bitmap differences: -1093762 -4202594
Fix<y>? yes
Free blocks count wrong for group #33 (27700, counted=27701).
Fix<y>? yes
Free blocks count wrong for group #128 (24482, counted=24483).
Fix<y>? yes
Free blocks count wrong (6861843, counted=6861845).
Fix<y>? yes
Inode bitmap differences: -1047293 -1047296 +1047299
Fix<y>? yes
Free inodes count wrong for group #128 (7526, counted=7527).
Fix<y>? yes
Directories count wrong for group #128 (78, counted=77).
Fix<y>? yes
Free inodes count wrong (1896139, counted=1896140).
Fix<y>? yes
PNY_30GB: ***** FILE SYSTEM WAS MODIFIED *****
PNY_30GB: 692/1896832 files (1.2% non-contiguous), 713703/7575548 blocks

Then I rebooted the router. Went back into the GUI, re-enabled JFFS scripts and configs, restarted the router. When I check the amtm disk check logs, I now see these lines:

xxxx@router:/jffs/addons/amtm# cat amtm-disk-check.log

....

Thu Oct 20 18:06:32 EST 2022 Probing 'ext4' on device /dev/sda1
Running disk check v3.1, with command 'e2fsck -p' on /dev/sda1
PNY_30GB contains a file system with errors, check forced.
PNY_30GB: Inode 1047293 has corrupt extent header.

PNY_30GB: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
(i.e., without -a or -p options)
Thu Oct 20 18:06:32 EST 2022 Disk check done on /dev/sda1

Thu Oct 20 18:29:55 EST 2022 Probing 'ext4' on device /dev/sda1
Running disk check v3.1, with command 'e2fsck -p' on /dev/sda1
PNY_30GB: clean, 692/1896832 files, 713704/7575548 blocks
Thu Oct 20 18:29:57 EST 2022 Disk check done on /dev/sda1

I think I should be good to go! Thank so you much @ColinTaylor and @DJones !
 
Thanks for the update @badtoast, that looks promising.

For future reference if anyone else encounters this, after rebooting with scripts disabled it is preferable to try and unmount the drive using the GUI rather than the command line. The reason being that the drive could still be in use by Asus USB applications (e.g. Samba, Media Server, etc.). These things might prevent the unmounting from the command line, whereas using the GUI shuts these processes down before unmounting.
 

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