OpenWRT: Cant install packages - memory issue - router

I switched from default firmware to OpenWrt for my: TP-Link TL-WR1043N/ND v1 and have the problem that I am not able to install any new packages.
What I did:
Flash OpenWrt
Installed Luci (no problem there)
And than when I try to install anything else I get:
Collected errors:
* xsystem: wget: vfork: Out of memory.
* opkg_download: Failed to download http://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/packages/luci/luci-app-wshaper_git-15.338.68695-3bae3c7-1_all.ipk, wget returned -1.
* opkg_install_pkg: Failed to download luci-app-wshaper. Perhaps you need to run 'opkg update'?
* opkg_install_cmd: Cannot install package luci-app-wshaper.
The important thing seems to be : * xsystem: wget: vfork: Out of memory. And yep I did try reboot and 'update' several times.
But under Luci -> Software I can see:
And here is my DF output:
root#OpenWrt:~# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/root 2048 2048 0 100% /rom
tmpfs 14052 1128 12924 8% /tmp
/dev/mtdblock3 4736 936 3800 20% /overlay
overlayfs:/overlay 4736 936 3800 20% /
tmpfs 512 0 512 0% /dev
root#OpenWrt:~#
OpenWRT Router Link: https://wiki.openwrt.org/toh/tp-link/tl-wr1043nd
Manufacturer Link: http://www.tp-link.com/en/download/TL-WR1043ND_V1.html
Please does anyone have any idea what could cause the issue? I know the solution could be using an external USB but I want to aviod this at all costs + I cannot imagine that this router would have space just for luci :)

Go into /etc/opkg/distfeeds.conf and comment out everything but base and luci, the first two.
No idea why, but opkg started using tons of RAM with all of those enabled, which they are by default.

Thats my distfeeds. At first try have some troubles with install udpxy, after comment some points in conf, all works.
$ cat /etc/opkg/distfeeds.conf
src/gz designated_driver_base http://downloads.openwrt.org/snapshots/trunk/brcm63xx/generic/packages/base
#src/gz designated_driver_kernel http://downloads.openwrt.org/snapshots/trunk/brcm63xx/generic/packages/kernel
#src/gz designated_driver_telephony http://downloads.openwrt.org/snapshots/trunk/brcm63xx/generic/packages/telephony
src/gz designated_driver_packages http://downloads.openwrt.org/snapshots/trunk/brcm63xx/generic/packages/packages
#src/gz designated_driver_routing http://downloads.openwrt.org/snapshots/trunk/brcm63xx/generic/packages/routing
src/gz designated_driver_luci http://downloads.openwrt.org/snapshots/trunk/brcm63xx/generic/packages/luci
src/gz designated_driver_management http://downloads.openwrt.org/snapshots/trunk/brcm63xx/generic/packages/management
# src/gz designated_driver_targets http://downloads.openwrt.org/snapshots/trunk/brcm63xx/generic/packages/targets

Related

Mapping nested device mapper mounts back to their physical drive

Looking for a reliable (and hopefully simple) way to trace a directory in an lvm or other dm mounted fs back to the physical disk it resides on. Goal is to get the model and serial number of the drive no matter where the script wakes up.
Not a problem when the fs mount is on a physical partition, but gets messy when layers of lvm and/or loopbacks are in between. The lsblk tree shows the dm relationships back to /dev/sda in the following example, but wouldn't be very easy or desirable to parse:
# lsblk -po NAME,MODEL,SERIAL,MOUNTPOINT,MAJ:MIN
NAME MODEL SERIAL MOUNTPOINT MAJ:MIN
/dev/loop0 /mnt/test 7:0
/dev/sda AT1000MX500SSD1 21035FEA05B8 8:0
├─/dev/sda1 /boot 8:1
├─/dev/sda2 8:2
└─/dev/sda5 8:5
└─/dev/mapper/sda5_crypt 254:0
├─/dev/mapper/test5--vg-root / 254:1
└─/dev/mapper/test5--vg-swap_1 [SWAP] 254:2
Tried udevadm info, stat and a few other variations, but they all dead end at the device mapper without a way (that I can see) of connecting the dots to the backing disk and it's model/serial number.
Got enough solution by enumerating the base /dev/sd? devices, looping through each one and its partitions with lsblk -ln devpart and looking for the mountpoint in column 7. In the following example, the desired / shows up in the mappings to the /dev/sda5 partition. The serial number (and a lot of other data) for the base device can then be returned with udevadm info /dev/sda:
sda5 8:5 0 931G 0 part
sda5_crypt 254:0 0 931G 0 crypt
test5--vg-root 254:1 0 651G 0 lvm /
test5--vg-swap_1 254:2 0 976M 0 lvm [SWAP]

How to debug the problem not able to translate OID with a new MIB file for UPS-MIB?

On Centos, I ran into the following error:
sudo snmptrap -v 2c -c read localhost '' UPS-MIB::upsTraps
MIB search path: /root/.snmp/mibs:/usr/share/snmp/mibs
Cannot find module (UPS-MIB): At line 0 in (none)
UPS-MIB::upsTraps: Unknown Object Identifier
The above error happened after
Copied UPS-MIB.txt to /usr/share/snmp/mibs
I started snmptrapd:
snmptrapd -f -Lo -Dread-config -m ALL
The version of the Net-SNMP is 5.2.x.
The same procedures work fine with Ubuntu 18.04/Net-SNMP 5.3.7.
I wonder how to debug and fix the problem?
Besides the Net-SNMP version difference, on Ubuntu, I found an instruction to install mib-download-tool, and execute it after the installation of Net-SNMP, and comment out the lines beginning with min: in snmp.conf in order to fix the error of missing MIB's.
However, for the Centos, I had no need and found no such instruction, thus I have not done it yet, as there is no error message of missing MIB's.
The MIB file is downloaded from https://tools.ietf.org/rfc/rfc1628.txt
renamed to UPS-MIB.txt (It seems to me that the name of the MIB file does not matter, as long as it's unique? I tried to use a different names, upsMIB.txt, rfc1628.txt, but it does not help to improve.)
I solved the problem as follows:
manually copied /usr/share/snmp/mibs/ietf/UPS-MIB on an Ubuntu with Net-SNMP 5.7.3 installed to the Centos /usr/share/snmp/mibs/UPS-MIB
then restart the snmpd
by the command:
service snmpd restart
then the OID of UPS-MIB becomes visible and accessible.
Maybe, the version that I downloaded from https://tools.ietf.org/rfc/rfc1628.txt is not suitable??

"cat: write error: No space left on device" when I write to a character device using "cat"

I am trying to use VS1053, an audio decoder, on Linux 4.14 to play music. This device communicate through SPI bus, and I've developed a driver and registered VS1053 as a character device, thanks for https://github.com/rvp-nl/vs10xx-linux. Here comes the problem.
The way to play music is:
cat musicfile.mp3 > /dev/VS1053_device
When I throw a WAV music file to the device, everything is ok, and music plays well. However, when I throw a mp3 music file to the device, Linux casts an error
cat: write error: No space left on device
I've searched for the reason on many sites. Many said, check free space and free inode on file system, but this is my result:
root#s32v234sbc:~# df -i
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/root 956592 10795 945797 2% /
devtmpfs 234285 308 233977 1% /dev
tmpfs 234333 205 234128 1% /run
tmpfs 234333 10 234323 1% /var/volatile
root#s32v234sbc:~# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 15G 412M 14G 3% /
devtmpfs 916M 0 916M 0% /dev
tmpfs 916M 84K 916M 1% /run
tmpfs 916M 28K 916M 1% /var/volatile
root#s32v234sbc:~#
The music file is limited within 100MB, there is no way that the space is used up.
I tried to write an print file program to substitute "cat", but that doesn't work either. I have no idea why and how this error happened.
I am super grateful if anyone could help me on this!!!
try the below command:
tune2fs -l /dev/VS1053_device | grep -i reserved
And cat is not suitable for the operation you are performing.The MP3 format has all sorts of junk that can lurk at the front and end of the file and this needs to be strippe out.Try with ffmpeg or mp3wrap or aplay
Seems like there is a problem with the driver you are using. When you get "no space left on device" it doesn't mean in this case that the local filesystem is full. Probably it means that there is some problem on local or the other side of the SPI bus. It is possible that the driver you are using receives -ENOSPC status from SPI driver from linux kernel, but your driver doesn't service this error properly. So it will be needed to dig a little into the driver you are using.

mounting bucket with fstab not working NEWBIE

I'm new on GCP and on linux and I try to mount a bucket on my centos instance using gcsfuse.
I tried with a script running at boot but it was not working so I tried with fstab (peoples told me it is much better)
But I got this error when I tried to ls my mounted point :
ls: reading directory .: Input/output error
here is my fstab file :
#
# /etc/fstab
# Created by anaconda on Tue Mar 26 23:07:36 2019
#
# Accessible filesystems, by reference, are maintained under'/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=de2d3dce-cce3-47a8-a0fa-5bfe54e611ab / xfs defaults 0 0
mybucket /mount/to/point gcsfuse rw,allow_other,uid=1001,gid=1001
According : https://github.com/GoogleCloudPlatform/gcsfuse/blob/master/docs/mounting.md
Thanks for your time.
Okay so I just had to wait 2 minutes due to google auth granting my key. Basically it works

`error: service 'BloxPager' did not start. Aborting.`

I install the LogicBlox 3.10, using Ubuntu 14.04 64 bit
When I try to do lb-services start
it prompts me
error: service 'BloxPager' did not start. Aborting.
Following in the content in ~/lb_deployment/logs/current/BloxPagerDaemon.log
<2015/11/27 05:33:51.079> ERROR. Shared memory is critically low and will prevent reliable functioning
<2015/11/27 05:33:51.079> ERROR. of the pager daemon. Details follow.
<2015/11/27 05:33:51.079> ERROR. To force pager daemon start, set "LB_PAGER_FORCE_START" in your environment.
<2015/11/27 05:33:51.079> ERROR. * There is a problem with your machine configuration that could cause
<2015/11/27 05:33:51.079> ERROR. * performance or stability problems with large databases. This machine has
<2015/11/27 05:33:51.079> ERROR. * 8.3 Gb of memory, but only 4.2 Gb of memory is available as free disk
<2015/11/27 05:33:51.079> ERROR. * space in /dev/shm. Ideally there would be 5.5 Gb of free space there.
<2015/11/27 05:33:51.079> ERROR. * There is a simple fix. (1) By default linux configures /dev/shm to be
<2015/11/27 05:33:51.079> ERROR. * half the size of physical memory, which is too little for LogicBlox.
<2015/11/27 05:33:51.079> ERROR. * To increase it, edit (as root) the file /etc/fstab. On the line for
<2015/11/27 05:33:51.079> ERROR. * tmpfs, replace the word "defaults" with "size=7g". This change
<2015/11/27 05:33:51.079> ERROR. * will take effect on reboot. (2) If /etc/fstab is already
<2015/11/27 05:33:51.079> ERROR. * configured properly, there are stale files in /dev/shm that should
<2015/11/27 05:33:51.079> ERROR. * be removed. Or, another pager daemon is running (under a different
<2015/11/27 05:33:51.079> ERROR. * unix userid) that is using some shared memory
In /etc/fstab, the content is
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda1 during installation
UUID=c5a6aaa0-9337-496f-b2d0-eda2d6e6c87e / ext4 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
UUID=e8cee437-3b01-4c83-abf6-6cd996e9e21f none swap sw 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0
How should I change it?
Btw, in /dev/shm, I have tried deleting everything other than LB_ubuntu, and it did not seem to work.
A quick Google search turns up:
http://forums.fedoraforum.org/showthread.php?t=275653
The thread describes how to alter the default size of /dev/shm when there is not yet an entry in /etc/fstab.
Have you tried the LB_PAGER_FORCE_START setting?
Adding the following line to your .bashrc will prevent the warning
export LB_PAGER_FORCE_START=""