reverse engineering things that predecessors left without any documentation and throwing them out the window because devops
Menu
menu

S3FS is a FUSE-based utility that lets you mount your AWS S3 bucket like it’s a filesystem. It handles all the abstractions of making API calls and puts/gets of files to the object store. It supports a number of features such as multistore upload, AWS S3 SSE (S3 server-side encryption using KMS and Customer Keys), setting object lifecycle to Reduced Redundancy Storage, and parallel uploads/downloads.

S3FS is a comparable product to AWS File/Storage Gateway as it does not require running any local AWS-provided VMs for the sake of sharing S3 files across NFS in your environment. This guide goes over how to install and configure S3FS on FreeBSD.

Note: Honestly speaking, the FreeBSD port should be updated. Port version is 1.78 (and that’s from 2014) and current S3FS release on Github is 1.82. This version has been released in May 2017. Newest github version isn’t compiling because missing xattr dependencies. I haven’t had much time to look into this but once I figure it out, I’ll post an update.

Start by installing S3FS package on FreeBSD:

Create a credentials file:

Load the Fuse subsystem libraries:

Mount the S3FS filesystem:

Unmount the S3FS filesystem by running umount:

References:
https://code.google.com/archive/p/s3fs/wikis/FuseOverAmazon.wiki
https://github.com/s3fs-fuse/s3fs-fuse

Recently I encountered a package issue in Bacula-server package on FreeBSD 10. The package from pkg system was compiled to use Postgresql while I still use mysqld (I know, I know, I should migrate to pgsql or at least MariaDB). Of course I can recompile it with the necessary flags using the ports system, but out of curiosity I decided to see if there is a way to avoid updating the package using pkg for the time being. I don’t recommend not applying patches to your system but in some use cases it is necessary to stop a package from breaking your ‘pkg upgrade’ command or to freeze it at a certain version.

Turns out there is a ‘lock’ feature in pkg that lets you lock a package in certain state to stop pkg from modifying or updating it. To lock a package run:

To unlock a package, run the following:

That’s all there is to it. When a package is locked, you can safely upgrade your system except for that one package.

This howto describes how to relay mail (such as system alerts) to email services such as gmail. First part describes doing so using sSMTP which only supports relaying local system mail and the second part shows how to do this using Postfix which is a fully featured MTA. Postfix might be an overkill in most cases but hey, it might have features that you may find useful!

This howto is tailored to FreeBSD systems but the main configuration will work on other operating systems.

Continue reading ›

So I finally managed to get FreeBSD 8.1 root on ZFS done.  There is a very helpful script called ‘mfsBSD” from http://mfsbsd.vx.sk/ that will do all the work for you – I know, the lazy way, but so far manual way may or may not work.

mfsBSD is a small memory/liveCD FreeBSD install that you can use to install FreeBSD root on ZFS.  To install it, go right ahead and download the ‘8.1-RELEASE-zfsv15-amd64 special edition‘ ISO image and load it up on a spare computer or VirtualBox VM.  Once it’s loaded, run the following command:

[bash]mount_cd9660 /dev/acd0 /cdrom[/bash]

If you get any errors concerning ‘ata timeouts’, make sure that your CD drive is set as a secondary slave.  Once the DVD mounts, run the following to install FreeBSD/ZFS:

[bash]zfsinstall -d /dev/ad0 -t /cdrom/8.1-RELEASE-amd64.tar.xz -s 4G -V 15[/bash]

Where ‘-s 4G’ is your swap space amount.  This should take few minutes and once that’s done, you’ll have a working FreeBSD root on ZFS install without spending countless hours to get this rolling.

Once you reboot, you might get some IRQ19 errors on VirtualBox – those can be easily squashed by changing “OS Type” in VirtualBox to “Other”.

So far I have not encountered any issues with ZFS on FreeBSD, but mind you, it is not as up-to-date as the ZFS version 22 on OpenSolaris b134.  You will probably run into some issues, but it is worth a try now that OpenSolaris was shut down by Oracle (Though Illumos is gaining more and more momentum now that Oracle killed OSOL).  I kinda need a good, working NAS/SAN solution :\

This is just a work in progress that I am working on, but if anyone is doing this – please make sure to use the 64-bit DVD iso of FreeBSD.  I have had some issues with 32-bit DVD where the install would just totally bomb with a kernel panic in Virtual Box.  ZFS really, really loves RAM and even Sun/Oracle do not recommend running it on 32-bit systems.

Also, this is a great tutorial on installing FreeBSD on ZFS:

http://rhyous.com/2009/12/01/how-to-install-freebsd-8-0-using-only-zfs-partitions/