1

I'm trying to mount two btrfs subvolumes from a same (luks-encrypted) device via the entries in fstab. The crypttab entry must be correct, since the system asks for the password on boot. But then it hangs with a black screen. The entries are:

(this example is correct, the only problem was the wrong UUID, which was of the encrypted partition, not the decrypted mapped device. I'll leave the question in case anyone searches for a specific working example of btrfs and fstab).

UUID={same uuid for device under /dev/mapper} /home/me btrfs defaults,ssd,subvol=home-me-dir,noatime 0 3
UUID={same uuid for device under /dev/mapper} /tmp btrfs defaults,ssd,subvol=tmp-dir,noatime,nodatacow,nodatasum 0 4

I tried both subvol=path and subvolid=id options. I ran sudo systemctl daemon-reload as was mentioned in the fstab file.

I'm not sure whether my problem is with it or with systemd (I suspect the issue is with fstab and btrfs since IIRC I did this with ext4 and everything worked OK). So could anyone answer this, please:

  • How to specify a path for the subvolume in the options, i.e. the subvol=path option? There were no examples in the man 5 btrfs, only the statement, that the path is always relative to the root subvolume, so I tried subvol=some-dir and subvol=/some-dir to no avail;
  • Does the root subvolume have to be mounted to use the subvol=path or subvolid=id options for its children subvolumes in fstab? When I use subvol=some-dir the decrypted device is not even mounted yet.

Thank you.

d.k
  • 245
  • 4
  • 10
  • 1
    just let's forget about `fstab` and what happens in boot process for now, can you manually mount your subvolumes? if not please provide `btrfs subvolume list` and `btrfs subvolume show`. – binarysta Sep 28 '20 at 18:22
  • @binarysta yes, I can. At least on a live system. I decrypted the device, and then `sudo mount -o subvolume=home-me /dev/mapper/crypt some-path` it works. It must be then something with systemd targets – d.k Sep 28 '20 at 18:29
  • 2
    ok `umount` it and run `mount -a`, this will try to mount all the entries in `fstab`, if any issue with `fstab` entries we can find. – binarysta Sep 28 '20 at 18:34
  • @binarysta thank you, you solved it actually. Somehow in fstab I had UUID of the encrypted device /dev/sda1 instead of the mapped decrypted device – d.k Sep 28 '20 at 18:51

0 Answers0