X-Original-To: alpine-user@lists.alpinelinux.org Received: from mail-oi0-f45.google.com (mail-oi0-f45.google.com [209.85.218.45]) by lists.alpinelinux.org (Postfix) with ESMTP id B36DE5C3016 for ; Mon, 13 Aug 2018 13:04:15 +0000 (GMT) Received: by mail-oi0-f45.google.com with SMTP id 13-v6so27087242ois.1 for ; Mon, 13 Aug 2018 06:04:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yCOXQqCer8o/db4Mz6vl9rdGOLo1NMciUC2+2uPDjGY=; b=FRNrRdnFQqrAGVhH6DAe+m35h6PPnb38ZjiFBj2i5LyO5iFOeSO8veAtv6UkWzQ5ae bKOFOnNW+/pEmVZzMwJzQS/943wdMxHiIf+AXBMpcvDCSpMUKlMGHRu5yUH1PYtjg0O1 OBLzU/Q45BqsFbwBlpmxSR9eF3Rem2VvQtZEgd8wZt7lk5NSxU3cs0oi1CE/i0n3g0Tc wNhCzhoxoS7IIyX6pWxzVoV+PdOWpYcMm3I13Liltz9NoGnM9eCl8c/VKteISk8YXaRE YoAomQ+Y21PRarU0fsEjRoKZYcoK6UACeQirTBV0M5+94VIHGF7pvlWpZnB6VBN79KfO 3yTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=yCOXQqCer8o/db4Mz6vl9rdGOLo1NMciUC2+2uPDjGY=; b=CPAvgjwSLGBE2rkRNnnvCPW0NrtK43yCZ/BnH42IFmXzFaprC9K9ycZAjCO+XKOapC TbLLSlrjFSYfAfXaJ2Kx5osSD9glWIM1ifwxl6IzfchvKrDJRtysck9fSSUkOKKC0pNX AbbpjzbD22F2tPGX2m/DtFPNpxWeh0kfDZP9bEGu+zoYoXpKDmFRj6Ie59nLmvWoRomf /SFJqz5hP5EvEbUGHzj//nU4aVonAILlXt1uH2vyRUdSYEa+ni02et3YuWQc17tmAXh2 I2Gxi7sCxnAk8mj92kQBdPMCJFPcJm6TVrZZUzS0ClpstCeY2ikQk89nLTNyh/eVKuLM xCMQ== X-Gm-Message-State: AOUpUlHYwjz9JCDpwt7UCE3kEtP00ZxjJLfHSez0M84vSDZUd8veLIS3 Y6uYLOVvjx1gVr6zeWi3orHv4k8zJo4IrpogLs0ZRbxd X-Google-Smtp-Source: AA+uWPzwIHv/UViboA1tIe8aYS+l9E9qk0tA64Gnx4XbYN3S/kh5y7xDGoVGHUT/Eht52sr+gjghuQFWmIn3IPlBdXY= X-Received: by 2002:aca:ebd8:: with SMTP id j207-v6mr18588250oih.206.1534165455285; Mon, 13 Aug 2018 06:04:15 -0700 (PDT) X-Mailinglist: alpine-user Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: MIME-Version: 1.0 References: <885afe4f-3231-468d-7928-7e41bf4cffd4@icetown.de> <20180813115815.yhcnfmofdzvl5e2d@kronos.misterunknown.de> <62f28780-fcc7-6c47-5cd4-1a4c4d729d08@icetown.de> In-Reply-To: <62f28780-fcc7-6c47-5cd4-1a4c4d729d08@icetown.de> From: =?UTF-8?B?QWRhbSBSxa/FvmnEjWth?= Date: Mon, 13 Aug 2018 15:03:27 +0200 Message-ID: Subject: Re: [alpine-user] How to setup BTRFS and LUKS To: Tristan Kohl Cc: alpine-user@lists.alpinelinux.org Content-Type: multipart/alternative; boundary="000000000000fd32ac057350bac2" --000000000000fd32ac057350bac2 Content-Type: text/plain; charset="UTF-8" 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 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@lists.alpinelinux.org > Help: alpine-user+help@lists.alpinelinux.org > --- > > --000000000000fd32ac057350bac2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Take a look at the dmcrypt service (configured in /etc/co= nf.d/dmcrypt). Maybe there's some other way but that's what I use.<= div dir=3D"auto">
-- Adam

On Mon, Aug 13, 2018, 14:10 Tristan Ko= hl <tristan@icetown.de> wro= te:
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 B= TRFS
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 ge= t how one
>> would get a BTRFS pool on LUKS drives working.
>>
>> I think I have to dig into OpenRC and drop some service in "s= ysinit" to
>> decrypt my drives before fstab kicks in (which as far as I can tel= l
>> 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/cry= pttab)
>> 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 y= ou use
> software raid (mdadm) or lvm? Anyway, make sure all the necessary feat= ures are
> enabled in /etc/mkinitfs/mkinitfs.conf and rebuild it like described o= n the
> linked wiki page.
>
> If that does not work, please describe your exact problem with the set= up.
>
> [1] https://wiki.alpineli= nux.org/wiki/Setting_up_disks_manually
>
> Cheers,
>


---
Unsubscribe:=C2=A0 alpine-user+unsubscribe@lis= ts.alpinelinux.org
Help:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0alpine-user+he= lp@lists.alpinelinux.org
---

--000000000000fd32ac057350bac2-- --- Unsubscribe: alpine-user+unsubscribe@lists.alpinelinux.org Help: alpine-user+help@lists.alpinelinux.org ---