ZFS on FreeBSD 9

I have created a VM with 2 hard disks. Did a standard installation of FreeBSD on the first hard disk (ada0) and decided to play around with ZFS on the second hard disk.

First of all, I destroyed any existing partitions on the second disk (warning the next command is dangerous, it will destroy all the data on the hard disk):

# gpart destroy -F ada1

I then went on to create a ZFS partition and pool. Note: I did not use the full disk size, in case I want to switch to RAID*. A prerequisite for ZFS in this case is that any newer disk should be at least the same size of the existing ones. This is not guaranteed by hard disk manufacturers that two 2TB hard disks have the same exact size.

# gpart create -s gpt ada1
# gpart show ada1
=>      34  41942973  ada1  GPT  (20G)
        34  41942973        - free -  (20G)
# camcontrol identify ada1
protocol              ATA/ATAPI-6 SATA 2.x
device model          VBOX HARDDISK
sector size logical 512, physical 512, offset 0
DMA supported         WDMA2 UDMA6

The 2 last commands gave me the partition size and sector size (in bold). I use this information to leave a bit of space after the ZFS partition. In addition, it is recommended to try to align the partitions to the sectors correctly. When using a physical hard disk for which you know the real sector size (note: sometimes the hardware is lying to you, which is the case of the 4K 512e HDD!!) you can directly use the corresponding alignment (i.e. 512 or 4k), but when using virtual HDD either as files (e.g. vdi, qcow2, etc.) or partitions (e.g. an LVM logical volume), it is better to use a 1MB aligment (1m), so adapt the “-a” option in the following command.

# gpart add -b 2048 -s 41932733 -a 1m -t freebsd-zfs -l disk00 ada1
ada1p1 added
# gpart show ada1
=>      34  41942973  ada1  GPT  (20G)
        34      2014        - free -  (1M)
      2048  41932733     1  freebsd-zfs  (20G)
  41934781      8226        - free -  (4.0M)

# zpool create laug ada1p1
# zfs set compression=lzjb laug
# zpool status
  pool: laug
 state: ONLINE
 scan: none requested

        NAME        STATE     READ WRITE CKSUM
        laug        ONLINE       0     0     0
          ada1p1    ONLINE       0     0     0

errors: No known data errors
# df -Th
Filesystem   Type     Size    Used   Avail Capacity  Mounted on
/dev/ada0p2  ufs       18G    2.6G     14G    15%    /
devfs        devfs    1.0k    1.0k      0B   100%    /dev
laug         zfs       19G     31k     19G     0%    /laug

Et voilà, a nice ZFS pool which is using compression (lzjb algorithm).

Ubuntu Server remote administration – Monit

Monit logoI have recently tested some remote administration tools for Ubuntu server (or any other Linux-based server). I have recorded here my findings and installation steps.

Today I present Monit, a monitoring and control tool for Unix and Unix-like systems.

This article will be followed by others with different tools. Stay tune, and you can find them all using the following tag remote-server-admin.

Continue reading “Ubuntu Server remote administration – Monit”

Home Server: The Concept

I’m currently looking for an elegant and easy to maintain solution for the following Home Server concept:

Running several VMs on top of an hypervisor.

As told, I have acquired a small server. I want to run on top 2 sets of services:

  • A back-up service;
  • A cloud synchronisation service (à la Dropbox).

I want to use virtualisation as I want each service in a dedicated sandbox. I’m not interested in containment style virtualisation because:

  • I probably will be adding new hardware nodes in some years as I will probably want to run other services;
  • I might be trying some of the *BSD OS, although I will be running Linux OS only.

Here are some technologies I want to investigate to see if some fit my needs:

Planning for a Home Server installation

I just order an HP Proliant MicroServer N40L and my plan is to convert it in a Home server using virtualisation. It is the first step stone of my own personal cloud infrastructure. The idea is to have a core server on top of which I can launch VMs when needed.