Mail archive
alpine-user

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

From: Tristan Kohl <tristan_at_icetown.de>
Date: Mon, 13 Aug 2018 16:07:12 +0200

Thanks, that did the trick decrypting my drives. But I do not get why
crypttab does not work since it is mentioned in the wiki?

However I still have half of the problem left, BTRFS is not made aware
of the pool before fstab tries to mount it which obviously fails. I need
to run "btrfs device scan" before that.

Cheers,
Tristan

On 13.08.2018 15:03, Adam Růžička wrote:
> Take a look at the dmcrypt service (configured in /etc/conf.d/dmcrypt).
> Maybe there's some other way but that's what I use.
>
> -- Adam
>
> On Mon, Aug 13, 2018, 14:10 Tristan Kohl <tristan_at_icetown.de
> <mailto:tristan_at_icetown.de>> wrote:
>
> 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.
>
> Cheers,
> Tristan
>
> 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] https://wiki.alpinelinux.org/wiki/Setting_up_disks_manually
> >
> > Cheers,
> >
>
>
> ---
> Unsubscribe:  alpine-user+unsubscribe_at_lists.alpinelinux.org
> <mailto:alpine-user%2Bunsubscribe_at_lists.alpinelinux.org>
> Help:         alpine-user+help_at_lists.alpinelinux.org
> <mailto:alpine-user%2Bhelp_at_lists.alpinelinux.org>
> ---
>


---
Unsubscribe:  alpine-user+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-user+help_at_lists.alpinelinux.org
---
Received on Mon Aug 13 2018 - 16:07:12 GMT