Tag Archives: fedora

Install ZFS on Fedora 25 with kernel 4.8.13-300

After I had my Fedora 24 upgraded to 25 on my desktop, ZFS no longer worked. I tried to remove zfs package and reinstalled; it didn’t work.

Here’s how I got it working after trying many things. There could be a different way to fix it, though.

Let’s check the version of the kernel:

[root@sangkae ~]# uname -r

Check if spl, zfs are already installed:

[root@sangkae ~]# dnf info spl
Last metadata expiration check: 1:01:18 ago on Thu Dec 15 22:42:25 2016.
Installed Packages
Name        : spl
Arch        : x86_64
Epoch       : 0
Version     :
Release     : 1.fc25
Size        : 48 k
Repo        : @System
From repo   : zfs
Summary     : Commands to control the kernel modules
URL         : http://zfsonlinux.org/
License     : GPLv2+
Description : This package contains the commands to verify the SPL
            : kernel modules are functioning properly.

[root@sangkae ~]# dnf info zfs
Last metadata expiration check: 1:01:26 ago on Thu Dec 15 22:42:25 2016.
Installed Packages
Name        : zfs
Arch        : x86_64
Epoch       : 0
Version     :
Release     : 1.fc25
Size        : 808 k
Repo        : @System
From repo   : zfs
Summary     : Commands to control the kernel modules and libraries
URL         : http://zfsonlinux.org/
License     : CDDL
Description : This package contains the ZFS command line utilities.

Manually install spl, dkms:

# dkms install spl/
# dkms install zfs/

Load zfs module:

# modprobe zfs

Voilla, I got ZFS working again.

Losing ZFS storage for Docker

I use ZFS as a storage driver for docker engine running on my machine. Today after my machine rebooted from a crash, yes Linux system crashes too, I notice that all my docker images and containers disappeared.

~ ❯❯❯ docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
~ ❯❯❯ docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

First thing came to my mind was “did I accidentally destroy docker zfs data set last night?”

# zfs list
NAME                                                                                USED  AVAIL  REFER  MOUNTPOINT
tank                                                                               1.52T   239G   120K  /tank
tank/docker                                                                         999M   239G  73.9M  /var/lib/docker

It’s still there. At that point I suspected that Docker might no longer use ZFS as its data storage.

~ ❯❯❯ docker info
Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 0
Server Version: 1.12.1
Storage Driver: devicemapper
 Pool Name: docker-253:0-2753561-pool
 Pool Blocksize: 65.54 kB
 Base Device Size: 10.74 GB
 Backing Filesystem: xfs
 Data file: /dev/loop0
 Metadata file: /dev/loop1
 Data Space Used: 11.8 MB
 Data Space Total: 107.4 GB
 Data Space Available: 31.79 GB
 Metadata Space Used: 581.6 kB
 Metadata Space Total: 2.147 GB
 Metadata Space Available: 2.147 GB

The output information from docker info command confirmed my suspicion. But how do we change the storage back to ZFS instead of devicemapper? According to ZFS storage in practice the only prerequisite to have ZFS as the data storage is having /var/lib/docker as a ZFS dataset.

I was under the impression that tank/docker was mounted to /var/lib/docker. Actually /var/lib/docker directory lived on my local LVM file system (hence devicemapper was the storage driver).

To fix this, I stopped docker service, cleared out /var/lib/docker, and re-mounted the tank/docker dataset.

# systemctl stop docker
# rm -rf /var/lib/docker/*
# mount tank/docker
# systemctl start docker

Let’s see if it’s working again.

docker info
Containers: 6
 Running: 0
 Paused: 0
 Stopped: 6
Images: 18
Server Version: 1.12.1
Storage Driver: zfs
 Zpool: tank
 Zpool Health: ONLINE
 Parent Dataset: tank/docker
 Space Used By Parent: 1047826432
 Space Available: 263167705088
 Parent Quota: no
 Compression: off

# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
abiosoft/caddy      latest              af55a59400be        2 days ago          40.69 MB

Everything seemed to back to normal. I’m still not sure why tank/docker wasn’t mounted on boot, but I’ll leave it for another day. As for now, I’m quite happy.

Create bootable USB Fedora 24

Every time there is a new release of Linux distro, I need to create a bootable USB. And, I forgot how I did it last time. So, I tried by using the “Startup Disk Creator” program installed on my Ubuntu workstation, only to find out that it didn’t even work.

After a while I remember, it was just a matter of using dd command to copy the ISO image to the USB.

Here is how I did it last time for Fedora 24:

My USB is showed up as /dev/sdx, and the ISO image is: Fedora-Workstation-Live-x86_64-24-1.2.iso.

$ sudo dd if=./Fedora-Workstation-Live-x86_64-24-1.2.iso of=/dev/sdx bs=8M status=progress oflag=direct
[sudo] password for kenno: 
1541406720 bytes (1.5 GB, 1.4 GiB) copied, 648.041 s, 2.4 MB/s 
183+1 records in
183+1 records out
1541406720 bytes (1.5 GB, 1.4 GiB) copied, 650.655 s, 2.4 MB/s

That’s all I had to do. A few words of warning; make sure you double check the name of USB device detected by your counter. In my case, it was /dev/sdc, but I used /dev/sdx as an example.

For more details check out https://fedoraproject.org/wiki/How_to_create_and_use_Live_USB

How to get IP of guest OS in VirtualBox

After upgrading my VM running Fedora 23 beta to the release version, Gnome Desktop Manager (GDM) no longer started again. This is the same issue with newer version of xorg-x11-*, and it’s not yet supported by VirtualBox 5.0.

I previously posted a quick fix by downgrading xorg-x11-* packages. To do that, I need to ssh into the VM.

Here’s how we can find the IP address of running VMs.

Let’s list the VMs available:

~$ vboxmanage list runningvms
"banan" {0c92f898-316d-4efb-a6ea-bc555c4064ff}
"Windows7" {7f7a27a0-4bc0-47e2-ae92-0a1e360a3d81}
"f23" {7645e5b9-1dba-4850-9745-117029bb82ab}

I’m interested in “f23”. To list all IPs associated with available NICs run:

~$ vboxmanage guestproperty enumerate "f23" | grep IP
Name: /VirtualBox/GuestInfo/Net/0/V4/IP, value:, timestamp: 1447197251856159000, flags: 
Name: /VirtualBox/GuestInfo/Net/1/V4/IP, value:, timestamp: 1447197286865156000, flags:

Note that, if you don’t see any IPs listed, it’s likely that your VM is not running or/and the VM Guest Addition is not installed on that VM.

Ref: https://forums.virtualbox.org/viewtopic.php?f=1&t=36592

GDM Doesn’t Start on Fedora 23 Beta and VirtualBox

I just finished upgrading Fedora 22 to Fedora 23 Beta and upon rebooting, gdm no longer started. I tried to reinstall the VirtualBox Guest Additions; unfortunately it still didn’t fix.

To cut the story short, someone has given a working tip at this forum. The solution is to downgrade xorg-x11-server-Xorg package.

# dnf --showduplicates --allowerasing --releasever=22 downgrade xorg-x11-server-Xorg
# mount /dev/cdrom /mnt; cd /mnt
# ./VBoxLinuxAdditions.run
# reboot

After rebooting, I was able to login again.

Credit: http://forums.fedoraforum.org/showthread.php?t=306857

Set Timezone in Fedora 20

While looking at the log file on my Raspberry Pi (running Fedora 20 Remix), I noticed that the date/time didn’t look right.

# date
Mon Jul 21 09:01:18 EDT 2014
# timedatectl 
      Local time: Mon 2014-07-21 08:56:16 EDT
  Universal time: Mon 2014-07-21 12:56:16 UTC
        Timezone: n/a (EDT, -0400)
     NTP enabled: yes
NTP synchronized: yes
 RTC in local TZ: no
      DST active: yes
 Last DST change: DST began at
                  Sun 2014-03-09 01:59:59 EST
                  Sun 2014-03-09 03:00:00 EDT
 Next DST change: DST ends (the clock jumps one hour backwards) at
                  Sun 2014-11-02 01:59:59 EDT
                  Sun 2014-11-02 01:00:00 EST

EDT is a North American Eastern Daylight Time, which is 4 hours behind UTC. You can read more about it here. In my case, I prefer the time zone set to AEST (Australian Eastern Standard Time), which is 10 hour ahead of UTC.

Here’s how it can be done.

# timedatectl set-timezone Australia/Sydney
# timedatectl status
      Local time: Mon 2014-07-21 23:06:22 EST
  Universal time: Mon 2014-07-21 13:06:22 UTC
        Timezone: Australia/Sydney (EST, +1000)
     NTP enabled: yes
NTP synchronized: yes
 RTC in local TZ: no
      DST active: no
 Last DST change: DST ended at
                  Sun 2014-04-06 02:59:59 EST
                  Sun 2014-04-06 02:00:00 EST
 Next DST change: DST begins (the clock jumps one hour forward) at
                  Sun 2014-10-05 01:59:59 EST
                  Sun 2014-10-05 03:00:00 EST
# date
Mon Jul 21 23:06:25 EST 2014

Tonight I learned a new command ‘timedatectl’, thanks to the link found in below credit.

Credit: Fedora 20 – Set Timezone:Server World

systemd – start,status,enable example

This is just a quick note to remind myself how to enable/disable services using systemd. In this example, I’m using ‘denyhosts’ service.

Check if a service is running.

# systemctl status denyhosts
denyhosts.service - SSH log watcher
   Loaded: loaded (/usr/lib/systemd/system/denyhosts.service; disabled)
   Active: inactive (dead)

Start a service and verify if it’s running:

# systemctl start denyhosts
# systemctl status denyhosts
denyhosts.service - SSH log watcher
   Loaded: loaded (/usr/lib/systemd/system/denyhosts.service; disabled)
   Active: active (running) since Thu 2014-07-17 01:44:29 EDT; 1min 25s ago
  Process: 15722 ExecStart=/usr/bin/denyhosts.py --daemon --config=/etc/denyhosts.conf (code=exited, status=0/SUCCESS)
  Process: 15719 ExecStartPre=/bin/rm -f /run/lock/subsys/denyhosts (code=exited, status=0/SUCCESS)
 Main PID: 19367 (denyhosts.py)
   CGroup: /system.slice/denyhosts.service
           └─19367 /usr/bin/python /usr/bin/denyhosts.py --daemon --config=/etc/denyhosts.conf

Jul 17 01:44:29 pidora.local systemd[1]: PID file /run/lock/subsys/denyhosts not readable (yet?) after start.
Jul 17 01:44:29 pidora.local systemd[1]: Started SSH log watcher.

Check if a ‘denyhosts’ service is enable or not:

# systemctl is-enabled denyhosts

Let’s enable it so it’ll start automatically on boot:

# systemctl enable denyhosts    
ln -s '/usr/lib/systemd/system/denyhosts.service' '/etc/systemd/system/multi-user.target.wants/denyhosts.service'

Ref: https://wiki.archlinux.org/index.php/systemd

Eclipse ADT Fatal Error on Linux

The Eclipse IDE that comes bundle with Android Development Tools (ADT) crashes when run on my laptop running Fedora.


The error message which logged to console is:

# A fatal error has been detected by the Java Runtime Environment:
#  SIGSEGV (0xb) at pc=0x0000003cc2270061, pid=9653, tid=140330452297472
# JRE version: Java(TM) SE Runtime Environment (7.0_55-b13) (build 1.7.0_55-b13)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (24.55-b03 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C  [libsoup-2.4.so.1+0x70061]  soup_session_feature_detach+0x11
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again

Fortunately, there’s a way to fix this problem by opening ‘eclipse.ini’ file, in my case:

vim /opt/adt-bundle-linux-x86_64-20131030/eclipse

and added this line to the end of that file:


Credit: Android – Solución Fatal Error del IDE Eclipse (ADT)