X-Original-To: alpine-user@lists.alpinelinux.org Received: from mail-oi0-f46.google.com (mail-oi0-f46.google.com [209.85.218.46]) by lists.alpinelinux.org (Postfix) with ESMTP id 7C2115C5596 for ; Tue, 14 Aug 2018 14:50:22 +0000 (GMT) Received: by mail-oi0-f46.google.com with SMTP id y207-v6so33994629oie.13 for ; Tue, 14 Aug 2018 07:50:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=GJ+XarK/uetJS2IE5lqDsrLNTqdo7xJ74FCV1HRmWns=; b=lVc7fzke1Jlve3w5rL7kxA4JD4BdhUhOPQ26fGOENQzVmMjpsLBGBM99zO+TRGAg+W q2aoxdi7xTO0CER3B8q642VCnSXUEi/XMeuyc2z12QDxu1k5cgsQDJurHrcqyQOk+Hi6 yJEMFWyzhlYIP1HxpMpcyMz1VqcKGD0YWEnIkL/NfmqLdiQPQ5tcPZZcLTdYdMKKGbYY 71edeqp7CtA6/N9jC+GIV73YuMdPNkiTQpYhdpFpbExXJ9cPKagMShtkWlx6863jx6yn 4h76EcSK6XfFgcFTIdSB1FWt0FZGHYusBS1PvO6gJ5V1QpgKyhuAjMdIUp2HVktEdZ8I qK1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=GJ+XarK/uetJS2IE5lqDsrLNTqdo7xJ74FCV1HRmWns=; b=FHy/XoH4X8FnVk0rK8zxygtHZFRP/Jeo+TB2UzkWHFgtD6LvPKPNAE7o04EL2A5Psu zDlfzNz0d/WiQWmIgZiRp6ckprIcveIhaKdAt/8bkL1hl4mBs8N1nHC9vp0Utk473yCI aGQgir3Legh+59WUqNnLljR8zVhCOZPwFazVYt0iaSlxdwE5W6LH7gbzk7Unk3bTC+W1 2BzVNf+/HYPWPObQkktc7e5FrbUR05HbMY3ytgiLdxsDejWTgHWx9DLUIHEqdvk+V+eH HbZP1oqs8/ERi/5h20AjUzul8YJjAIl6MjGLycySv3kdG/UvCrBiaWvXK10TsECCyhFa 5jyg== X-Gm-Message-State: AOUpUlHaObjChcuB44dyCBbVRxsVc02EiihAWOf/o9YWFtao8dHhgrN2 JnOIVqBOg0CEn+QvUer75Rk7EaP0ByhGhKSzqfgE+g== X-Google-Smtp-Source: AA+uWPybfXU043CfZTGZmjXvmZkRfUHsHKDLJ1t4Iv9+OmLdE/LSX2IyaUHxRij0TZfBi4l6lt9z4gpxQtEl01PPb2A= X-Received: by 2002:aca:1719:: with SMTP id j25-v6mr21269026oii.138.1534258222048; Tue, 14 Aug 2018 07:50:22 -0700 (PDT) X-Mailinglist: alpine-user Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: MIME-Version: 1.0 Received: by 2002:a9d:5886:0:0:0:0:0 with HTTP; Tue, 14 Aug 2018 07:49:41 -0700 (PDT) In-Reply-To: <91ffe437-8e42-978b-9247-811ce1c0a58c@icetown.de> References: <885afe4f-3231-468d-7928-7e41bf4cffd4@icetown.de> <91ffe437-8e42-978b-9247-811ce1c0a58c@icetown.de> From: =?UTF-8?B?QWRhbSBSxa/FvmnEjWth?= Date: Tue, 14 Aug 2018 16:49:41 +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="00000000000051b1fe057366542d" --00000000000051b1fe057366542d Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, one thing comes to mind. I think I encountered something similar and the cause was that the btrfs kernel module was not loaded at the time when "btrfs device scan" was run. To put it another way, the userspace btrfs tool tries to look for the drives but doesn't know how to read them. Could you try echo 'btrfs' > /etc/modules.d/btrfs.conf and then reboot (+ lbu if you're using that). Hope this helps -- Adam On Tue, Aug 14, 2018 at 12:58 PM, Tristan Kohl wrote: > 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"=E2=80=AFat 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 >=E2=80=AF/scan.txt"=E2=80=AFwhich created a file cont= aining > "Scanning for Btrfs filesystems" after boot. But somehow the scans' > result got lost afterwards. Even puttig it right before the line "moun > -at ..."=E2=80=AFinside localmount did not have any effect. I am lost rig= ht 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? > > Cheers, > Tristan > > 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 whic= h > > 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: alpine-user+unsubscribe@lists.alpinelinux.org > > Help: alpine-user+help@lists.alpinelinux.org > > --- > > > > > --- > Unsubscribe: alpine-user+unsubscribe@lists.alpinelinux.org > Help: alpine-user+help@lists.alpinelinux.org > --- > > --00000000000051b1fe057366542d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,
one thing comes to mind. I think I enco= untered something similar
and the cause was that the btrfs kernel= module was not loaded
at the time when "btrfs device scan&q= uot; was run. To put it another way,
the userspace btrfs tool tri= es to look for the drives but doesn't know
how to read them. = Could you try

echo 'btrfs' > /etc/modul= es.d/btrfs.conf

and then reboot (+ lbu if you'= re using that).=C2=A0 Hope this helps

-- Adam
<= /div>

On Tue= , Aug 14, 2018 at 12:58 PM, Tristan Kohl <tristan@icetown.de> wrote:
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"=E2=80=AFat 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 >=E2=80=AF/scan.txt"=E2=80=AFwhich created = a file containing
"Scanning for Btrfs filesystems" after boot. But somehow the scan= s'
result got lost afterwards. Even puttig it right before the line "moun=
-at ..."=E2=80=AFinside 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?

Cheers,
Tristan

On 13.08.2018 13:19, Tristan Kohl wrote:
> Hey guys,
>
> I stumbled upon Alpine a while back when building new docker images fo= r
> 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 no= t
> 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 "sysin= it" 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 whi= ch
> resides in /root.
>
> What I need:
> 1. Mapping all LUKS drives to /dev/mapper/poolX (setup in /etc/cryptta= b)
> 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 withou= t
> documenting anything. Plus Debian did a lot of magic out of the box I<= br> > did not even knew of. However this "featurefullness" also al= ways 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:=C2=A0 alpine-user+unsubscribe@lists.alpinelinux.org
> Help:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0alpine-user+help@lists.alpinelinux.org
> ---
>


---
Unsubscribe:=C2=A0
alpine-user+unsubscribe@lists.alpinelinux.org
Help:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0alpine-user+help@lists.alpinelinux.org
---


--00000000000051b1fe057366542d-- --- Unsubscribe: alpine-user+unsubscribe@lists.alpinelinux.org Help: alpine-user+help@lists.alpinelinux.org ---