Jump to content

\var\log & \var\log.hdd


Recommended Posts

I don't know if this is something I have broken or not, but I have a \var\log and a \var\log.hdd both identical and both being updated.

Where should I be looking to rectify this duplication?

 

ARMBIAN 5.25 stable Debian GNU/Linux 8 (jessie) 3.4.113-sun8i

OrangePiZero

 

Link to comment
Share on other sites

/var/log uses the "log2ram" filesystem, and /var/log.hdd is on your sd card.  This is done to minimize writes to the sd card.  So while they appear duplicated, I think only the most recent stuff is kept in ram.

 

Link to comment
Share on other sites

5 minutes ago, Blars said:

/var/log uses the "log2ram" filesystem, and /var/log.hdd is on your sd card.  This is done to minimize writes to the sd card.  So while they appear duplicated, I think only the most recent stuff is kept in ram.

Thank you.

Is there a place where all my questions are answered already? I don't want to annoy people on the forum with my n00bness.

Link to comment
Share on other sites

On 6/3/2017 at 1:57 AM, Blars said:

/var/log uses the "log2ram" filesystem, and /var/log.hdd is on your sd card.  This is done to minimize writes to the sd card.  So while they appear duplicated, I think only the most recent stuff is kept in ram.

 

 

On my system /var/log appears to be in the sd card, yet log2ram is active (note: I didn't alter /etc/fstab, this is a system installed from the armbian server image for the orange pi pc, I also checked and /var/log is not a symbolic link to a tmpfs). Kinda defeats the purpose to reduce wear on the SD card.

 

Btw, the file /etc/cron.daily/log2ram is owned by a non existent user and group 1001

In fact I have a bunch of those, all coming from the linux-xenial-root-orangepipc package:

 

# find -uid 1001 2>/dev/null | sed 's/^\.//' | xargs dpkg -S
linux-xenial-root-orangepipc: /lib/systemd/system/systemd-modules-load.service.d
linux-xenial-root-orangepipc: /lib/systemd/system/systemd-modules-load.service.d/10-timeout.conf
linux-xenial-root-orangepipc: /lib/systemd/system/log2ram.service
linux-xenial-root-orangepipc: /lib/systemd/system/serial-getty@.service.d
linux-xenial-root-orangepipc: /lib/systemd/system/serial-getty@.service.d/10-term.conf
linux-xenial-root-orangepipc: /lib/systemd/system/firstrun.service
linux-xenial-root-orangepipc: /lib/systemd/system/resize2fs.service
linux-xenial-root-orangepipc: /lib/systemd/system/getty@tty1.service.d
linux-xenial-root-orangepipc: /lib/systemd/system/getty@tty1.service.d/10-noclear.conf
linux-xenial-root-orangepipc: /lib/udev/rules.d/71-axp-power-button.rules
linux-xenial-root-orangepipc: /etc/initramfs/post-update.d/99-uboot
linux-xenial-root-orangepipc: /etc/X11/xorg.conf.d/01-armbian-defaults.conf
linux-xenial-root-orangepipc: /etc/profile.d/ssh-title.sh
linux-xenial-root-orangepipc: /etc/profile.d/check_first_login_reboot.sh
linux-xenial-root-orangepipc: /etc/default/armbian-motd.dpkg-dist
linux-xenial-root-orangepipc: /etc/default/log2ram.dpkg-dist
linux-xenial-root-orangepipc: /etc/network/interfaces.bonding
linux-xenial-root-orangepipc: /etc/network/interfaces.default
linux-xenial-root-orangepipc: /etc/network/interfaces.r1switch
linux-xenial-root-orangepipc: /etc/network/interfaces.network-manager
linux-xenial-root-orangepipc: /etc/network/interfaces.r1
linux-xenial-root-orangepipc: /etc/network/interfaces.espressobin
linux-xenial-root-orangepipc: /etc/network/interfaces.r1router
linux-xenial-root-orangepipc: /etc/network/interfaces.hostapd
linux-xenial-root-orangepipc: /etc/apt/apt.conf.d/71-no-recommends
linux-xenial-root-orangepipc: /etc/apt/apt.conf.d/02periodic
linux-xenial-root-orangepipc: /etc/cron.daily/log2ram
linux-xenial-root-orangepipc: /etc/kernel/preinst.d/initramfs-cleanup
linux-xenial-root-orangepipc: /var/lib/polkit-1/localauthority/backlight.pkla
linux-xenial-root-orangepipc: /var/lib/polkit-1/localauthority/power.pkla
linux-xenial-root-orangepipc: /var/lib/polkit-1/localauthority/networkmanager.pkla
linux-xenial-root-orangepipc: /var/lib/polkit-1/localauthority/plugdev.pkla
linux-xenial-root-orangepipc: /usr/lib/nand-sata-install/a20/bootloader/linux/linux.ini
linux-xenial-root-orangepipc: /usr/lib/nand-sata-install/a20/bootloader/linux/u-boot.bin
linux-xenial-root-orangepipc: /usr/lib/nand-sata-install/a20/bootloader/boot.axf
linux-xenial-root-orangepipc: /usr/lib/nand-sata-install/a20/bootloader/boot.ini
linux-xenial-root-orangepipc: /usr/lib/nand-sata-install/exclude.txt
linux-xenial-root-orangepipc: /usr/lib/nand-sata-install/a10/bootloader/u-boot.bin
linux-xenial-root-orangepipc: /usr/lib/nand-sata-install/a10/bootloader/linux/linux.ini
linux-xenial-root-orangepipc: /usr/lib/nand-sata-install/a10/bootloader/boot.axf
linux-xenial-root-orangepipc: /usr/lib/nand-sata-install/a10/bootloader/boot.ini
linux-xenial-root-orangepipc: /usr/lib/armbian/apt-updates
linux-xenial-root-orangepipc: /usr/share/log2ram/LICENSE
linux-xenial-root-orangepipc: /usr/sbin/log2ram
root@citofono:/# dpkg -l linux-xenial-root-orangepipc
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                        Version            Architecture       Description
+++-===========================-==================-==================-===========================================================
ii  linux-xenial-root-orangepip 5.32.170901        armhf              Armbian tweaks for xenial on orangepipc (default branch)

 

 

Link to comment
Share on other sites

43 minutes ago, olivluca said:

Kinda defeats the purpose to reduce wear on the SD card.


So far it was working without a problem. Can you provide full logs? armbianmonitor -u

Link to comment
Share on other sites

No, I mean, if /var/log is already on the sd card, using the log2ram script to copy it to /var/log.hdd will at least double the wear on the sd card.

The real question is why /var/log is not in ram (and why there are files with the 1001 owner).

Link to comment
Share on other sites

Something is malfunction but without logs, I am unable to guess what went wrong. I only see that you are using beta build, which is auto made and possible broken ... nobody test that.

Link to comment
Share on other sites

 

1 hour ago, Igor said:

Something is malfunction but without logs, I am unable to guess what went wrong. I only see that you are using beta build, which is auto made and possible broken ... nobody test that.

 

Oops, I forgot I enabled the beta repository.

But I checked the original image and even there /var/log is on disk.

Link to comment
Share on other sites

root@orangepiprime:~# df
Filesystem     1K-blocks    Used Available Use% Mounted on
udev              990260       0    990260   0% /dev
tmpfs             205140    5824    199316   3% /run
/dev/mmcblk0p1   7419364 2559408   4734400  36% /
tmpfs            1025692     140   1025552   1% /dev/shm
tmpfs               5120       4      5116   1% /run/lock
tmpfs            1025692       0   1025692   0% /sys/fs/cgroup
tmpfs            1025692       8   1025684   1% /tmp
log2ram            51200    1452     49748   3% /var/log
tmpfs             205140       0    205140   0% /run/user/0
tmpfs             205140       8    205132   1% /run/user/1000

Mount info:

log2ram on /var/log type tmpfs (rw,nosuid,nodev,noexec,relatime,size=51200k,mode=755)

Logs: http://sprunge.us/VQSd

Link to comment
Share on other sites

In /var/log/armhwinfo.log I see that log2ram was initially enabled (or so it seems)

### partitions:

major minor  #blocks  name

 179        0    1954816 mmcblk0
 179        1    1445888 mmcblk0p1

### df:

Filesystem      Size  Used Avail Use% Mounted on
udev            370M     0  370M   0% /dev
tmpfs           101M  1.7M   99M   2% /run
/dev/mmcblk0p1  1.4G  975M  387M  72% /
tmpfs           501M     0  501M   0% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           501M     0  501M   0% /sys/fs/cgroup
tmpfs           501M   28K  501M   1% /tmp
log2ram          50M  752K   50M   2% /var/log

 

So I guess some package removed the log2ram entry (I for sure didn't: I didn't even know what log2ram was until I setup nullmailer and saw the log message).

Link to comment
Share on other sites

Now I see that log2ram is not a fs type but a service and it was disabled (not by me)

 

# systemctl status log2ram
● log2ram.service - Armbian enhanced Log2Ram
   Loaded: loaded (/lib/systemd/system/log2ram.service; disabled; vendor preset: enabled)
   Active: inactive (dead)

 

I enabled it, let's see if it lasts

Link to comment
Share on other sites

I just ran apt-upgrade

Start-Date: 2017-09-11  12:44:53
Commandline: apt upgrade
Requested-By: luca (1000)
Upgrade: linux-image-sun8i:armhf (5.32.170901, 5.32.170911), linux-headers-sun8i:armhf (5.32.170901, 5.32.170911), linux-u-boot-orangepipc-default:armhf (5.32.170901, 5.32.170911), sunxi-tools:armhf (1.4.2-1~armbian5.32.170901+1, 1.4.2-1~armbian5.32.170911+1), hostapd:armhf (1:2.5~armbian5.32.170901+1, 1:2.5~armbian5.32.170911+1), linux-xenial-root-orangepipc:armhf (5.32.170901, 5.32.170911), linux-firmware:armhf (1.157.11, 1.157.12)
End-Date: 2017-09-11  12:52:25

and it disabled the log2ram service (I'll investigate which package did it).

 

BTW, I found out why I enabled the beta repository

Link to comment
Share on other sites

And file ownership should also be fixed

# dpkg -L linux-xenial-root-orangepipc | xargs ls -n | grep '1001 1001'
ls: cannot access '/etc/update-motd.d/99-point-to-faq': No such file or directory
ls: cannot access 'package': No such file or directory
ls: cannot access 'diverts': No such file or directory
ls: cannot access 'others': No such file or directory
ls: cannot access 'to:': No such file or directory
ls: cannot access '/etc/mpv/mpv-dist.conf': No such file or directory
-rw-r--r--   1 1001 1001     56 Aug  1 15:17 /etc/apt/apt.conf.d/71-no-recommends
-rwxr-xr-x   1 1001 1001     36 Aug  1 15:17 /etc/cron.daily/log2ram
-rw-r--r--   1 1001 1001     83 Aug  1 15:17 /etc/cron.d/armbian-updates
-rw-r--r--   1 1001 1001    156 Aug  1 15:17 /etc/default/armbian-motd.dpkg-dist
-rw-r--r--   1 1001 1001    280 Aug  1 15:17 /etc/default/log2ram.dpkg-dist
-rwxr-xr-x   1 1001 1001    308 Aug  1 15:17 /etc/initramfs/post-update.d/99-uboot
-rwxr-xr-x   1 1001 1001   1022 Aug  1 15:17 /etc/kernel/preinst.d/initramfs-cleanup
-rw-r--r--   1 1001 1001    525 Aug  1 15:17 /etc/network/interfaces.bonding
-rw-r--r--   1 1001 1001   1028 Sep 10 12:16 /etc/network/interfaces.default
-rw-r--r--   1 1001 1001    280 Aug  1 15:17 /etc/network/interfaces.espressobin
-rw-r--r--   1 1001 1001    197 Aug  1 15:17 /etc/network/interfaces.hostapd
-rw-r--r--   1 1001 1001    218 Aug  1 15:17 /etc/network/interfaces.network-manager
-rw-r--r--   1 1001 1001    495 Aug  1 15:17 /etc/network/interfaces.r1
-rw-r--r--   1 1001 1001    610 Aug  1 15:17 /etc/network/interfaces.r1router
-rw-r--r--   1 1001 1001    359 Aug  1 15:17 /etc/network/interfaces.r1switch
-rw-r--r--   1 1001 1001    212 Aug  1 15:17 /etc/profile.d/check_first_login_reboot.sh
-rw-r--r--   1 1001 1001    174 Aug  1 15:17 /etc/profile.d/ssh-title.sh
-rw-r--r--   1 1001 1001    217 Aug  1 15:17 /etc/X11/xorg.conf.d/01-armbian-defaults.conf
-rw-r--r--   1 1001 1001    384 Aug  1 15:17 /lib/systemd/system/firstrun.service
-rw-r--r--   1 1001 1001     30 Aug  1 15:17 /lib/systemd/system/getty@tty1.service.d/10-noclear.conf
-rw-r--r--   1 1001 1001    448 Aug  1 15:17 /lib/systemd/system/log2ram.service
-rw-r--r--   1 1001 1001    426 Aug  1 15:17 /lib/systemd/system/resize2fs.service
-rw-r--r--   1 1001 1001     33 Aug  1 15:17 /lib/systemd/system/serial-getty@.service.d/10-term.conf
-rw-r--r--   1 1001 1001     28 Aug  1 15:17 /lib/systemd/system/systemd-modules-load.service.d/10-timeout.conf
-rw-r--r--   1 1001 1001    287 Aug  1 15:17 /lib/udev/rules.d/71-axp-power-button.rules
-rwxr-xr-x   1 1001 1001   3783 Aug  1 15:17 /usr/lib/armbian/apt-updates
-rw-r--r--   1 1001 1001  84132 Aug  1 15:17 /usr/lib/nand-sata-install/a10/bootloader/boot.axf
-rw-r--r--   1 1001 1001    126 Aug  1 15:17 /usr/lib/nand-sata-install/a10/bootloader/boot.ini
-rw-r--r--   1 1001 1001    146 Aug  1 15:17 /usr/lib/nand-sata-install/a10/bootloader/linux/linux.ini
-rw-r--r--   1 1001 1001 321016 Aug  1 15:17 /usr/lib/nand-sata-install/a10/bootloader/u-boot.bin
-rw-r--r--   1 1001 1001 118912 Aug  1 15:17 /usr/lib/nand-sata-install/a20/bootloader/boot.axf
-rw-r--r--   1 1001 1001     91 Aug  1 15:17 /usr/lib/nand-sata-install/a20/bootloader/boot.ini
-rw-r--r--   1 1001 1001    152 Aug  1 15:17 /usr/lib/nand-sata-install/a20/bootloader/linux/linux.ini
-rw-r--r--   1 1001 1001 309228 Aug  1 15:17 /usr/lib/nand-sata-install/a20/bootloader/linux/u-boot.bin
-rw-r--r--   1 1001 1001     60 Aug  1 15:17 /usr/lib/nand-sata-install/exclude.txt
-rwxr-xr-x   1 1001 1001   1458 Aug  1 15:17 /usr/sbin/log2ram
-rw-r--r--   1 1001 1001   1067 Aug  1 15:17 /usr/share/log2ram/LICENSE
-rw-r--r-- 1 1001 1001   56 Aug  1 15:17 71-no-recommends
-rw-r--r-- 1 1001 1001  83 Aug  1 15:17 armbian-updates
-rwxr-xr-x 1 1001 1001   36 Aug  1 15:17 log2ram
-rw-r--r-- 1 1001 1001  156 Aug  1 15:17 armbian-motd.dpkg-dist
-rw-r--r-- 1 1001 1001  280 Aug  1 15:17 log2ram.dpkg-dist
-rwxr-xr-x 1 1001 1001 308 Aug  1 15:17 99-uboot
-rwxr-xr-x 1 1001 1001 1022 Aug  1 15:17 initramfs-cleanup
-rw-r--r-- 1 1001 1001  525 Aug  1 15:17 interfaces.bonding
-rw-r--r-- 1 1001 1001 1028 Sep 10 12:16 interfaces.default
-rw-r--r-- 1 1001 1001  280 Aug  1 15:17 interfaces.espressobin
-rw-r--r-- 1 1001 1001  197 Aug  1 15:17 interfaces.hostapd
-rw-r--r-- 1 1001 1001  218 Aug  1 15:17 interfaces.network-manager
-rw-r--r-- 1 1001 1001  495 Aug  1 15:17 interfaces.r1
-rw-r--r-- 1 1001 1001  610 Aug  1 15:17 interfaces.r1router
-rw-r--r-- 1 1001 1001  359 Aug  1 15:17 interfaces.r1switch
-rw-r--r-- 1 1001 1001  212 Aug  1 15:17 check_first_login_reboot.sh
-rw-r--r-- 1 1001 1001  174 Aug  1 15:17 ssh-title.sh
-rw-r--r-- 1 1001 1001 217 Aug  1 15:17 01-armbian-defaults.conf
-rw-r--r-- 1 1001 1001  384 Aug  1 15:17 firstrun.service
drwxr-xr-x 2 1001 1001 4096 Sep 11 12:49 getty@tty1.service.d
-rw-r--r-- 1 1001 1001  448 Aug  1 15:17 log2ram.service
-rw-r--r-- 1 1001 1001  426 Aug  1 15:17 resize2fs.service
drwxr-xr-x 2 1001 1001 4096 Sep 11 12:49 serial-getty@.service.d
drwxr-xr-x 2 1001 1001 4096 Sep 11 12:49 systemd-modules-load.service.d
-rw-r--r-- 1 1001 1001 30 Aug  1 15:17 10-noclear.conf
-rw-r--r-- 1 1001 1001 33 Aug  1 15:17 10-term.conf
-rw-r--r-- 1 1001 1001 28 Aug  1 15:17 10-timeout.conf
-rw-r--r-- 1 1001 1001  287 Aug  1 15:17 71-axp-power-button.rules
-rwxr-xr-x 1 1001 1001 3783 Aug  1 15:17 apt-updates
-rw-r--r-- 1 1001 1001   60 Aug  1 15:17 exclude.txt
-rw-r--r-- 1 1001 1001  84132 Aug  1 15:17 boot.axf
-rw-r--r-- 1 1001 1001    126 Aug  1 15:17 boot.ini
-rw-r--r-- 1 1001 1001 321016 Aug  1 15:17 u-boot.bin
-rw-r--r-- 1 1001 1001 146 Aug  1 15:17 linux.ini
-rw-r--r-- 1 1001 1001 118912 Aug  1 15:17 boot.axf
-rw-r--r-- 1 1001 1001     91 Aug  1 15:17 boot.ini
-rw-r--r-- 1 1001 1001    152 Aug  1 15:17 linux.ini
-rw-r--r-- 1 1001 1001 309228 Aug  1 15:17 u-boot.bin
-rwxr-xr-x 1 1001 1001    1458 Aug  1 15:17 log2ram
-rw-r--r-- 1 1001 1001 1067 Aug  1 15:17 LICENSE

 

Link to comment
Share on other sites

Hello, I'm new to Armbian, but I just booted by CuboxTV with Armbian_5.30_Cubox-i_Debian_jessie_next_4.11.4.img, 

and log2ram was looking fine:

# mount
.
. etc etc
.
/dev/mmcblk0p1 on /var/log.hdd type ext4 (rw,noatime,nodiratime,errors=remount-ro,commit=600)
log2ram on /var/log type tmpfs (rw,nosuid,nodev,noexec,relatime,size=51200k,mode=755)

upon upgrading via 'apt update' and 'apt upgrade' + reboot, I also see that log2ram is disabled:

# systemctl status log2ram
● log2ram.service - Armbian enhanced Log2Ram
   Loaded: loaded (/lib/systemd/system/log2ram.service; disabled)
   Active: inactive (dead)

enable + start via systemctl restored log2ram.
 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines