Mail archive

Re: [alpine-user] How to setup BTRFS and LUKS

From: Tristan Kohl <>
Date: Mon, 13 Aug 2018 14:10:08 +0200

Sorry if I was not clear about my setup.

I do not encrypt my root partition which is an unencrypted 16G ext4 on a
cheap USB drive. But I do have 8 HDDs in my tower ranging from 2-8TB
which are setup as a BTRFS pool holding a bunch of subvolumes which get
mounted all over the place.

When I boot I need Alpine to decrypt those drives, map them to
/dev/mapper/pool{0,1,2,...} and then run "btrfs device scan" so BTRFS
knows about the pool before Alpine executes my fstab holding all mounts
for those subvolumes.

This is my drive setup from the old Debian install. If I SSH into Alpine
and perform those steps manually, everything works. However I do not
want to SSH into my server, decrypt every drive by hand, run "btrfs
device scan" and "mount -a" everytime it has to reboot. Plus my
containers break if those pools are not present when Docker starts up.

I hope this clarifies things, thank you for your quick response.


On 13.08.2018 13:58, Marco Dickert wrote:
> On 2018-08-13 13:19:23, Tristan Kohl wrote:
>> Most things work flawelessly (samba, docker, etc.) but I do not get how one
>> would get a BTRFS pool on LUKS drives working.
>> I think I have to dig into OpenRC and drop some service in "sysinit" to
>> decrypt my drives before fstab kicks in (which as far as I can tell
>> happens in devfs). I have my crypttab setup to work with a keyfile which
>> resides in /root.
>> What I need:
>> 1. Mapping all LUKS drives to /dev/mapper/poolX (setup in /etc/crypttab)
>> 2. Run btrfs device scan to detect my pool
>> 3. Mount pool according to fstab
> I don't quite understand your problem. Did you read this [1]? Do you use
> software raid (mdadm) or lvm? Anyway, make sure all the necessary features are
> enabled in /etc/mkinitfs/mkinitfs.conf and rebuild it like described on the
> linked wiki page.
> If that does not work, please describe your exact problem with the setup.
> [1]
> Cheers,

Received on Mon Aug 13 2018 - 14:10:08 UTC