surenz

Members
  • Content Count

    1
  • Joined

  • Last visited


Reputation Activity

  1. Like
    surenz reacted to borombo in /var easily get full with log2ram   
    log2ram writes files from ramdisk to sdcard every hour (if they are updated) by cron task. Also at startup log2ram loads all content from /var/log.hdd to ramdisk.
     
    1. For improving situation with full ramdisk you can organize log rotation rules in /etc/logrotate.d to optimize logs by size. Log rotation is time dependent - daily, weekly. But, using log2ram, the best choice is to make it size-dependent.
     
    edit /etc/logrotate.d/rsyslog:
     
    /var/log/syslog
    {
        # rotate only once
        rotate 1
        # rotate only if syslog > 10 Mb
        size 10M
        missingok
        notifempty
        delaycompress
        compress
        postrotate
            invoke-rc.d rsyslog rotate > /dev/null
        endscript
    }
     
    /var/log/kern.log
    {
        # do not rotate, just purge file
        rotate 0
        # if size more than 1 Mb
        size 1M
        missingok
        notifempty
        compress
        delaycompress
        sharedscripts
        postrotate
            invoke-rc.d rsyslog rotate > /dev/null
        endscript
    }
     
    2. If your system spams a lot of messages, you can make log rotation more aggressive:
     
    move /etc/cron.daily/logrotate to /etc/cron.hourly/logrotate
     
    3. If you don't need detailed archived logging. You can protect your sdcard from hourly writes by telling log2ram to not write syslog and kern.log to disk. As a bonus at boot your ramdisk will not be filling with previous session's logs.
     
    a) activate rsync mode in /etc/default/log2ram (or in /etc/log2ram.conf):
    USE_RSYNC=true
     
    b) find your log2ram (delete duplicates, if there is) and edit
    whereis log2ram
     
    replace two lines
    rsync -aXWv --delete --links $RAM_LOG/ $HDD_LOG/ 2>&1 | $LOG_OUTPUT
    and
    rsync -aXWv --delete --links $HDD_LOG/ $RAM_LOG/ 2>&1 | $LOG_OUTPUT
     
    with
    rsync -aXWv --delete --delete-excluded --exclude-from '/etc/log2ram-exclude' --links $RAM_LOG $HDD_LOG 2>&1 | $LOG_OUTPUT
    and
    rsync -aXWv --delete --delete-excluded --exclude-from '/etc/log2ram-exclude' --links $HDD_LOG $RAM_LOG 2>&1 | $LOG_OUTPUT

    c) create new file /etc/log2ram-exclude and add lines:
    /log2ram.log
    /syslog*
    /kern.log*
     
  2. Like
    surenz got a reaction from Naguissa in Orange Pi One USB-OTG   
    Hi,
     
    I've been struggling also with all the info in this thread but finally succeeded to make decompile/edit/compile the dtb file (assume this file as BIOS for ARM  )
    I'm putting all commands here as reference for me as well :
     
    cd /boot/dtb sudo cp sun8i-h3-orangepi-one.dtb sun8i-h3-orangepi-one.dtb.old sudo dtc -I dtb -O dts -o sun8i-h3-orangepi-one.dts sun8i-h3-orangepi-one.dtb sudo sed -i -e 's/dr_mode = "otg";/dr_mode = "host";/g' sun8i-h3-orangepi-one.dts sudo dtc -I dts -O dtb -o sun8i-h3-orangepi-one.dtb sun8i-h3-orangepi-one.dts Explanation of different lines:
     
    1. go to dtb directory
    2. make backup of the compiled file in case something goes wrong
    3. decompile the file to be able to alter it with text editor
    4. change the string from "otg" to "host"
    5. compile the altered file back to binary format dtb
     
     
    The only bad thing with all this above is that if you upgrade your kernel the info will be lost so you have to do it again.
    I don't get why this parameter is set by default to "otg"?
  3. Like
    surenz got a reaction from manuti in Orange Pi One USB-OTG   
    Hi,
     
    I've been struggling also with all the info in this thread but finally succeeded to make decompile/edit/compile the dtb file (assume this file as BIOS for ARM  )
    I'm putting all commands here as reference for me as well :
     
    cd /boot/dtb sudo cp sun8i-h3-orangepi-one.dtb sun8i-h3-orangepi-one.dtb.old sudo dtc -I dtb -O dts -o sun8i-h3-orangepi-one.dts sun8i-h3-orangepi-one.dtb sudo sed -i -e 's/dr_mode = "otg";/dr_mode = "host";/g' sun8i-h3-orangepi-one.dts sudo dtc -I dts -O dtb -o sun8i-h3-orangepi-one.dtb sun8i-h3-orangepi-one.dts Explanation of different lines:
     
    1. go to dtb directory
    2. make backup of the compiled file in case something goes wrong
    3. decompile the file to be able to alter it with text editor
    4. change the string from "otg" to "host"
    5. compile the altered file back to binary format dtb
     
     
    The only bad thing with all this above is that if you upgrade your kernel the info will be lost so you have to do it again.
    I don't get why this parameter is set by default to "otg"?
  4. Like
    surenz got a reaction from MitchD in Orange Pi One USB-OTG   
    Hi,
     
    I've been struggling also with all the info in this thread but finally succeeded to make decompile/edit/compile the dtb file (assume this file as BIOS for ARM  )
    I'm putting all commands here as reference for me as well :
     
    cd /boot/dtb sudo cp sun8i-h3-orangepi-one.dtb sun8i-h3-orangepi-one.dtb.old sudo dtc -I dtb -O dts -o sun8i-h3-orangepi-one.dts sun8i-h3-orangepi-one.dtb sudo sed -i -e 's/dr_mode = "otg";/dr_mode = "host";/g' sun8i-h3-orangepi-one.dts sudo dtc -I dts -O dtb -o sun8i-h3-orangepi-one.dtb sun8i-h3-orangepi-one.dts Explanation of different lines:
     
    1. go to dtb directory
    2. make backup of the compiled file in case something goes wrong
    3. decompile the file to be able to alter it with text editor
    4. change the string from "otg" to "host"
    5. compile the altered file back to binary format dtb
     
     
    The only bad thing with all this above is that if you upgrade your kernel the info will be lost so you have to do it again.
    I don't get why this parameter is set by default to "otg"?