Mail archive

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

From: Tristan Kohl <>
Date: Tue, 14 Aug 2018 12:58:35 +0200

I want to give a little update on my progress so far:

Thanks to Adam I was able to have my drives encrypted during boot.
However they still were not recognized by BTRFS as one coherent pool.

I then tried to put "btrfs device scan" at various places in
/etc/runlevel/boot/localmount and others but that did not change
anything. I can confirm that the command got executed since I wrote
"btrfs device scan > /scan.txt" which created a file containing
"Scanning for Btrfs filesystems" after boot. But somehow the scans'
result got lost afterwards. Even puttig it right before the line "moun
-at ..." inside localmount did not have any effect. I am lost right now
as to what else I can try to fix this.

As I read in Arch and Gentoo wiki they use some hooks in their initramfs
but I am not sure if that will help since decryption has to run before
scanning plus I do not find anything as to how one would use/configure
them in Alpine.

Does anyone smarter than me has any idea what else I could try?


On 13.08.2018 13:19, Tristan Kohl wrote:
> Hey guys,
> I stumbled upon Alpine a while back when building new docker images for
> my home server currently running Debian stable. Since I was quite
> intrigued by its minimalism, I gave it a shot in a VM to play around. I
> must admit, I fell in love and made an USB drive to use on my home
> server. 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 am a Linux desktop user for 7 years and I do prefer command line for
> many tasks but when it comes to server setups that are just a tad more
> advanced I feel like an absolute beginner. When I build my server some 5
> years ago I did just some copypasta from a vast number of sites without
> documenting anything. Plus Debian did a lot of magic out of the box I
> did not even knew of. However this "featurefullness" also always bugged
> me since I had no idea what was actually going on behind the scenes.
> Hope someone can help me out here, any help is greatly appreciated.
> Cheers,
> Tristan
> ---
> Unsubscribe:
> Help:
> ---

Received on Tue Aug 14 2018 - 12:58:35 UTC