Sample Header Ad - 728x90

How to mount a btrfs subvolume via fstab? Has the root subvolume to be already mounted elsewhere?

2 votes
0 answers
8593 views
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.
Asked by d.k (297 rep)
Sep 28, 2020, 06:03 PM
Last activity: Sep 29, 2020, 06:28 AM