Moving home directory to a RAID subvolume

Hi all - I installed Rockstor on my home server which I use for storage and a bit of tinkering, so I wanted to have my /home on a btrfs RAID volume so that user files will be backed up as well. I ran into a couple issues, so thought I would share how I got this working on my system.

Originally I just created a btrfs subvolume on my 2 disk RAID pool, copied /home files, and changed my /etc/fstab. This worked until I added a 3rd disk to the pool, which caused the system boot to hang with errors like:

mount: wrong fs type, bad option, bad superblock on /dev/sda2
BTRFS: failed to read the system array on sda2
BTRFS: open_ctree failed

I could see these errors when logging into the system as root when the boot hung and looking at journalctl logs. Googling took me here, which says to try running btrfs device scan. Which works! I was then able to drop out of the maintenance console and the boot continued normally.

So this needs to be included as part of the boot so that when /home is mounted during boot, all of the devices in that volume are available and it can be mounted. In the btrfs mount options we have:

device=/dev/name
Tells btrfs to scan this device for a btrfs volume, does not mean all devices will be added to the fs, just scanned. Non-btrfs devices will cause mount to fail.

Adding the correct devices to fstab will fix the boot, but use the /dev/disk/by-id path in case your dev names change! So now my system boots correctly, my btrfs volumes look like:

btrfs filesystem show
Label: ‘rockstor_rockstor’ uuid: 0ea2c93e-2b0d-4b40-bced-4cb2141d3d1a
Total devices 1 FS bytes used 2.69GiB
devid 1 size 9.77GiB used 7.99GiB path /dev/sdd3

Label: ‘media’ uuid: 6c003fc5-7592-458e-8828-630d86be0d4f
Total devices 3 FS bytes used 662.10GiB
devid 1 size 931.51GiB used 99.00GiB path /dev/sdc
devid 2 size 1.36TiB used 565.03GiB path /dev/sda
devid 3 size 1.82TiB used 664.03GiB path /dev/sdb

In rockstor my media pool has home share on it.
And my /etc/fstab has this entry:

LABEL=media /home btrfs subvol=home,noatime,device=/dev/disk/by-id/ata-XXX,device=/dev/disk/by-id/ata-XXX,device=/dev/disk/by-id/ata-XXX 0 0

Hope this helps someone else!