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/*/*