What's new

[HELP] Entware couldn't unlink /opt/var/lock/opkg.lock

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

Cigaras

Occasional Visitor
I try to install nano using entware, and this is what I get:

Code:
ASUSWRT-Merlin RT-N66U_3.0.0.4 Sat Nov 30 23:02:36 UTC 2013
Cigaras@RT-N66U:/tmp/home/root# opkg install nano
Installing nano (2.2.6-1b) to root...
Downloading http://wl500g-repo.googlecode.com/svn/ipkg/openwrt/nano_2.2.6-1b_entware.ipk.
Configuring nano.
Collected errors:
 * opkg_conf_deinit: Couldn't unlink /opt/var/lock/opkg.lock: No space left on device.
Cigaras@RT-N66U:/tmp/home/root#

what is it? how can i fix it? Entware is installed on USB stick, 8GB.
 
"No space left on device"
It may mean:
1) USB stick is not mounted
2) USB stick is mounted read-only
3) USB stick is really out of space
 
1) The content of USB stick is accessible over WinSCP (/tmp/mnt/sda1) so it is mounted;
2) I do not know how to check it or change it, but WinSCP shows 0777 for permissions;
3) Also do not know how to check it, but it has 8GB capacity, unless there is some kind of big cache file taking all the space... I tried calculating space in WinSCP ang the result was 4.331 KiB (4.434.971 B).

I also can not uninstall stuff from it, nor delete, and am not sure what to do, remove the USB stick, format it under windows ar reset router to factory settings?
 
Last edited:
1) The content of USB stick is accessible over WinSCP (/mnt/sda1) so it is mounted;
2) I do not know how to check it or change it;
3) Also do not know how to check it, but it has 8GB capacity, unless there is some kind of big cache file taking all the space...

2) just run the command mount it will show you all mount points with the option rw for example is for read / write
3) command is df which shows the space for all mount points. ( You also see this in the GUI -> Network MAP -> USB and switch there to the USB Stick and it will show you the space.)
 
2) Result of command "mount":
Code:
Cigaras@RT-N66U:/tmp/home/root# mount
rootfs on / type rootfs (rw)
/dev/root on / type squashfs (ro)
proc on /proc type proc (rw)
tmpfs on /tmp type tmpfs (rw)
devfs on /dev type tmpfs (rw,noatime)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw)
/dev/mtdblock4 on /jffs type jffs2 (rw,noatime)
usbfs on /proc/bus/usb type usbfs (rw)
/dev/sda1 on /tmp/mnt/sda1 type ext3 (rw,nodev,noatime,data=ordered)

3) Result of command "df":
Code:
Cigaras@RT-N66U:/tmp/home/root# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/root                25088     25088         0 100% /
tmpfs                   119856      2980    116876   2% /tmp
devfs                   119856         0    119856   0% /dev
/dev/mtdblock4            5632       448      5184   8% /jffs
/dev/sda1              7466525      4782   7080931   0% /tmp/mnt/sda1

What all those nodev, noatime, data=ordered mean? But they do not look problematic to me...
 
Last edited:
2) Result of command "mount":
Code:
Cigaras@RT-N66U:/tmp/home/root# mount
rootfs on / type rootfs (rw)
/dev/root on / type squashfs (ro)
proc on /proc type proc (rw)
tmpfs on /tmp type tmpfs (rw)
devfs on /dev type tmpfs (rw,noatime)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw)
/dev/mtdblock4 on /jffs type jffs2 (rw,noatime)
usbfs on /proc/bus/usb type usbfs (rw)
/dev/sda1 on /tmp/mnt/sda1 type ext3 (rw,nodev,noatime,data=ordered)

3) Result of command "df":
Code:
Cigaras@RT-N66U:/tmp/home/root# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/root                25088     25088         0 100% /
tmpfs                   119856      2980    116876   2% /tmp
devfs                   119856         0    119856   0% /dev
/dev/mtdblock4            5632       448      5184   8% /jffs
/dev/sda1              7466525      4782   7080931   0% /tmp/mnt/sda1

What all those nodev, noatime, data=ordered mean? But they do not look problematic to me...

well this looks all fine as the partitions is rw so we can write on it. Also its almost empty as we can see 0 % used.

But what I don't see is the mount point for /opt which should be located on the USB stick. Which of the howto's you followed for the setup ? Definitive some is not correct. Check out this:

https://github.com/RMerl/asuswrt-merlin/wiki/Entware
 
That is the instruction I followed, I used the entware-setup.sh script, and the /opt folder is present, I can cd to it:

Code:
ASUSWRT-Merlin RT-N66U_3.0.0.4 Fri Mar  7 01:35:26 UTC 2014
Cigaras@RT-N66U:/tmp/home/root# cd /opt
Cigaras@RT-N66U:/tmp/mnt/sda1/entware#

Can I mount it manualy? Or reinstall somehow without removing the installed packages?
 
Last edited:
That is the instruction I followed, I used the entware-setup.sh script, and the /opt folder is present, I can cd to it:

Code:
ASUSWRT-Merlin RT-N66U_3.0.0.4 Fri Mar  7 01:35:26 UTC 2014
Cigaras@RT-N66U:/tmp/home/root# cd /opt
Cigaras@RT-N66U:/tmp/mnt/sda1/entware#

Can I mount it manualy? Or reinstall somehow without removing the installed packages?

OK thats fine also as you run the cd command and you going to the folder /tmp/mnt/sda1/entware .... so that's fine. (I just saw that this is symlink)

So I don't know. By the way is the opkg update working ? You could try to delete or better move the file /opt/var/lock/opkg.lock to a different place, maybe this file has some issues. When its also not working than than copy the file back to its original location.
 
I can not delete or move it, I get the same error :(
Code:
Command 'rm -f -r "opkg.lock"'
failed with return code 1 and error message
rm: can't remove 'opkg.lock': No space left on device.

Also the file is empty, 0 bytes in size...
 
so the opkg update is also not working I guess ?
I`m out of Ideas now for this problem.....
 
Yes, update does not work either, nothing works that required writing to USB stick...
Code:
Cigaras@RT-N66U:/tmp/mnt/sda1/entware# opkg update xupnpd
Downloading http://wl500g-repo.googlecode.com/svn/ipkg/openwrt/Packages.gz.
Collected errors:
 * copy_file: unable to close `/opt/var/opkg-lists/openwrt': Read-only file system.
 * copy_file: unable to preserve times of `/opt/var/opkg-lists/openwrt': Read-only file system.
 * copy_file: unable to preserve ownership of `/opt/var/opkg-lists/openwrt': Read-only file system.
 * copy_file: unable to preserve permissions of `/opt/var/opkg-lists/openwrt': Read-only file system.
 * file_copy: Failed to copy file /tmp/opkg-60ixmI/Packages.gz to /opt/var/opkg-lists/openwrt.
 * opkg_conf_deinit: Couldn't unlink /opt/var/lock/opkg.lock: Read-only file system.
Last error might be because xupnpd is running, so I killed it, and got following:
Code:
Cigaras@RT-N66U:/tmp/mnt/sda1/entware# killall xupnpd
Cigaras@RT-N66U:/tmp/mnt/sda1/entware# opkg update xupnpd
Collected errors:
 * opkg_conf_load: Could not create lock file /opt/var/lock/opkg.lock: Read-only file system.

After some googling I found out that Linux likes to make file system read-only when errors occur, and the best way to find out more info is to use "dmesg" command, however I've got a huge answer for that, but If someone more experienced could look at this, I'd be super grateful :) There is a part that looks suspicious to me:
Code:
EXT3-fs: starting recovery.
kjournald starting.  Commit interval 5 seconds
EXT3-fs warning (device sda1): ext3_clear_journal_err: Filesystem error recorded from previous mount: IO failure
EXT3-fs warning (device sda1): ext3_clear_journal_err: Marking fs in need of filesystem check.
EXT3-fs warning: mounting fs with errors, running e2fsck is recommended
EXT3 FS on sda1, internal journal
EXT3-fs: recovery complete.
EXT3-fs: mounted filesystem with ordered data mode.

Also tired running "e2fsck" on sda1, get the following error:
Code:
e2fsck 1.42.8 (20-Jun-2013)
e2fsck: Is a directory while trying to open sda1

The superblock could not be read or does not describe a correct ext2
filesystem.  If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>

Looks like my USB stick died or what? :)
 

Attachments

  • dmesg dump.txt
    10.8 KB · Views: 403
Last edited:
EXT3-fs: starting recovery.
kjournald starting. Commit interval 5 seconds
EXT3-fs warning (device sda1): ext3_clear_journal_err: Filesystem error recorded from previous mount: IO failure
EXT3-fs warning (device sda1): ext3_clear_journal_err: Marking fs in need of filesystem check.
EXT3-fs warning: mounting fs with errors, running e2fsck is recommended
EXT3 FS on sda1, internal journal
EXT3-fs: recovery complete.
EXT3-fs: mounted filesystem with ordered data mode.

well well they same I got also some minutes ago and for me it was a restart and than it was fine ....

Not sure... maybe you did this already... don't know have to check this by me also now.
 
Restart didn't help, I have this issue for long time already, restarted multiple times, also updated Merlin WRT version multiple times, no problems updating fw because it does not touch the USB media :)
 
Last edited:
well than only one more step you could try when you don't need the data on the stick.
1) fdisk /dev/sda
2) d (will delete the partition)
3) n (new) p (for primary) and 2 times confirmation (Start and end of the partition)
4) w (writing the changes)

Somewhere there was also a partition number but I believe this you will see (I just don't remember where it was.)

and after this mkfs.ext4 /dev/sda1 to create the new file system. Or whatever fs you prefer :)

Just take the correct device / partition :)
 

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