btrfs raid1 with two 3.5″ sata disks under ubuntu 20.04 lts

I installed a raid1 with two 3.5″ sata disks in one of my machines. Instead of using mdadm as usual I decided to go with btrfs this time. Here the commands I used for that (as root):

# overwrite partition tables
dd if=/dev/zero of=/dev/sdc bs=512 count=1024
dd if=/dev/zero of=/dev/sdd bs=512 count=1024
# create btrfs with single drive first
mkfs.btrfs -m single /dev/sdc

# get uuid and add it to fstab for automount
blkid | grep sdc
# => /dev/sdc: UUID="cc3a8b12-5b75-4c71-b5a7-ad151b69eb22" ...
echo "UUID=cc3a8b12-5b75-4c71-b5a7-ad151b69eb22 /data btrfs defaults,autodefrag 0	0" >> /etc/fstab
mount -a

# add second disk
btrfs device add /dev/sdd /data
# and change the fs to raid1
btrfs balance start -dconvert=raid1 -mconvert=raid1 /data

This was already working properly and I was able to copy my data on the newly created raid. I added the following to my /etc/hdparm.conf to turn off the disks when not needed:

# see hdparm -S
# 120 * 5sec = 600sec
# 600sec / 60sec = 10min
# frequent spin downs will damage a disk so i chose 20min!!

/dev/sdc {
	spindown_time = 240
}

/dev/sdd {
        spindown_time = 240
}

Haven’t tested everything yet, but works as expected until now =)