Server of Doom – Virtual Machine installation

Having poked around the net for a day or so, I’ve decided that FreeBSD should be the OS for the Server of Doom (I’m not sure on a ‘proper’ name yet, so SoD will suffice for now!) and I’m looking at installing it in VirtualBox to get used to dealing with BSD, as I’ve never really used it before.

I’ve checked the wiki and you can have FreeBSD installed onto a ZFS filesystem, which is a good start, as then I can run the OS on a mirrored file system, the new lz4 compression and the usual data integrity that ZFS provides.

So, setting up the virtual machine with 4GB RAM, 4 cores and a pair of 4GB drives to install onto and following the guide above has got me to a bootable system with a mirrored zpool and a variety of zfs filesystems comprising the OS install:

# zpool status zroot
  pool: zroot
 state: ONLINE
  scan: none requested
config:

        NAME        STATE     READ WRITE CKSUM
        zroot       ONLINE       0     0     0 
          mirror-0  ONLINE       0     0     0
             ada0p3 ONLINE       0     0     0
             ada1p3 ONLINE       0     0     0
errors: No known data errors

Now I’ve got the basic install up and running, the first thing to do is make a snapshot of the entire system, so that if (when?) I break things whilst puzzling out BSD, I can revert the entire file system to this state with a single command 😀

root@aether-v2:~ # zfs snapshot -r zroot@install
root@aether-v2:~ # zfs list -r -t snapshot zroot
NAME                               USED  AVAIL  REFER  MOUNTPOINT
zroot@install                         0      -   144K  -
zroot/ROOT@install                    0      -   144K  -
zroot/home@install                    0      -   184K  -
zroot/tmp@install                     0      -   176K  -
zroot/usr@install                     0      -   168M  -
zroot/usr/obj@install                 0      -   144K  -
zroot/usr/ports@install               0      -   807M  -
zroot/usr/ports/disfiles@install      0      -   144K  -
zroot/usr/ports/packages@install      0      -   144K  -
zroot/usr/src@install                 0      -   144K  -
zroot/var@install                     0      -   576K  -
zroot/var/crash@install               0      -   148K  -
zroot/var/db@install                84K      -   224K  -
zroot/var/db/pkg@install              0      -   144K  -
zroot/var/empty@install               0      -   144K  -
zroot/var/log@install              104K      -   196K  -
zroot/var/mail@install                0      -   144K  -
zroot/var/run@install              100K      -   240K  -
zroot/var/tmp@install                 0      -   152K  -

The small amount of data in the ‘USED’ column is due to me creating the snapshot from inside the virtual machine and then SSH’ing into it and setting myself as part of the wheel group. I checked the compression ratio on the zroot pool to see what kind of space savings using lz4 compression gives me on the new install:

root@aether-v2:~ # zfs get compressratio zroot
NAME                              PROPERTY       VALUE  SOURCE
zroot                             compressratio  2.11x  -

From what I remember, the 2.11x means that the 1.16GB on disk would take up 2.44GB if compression wasn’t used, which is fairly impressive!

Now that I’ve got the machine up and running, I need to spend a fair bit of time reading through the FreeBSD Handbook, figuring out how to install things like a hypervisor and figuring out whether I can boot another OS inside this virtualised OS. Fun times!

Tagged with: , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

*