2017-01-17 00:26:26 +01:00
# Minio FreeBSD Quickstart Guide [![Slack](https://slack.minio.io/slack?type=svg)](https://slack.minio.io)
2016-07-19 23:56:34 +02:00
2016-04-26 19:17:02 +02:00
### Minio with ZFS backend - FreeBSD
2017-04-19 09:25:20 +02:00
This example assumes that you have a FreeBSD 11.x running
2016-04-26 19:17:02 +02:00
2017-04-19 09:25:20 +02:00
#### Start ZFS service
2016-07-21 23:58:16 +02:00
```sh
2017-04-19 09:25:20 +02:00
sysrc zfs_enable="YES"
2016-04-26 19:17:02 +02:00
```
Start ZFS service
2016-07-21 23:58:16 +02:00
```sh
2017-03-17 17:23:22 +01:00
service zfs start
2016-04-26 19:17:02 +02:00
```
2016-07-21 23:58:16 +02:00
2017-03-17 17:23:22 +01:00
Configure a loopback device on the `/zfs` file.
2016-07-21 23:58:16 +02:00
```sh
2017-04-19 09:25:20 +02:00
dd if=/dev/zero of=/zfs bs=1M count=4000
2017-03-17 17:23:22 +01:00
mdconfig -a -t vnode -f /zfs
2016-04-26 19:17:02 +02:00
```
Create zfs pool
2016-07-21 23:58:16 +02:00
```sh
2017-03-17 17:23:22 +01:00
zpool create minio-example /dev/md0
2016-04-26 19:17:02 +02:00
```
2016-07-21 23:58:16 +02:00
```sh
2017-03-17 17:23:22 +01:00
df /minio-example
2016-04-26 19:17:02 +02:00
Filesystem 512-blocks Used Avail Capacity Mounted on
minio-example 7872440 38 7872402 0% /minio-example
```
Verify if it is writable
2016-07-21 23:58:16 +02:00
```sh
2016-12-15 02:45:47 +01:00
touch /minio-example/testfile
2017-04-19 09:25:20 +02:00
ls -l /minio-example/testfile
2016-04-26 19:17:02 +02:00
-rw-r--r-- 1 root wheel 0 Apr 26 00:51 /minio-example/testfile
```
2017-04-19 09:25:20 +02:00
Now you have successfully created a ZFS pool for further reading please refer [ZFS Quickstart Guide ](https://www.freebsd.org/doc/handbook/zfs-quickstart.html )
2016-04-26 19:17:02 +02:00
2017-04-19 09:25:20 +02:00
However, this pool is not taking advantage of any ZFS features. So let's create a ZFS filesytem on this pool with compression enabled. ZFS supports many compression algorithms: [`lzjb`, `gzip` , `zle` , `lz4` ]. `lz4` is often the most performant algorithm in terms of compression of data versus system overhead.
2016-07-21 23:58:16 +02:00
```sh
2017-03-17 17:23:22 +01:00
zfs create minio-example/compressed-objects
zfs set compression=lz4 minio-example/compressed-objects
2016-04-26 19:17:02 +02:00
```
2017-04-19 09:25:20 +02:00
To monitor if your pools are healthy.
2016-07-21 23:58:16 +02:00
```sh
2017-04-19 09:25:20 +02:00
zpool status -x
all pools are healthy
2016-04-26 19:17:02 +02:00
```
2017-04-19 09:25:20 +02:00
#### Start Minio service
Install [Minio ](https://minio.io ) from FreeBSD port.
2016-07-21 23:58:16 +02:00
```sh
2017-04-19 09:25:20 +02:00
pkg install minio
2016-04-26 19:17:02 +02:00
```
2017-04-19 09:25:20 +02:00
Enable minio and configure minio to use ZFS volume mounted at `/minio-example/compressed-objects` .
```
sysrc minio_enable=yes
sysrc minio_disks=/minio-example/compressed-objects
2016-04-26 19:17:02 +02:00
```
2017-04-19 09:25:20 +02:00
Start minio.
```
service minio start
2016-04-29 22:35:20 +02:00
```
2017-04-19 09:25:20 +02:00
Now you have an Minio running on top of your ZFS backend which transparently provides disk level compression for your uploaded objects, please visit http://localhost:9000 to open Minio Browser.
2016-04-29 22:35:20 +02:00
2017-04-19 09:25:20 +02:00
#### Stop Minio service
In-case you wish to stop Minio service.
```sh
service minio stop
```