I couldn't find instructions for installing OMV with btrfs, if they exist please post a link.
I have a simple system with 3 disks (the 2 data disks will be mirrored, RAID1):
/dev/sda Data disk 1, 4TB HD
/dev/sdb Data disk 2, 4TB HD
/dev/sdc Boot disk, 64GB SSD
INSTRUCTIONS:
1 - Install OMV. Install from image (CD, USB, whatever) to boot disk (SSD for me). Reboot, make sure OMV starts OK from your boot disk.
2 - Install OMV-extras plugin. You need this to get a newer linux kernel (3.16) that supports btrfs. Follow this guide - http://omv-extras.org/simple/i…install-omv-extras-plugin
3 - Select 3.16 kernel. Log into web interface, go to System / OMV-Extras.org, select the Kernel tab, click Install Backports 3.16 kernel, Save and Apply, Reboot, go back to OMV-Extras.org and make sure "Debian GNU/Linux, with Linux 3.16..." is selected.
4 - Get terminal access. Some steps below use the command line so you will need a terminal. You can use the local terminal if you have a keyboard and monitor connected to your OMV. I prefer to use a remote terminal via SSH (Secure SHell), here's how: From OMV web interface select Services, SSH, check Enable. Use a SSH client (like PuTTY) to connect to your OMV. You will need to know the hostname or IP address (System, Network, Interfaces). Connect and login as root.
5 - Install btrfs-tools. Even though btrfs is part of the 3.16 kernel, you need the utility programs in btrfs-tools to, for example, create a btrfs filesystem. From the command line type the following to get the newer backport btrfs-tools:
echo 'deb http://http.debian.net/debian wheezy-backports main' > /etc/apt/sources.list.d/wheezy-backports.list
apt-get update
apt-get -t wheezy-backports install btrfs-tools
6 - Create the btrfs filesystem. A default mirrored (RAID1) filesystem with mirrored metadata and non-mirrored data is created with this command:
mkfs.btrfs /dev/sda /dev/sdb
I wanted my data to also be mirrored so I did this:
mkfs.btrfs -d raid1 /dev/sda /dev/sdb
For more information, see this beginners guide to btrfs - https://www.howtoforge.com/a-beginners-guide-to-btrfs
7 - Mount the filesystem. In the OMV web interface go to: Storage, File Systems, select any of the data disks (for my system, /dev/sda or /dev/sdb) then click the mount button. The disks should now show as btrfs in the "File system" column.
8 - Create subvolumes. This is optional but recommended since creating shares on the btrfs root will cause problems, like preventing snapshots (see macester's post below). Type the command df -h in the terminal and look for a line like this:
/dev/sda 7814037168 1344 7811881600 1% /media/eee51012-49d2-423f-8f79-80a8594130ec
NOTE: the long string after /media/ is the UUID. If you copy and paste from this post, be sure to replace this example UUID with the one for your system.
To create subvolume for backups, type this:
btrfs subvolume create /media/eee51012-49d2-423f-8f79-80a8594130ec/@Backups
How about another for data:
btrfs subvolume create /media/eee51012-49d2-423f-8f79-80a8594130ec/@Data
To verify they were created, type ls -l /media/eee51012-49d2-423f-8f79-80a8594130ec and you should see something like this:
drwxr-xr-x 1 root root 0 Mar 11 23:43 @Backups
drwxr-xr-x 1 root root 18 Mar 11 23:57 @Data
9 - Create shares. In the OMV web interface go to: Access Rights Management, Shared Folders, click on the Add button. To create a share for pictures, for Name enter Pictures, for Volume select /dev/sda (or whatever your btrfs volume is), for Path click the folder button and select @Data then click OK, now add the Pictures folder so the full path is /@Data/Pictures, select the Permissions you want, then click Save.
Optional:
- Create snapshots of subvolumes
- Create a System, Scheduled Jobs to run scrub occassionally to check, and attempt to correct, any error in the btrfs filesystem
Corrections and improvements welcome.