I have a multi-device RAID1 BTRFS volume which fails to mount on boot, but which works fine when I mount it manually once the computer is booted up. I would like to be able to get the volume to mount at boot.
Here are some relevant details:
$ cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Wed Jun 10 16:09:15 2020
#
# Accessible filesystems, by reference, are maintained under '/dev/disk/'.
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info.
#
# After editing this file, run 'systemctl daemon-reload' to update systemd
# units generated from this file.
#
UUID=4a4582ad-c6ff-4c87-a5aa-b8db16dcc3ed / ext4 defaults 0 1
UUID=059b5282-ba55-4352-893b-61fb5d9b0d54 /boot ext4 defaults 0 2
UUID=f89f0a16-fc85-4021-9b0f-8356f2bc9c43 /srv btrfs defaults,nofail,x-systemd.requires=/ 0 0
UUID=26cd7051-85fa-46d6-b70f-b81b0ff30084 /home ext4 defaults 0 2
UUID=5a271f7a-1276-4055-ac24-62bbbea287f8 none swap defaults 0 0
The logs reveal that there was a problem:
$ sudo journalctl -p 3 -xb
-- Logs begin at Thu 2020-09-17 15:53:32 BST, end at Thu 2020-10-08 10:08:39 BST. --
Oct 08 10:01:35 localhost.localdomain kernel: BTRFS error (device sde): devid 2 uuid 65c21020-6607-425b-a36b-5455d80ab0d1 is missing
Oct 08 10:01:35 localhost.localdomain kernel: BTRFS error (device sde): failed to read the system array: -2
Oct 08 10:01:35 localhost.localdomain kernel: BTRFS error (device sde): open_ctree failed
Oct 08 10:01:35 localhost.localdomain systemd[1]: Failed to mount /srv.
-- Subject: A start job for unit srv.mount has failed
It is not always the same hard drive which is reported as missing. I have also tried swapping hard drives to different bays, and it does not seem to be a bad hard drive connector.
Once the system has booted I can get the volume to mount by running:
$ sudo systemctl list-units --failed
UNIT LOAD ACTIVE SUB DESCRIPTION
â—Ź srv.mount loaded failed failed /srv
LOAD = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB = The low-level unit activation state, values depend on unit type.
1 loaded units listed.
$ sudo systemctl restart srv.mount
$ sudo systemctl list-units --failed
UNIT LOAD ACTIVE SUB DESCRIPTION
0 loaded units listed.
$ ls /srv
git nfs www
The volume also seems to behave perfectly fine afterwards:
$ sudo btrfs device stats /srv
[/dev/sdg].write_io_errs 0
[/dev/sdg].read_io_errs 0
[/dev/sdg].flush_io_errs 0
[/dev/sdg].corruption_errs 0
[/dev/sdg].generation_errs 0
[/dev/sdj].write_io_errs 0
[/dev/sdj].read_io_errs 0
[/dev/sdj].flush_io_errs 0
[/dev/sdj].corruption_errs 0
[/dev/sdj].generation_errs 0
[/dev/sdi].write_io_errs 0
[/dev/sdi].read_io_errs 0
[/dev/sdi].flush_io_errs 0
[/dev/sdi].corruption_errs 0
[/dev/sdi].generation_errs 0
[/dev/sde].write_io_errs 0
[/dev/sde].read_io_errs 0
[/dev/sde].flush_io_errs 0
[/dev/sde].corruption_errs 0
[/dev/sde].generation_errs 0
[/dev/sdh].write_io_errs 0
[/dev/sdh].read_io_errs 0
[/dev/sdh].flush_io_errs 0
[/dev/sdh].corruption_errs 0
[/dev/sdh].generation_errs 0
[/dev/sdf].write_io_errs 0
[/dev/sdf].read_io_errs 0
[/dev/sdf].flush_io_errs 0
[/dev/sdf].corruption_errs 0
[/dev/sdf].generation_errs 0
[/dev/sdc].write_io_errs 0
[/dev/sdc].read_io_errs 0
[/dev/sdc].flush_io_errs 0
[/dev/sdc].corruption_errs 0
[/dev/sdc].generation_errs 0
[/dev/sdd].write_io_errs 0
[/dev/sdd].read_io_errs 0
[/dev/sdd].flush_io_errs 0
[/dev/sdd].corruption_errs 0
[/dev/sdd].generation_errs 0
[/dev/sdb].write_io_errs 0
[/dev/sdb].read_io_errs 0
[/dev/sdb].flush_io_errs 0
[/dev/sdb].corruption_errs 0
[/dev/sdb].generation_errs 0
[/dev/sda].write_io_errs 0
[/dev/sda].read_io_errs 0
[/dev/sda].flush_io_errs 0
[/dev/sda].corruption_errs 0
[/dev/sda].generation_errs 0
Any help would be much appreciated!