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
4.8.13-300.fc25.x86_64

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     : 0.6.5.8
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     : 0.6.5.8
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/0.6.5.8
# dkms install zfs/0.6.5.8

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: 192.168.1.110, timestamp: 1447197251856159000, flags: 
Name: /VirtualBox/GuestInfo/Net/1/V4/IP, value: 192.168.122.1, 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