Tuesday, March 25, 2014

Arch Linux enable / disable journal logging


Create script to enable disable journal logging.
To prevent SD card wearing on RaspberryPi  I've decided to take control of journal logging.

start_loging_journal.sh

#!/bin/bash
sed -i '/Storage=none/d'  /etc/systemd/journald.conf
systemctl restart systemd-journald

stop_loging_journal.sh

#!/bin/bash
sed -i '/Storage=none/d'  /etc/systemd/journald.conf
echo "Storage=none" >> /etc/systemd/journald.conf
systemctl restart systemd-journald

Wednesday, January 22, 2014

BTRFS File-level cloning in a split of a second.

Clone a file on btrfs in a split of a second

cp --reflink=always file.img clone_of_file.img

Before copying file
$ ls -s1
10485760 Centos53-2.img

Copying 10GB file
$ time cp --reflink=always  Centos53-2.img Centos53-2_copy.img

real    0m0.001s
user    0m0.000s
sys     0m0.000s

After copying file 
$ ls -s1
10485760 Centos53-2_copy.img
10485760 Centos53-2.img

Monday, January 20, 2014

Systemd default output or error output for all services and sockets

From man systemd and man systemd.unit(5)

StandardOutput=
StandardError=

Takes one of inherit, null, tty, journal, journal+console, syslog, syslog+console, kmsg, kmsg+console.

Wednesday, January 8, 2014

Arch Linux journalctl -f is very slow on btrfs filesystem


Check log size
journalctl --disk-usage

Check log for fragments
filefrag /var/log/journal/*/*

Defragment log
btrfs fi defrag -v -f -clzo /var/log/journal/*/*

Friday, November 29, 2013

LTFS Oracle/Centos/Redhat  Linux 


1. Dovnload "Single Drive Edition"/SDE LTFS driver and LTFS filesystem utilities from IBM use link Download driver  or Google "Downloading LTFS"

2. Install FUSE support 
yum install fuse-libs.x86_64 fuse.x86_64

3. Install LTFS File system 
rpm -iv ltfs-*.rpm

4. Insert tape to  LTO drive 

5. mount LTFS ilesystem.
ltfs -o devname=/dev/IBMtape0 /LTFS/

Mounting a XEN/KVM/QEMU Image on ARCH Linux


Attach image 

#Load nbd driver
modprobe nbd max_part=8

#Attach system image 
qemu-nbd --connect=/dev/nbd0  System.img

#Mount Second partition
mount /dev/nbd0p2 /media

Release image


#Umount partition 
umount /media/

#Remove image 
qemu-nbd  -d /dev/nbd0

#Remove driver 
modprobe -r nbd 

Monday, July 8, 2013

Kernel-3.10 Nvidia 325.08 error

Found working patch from the nvidia developers forum. https://devtalk.nvidia.com/cmd/default/download-
comment-attachment/58795/ 

How to apply patch in Gentoo: Just let epatch_user do the work :-)

All you need to do is create a nvidia-drivers dir in /etc/portage/patches/x11-drivers/
mkdir -p /etc/portage/patches/x11-drivers/nvidia-drivers 

Download patch and copy it to newly created directory.
cp ~/Downloads/nvidia-drivers-linux-3.10.patch /etc/portage/patches/x11-drivers/nvidia-drivers/ 

Then just emerge nvidia-drivers or module-rebuild rebuild
PATCHES=/etc/portage/patches emerge -va nvidia-drivers