Is it possible to unlock multiple LUKS devices to form a LVM at boot?












2















I have the following setup: A LUKS encrypted SSD on which a LVM is used to form the typical linux partitions (/, /home/, etc.). This setup is unlocked at boot by a password. I'm using Debian Jessie.



Due to the lack of space, I wanted to add another PV to the LVM, which of course should be LUKS encrypted and decrypted at boot - with the use of key derivation from the first PV or by using the same password as the first PV.



This means that the LVM (which includes /, /home/, etc.) spans over two LUKS encrypted SSDs (of course each SSD contains one partition that is actually encrypted and not the SSDs themselves, but I think this is obvious.).



It seems impossible to unlock this kind of setup at boot since Systemd has been integrated - all found instructions derive keys (or else) that is not possible to do anymore with Systemd beacause the key derivation scripts are not executed anymore at boot (or the instructions just fail).



Does someone know if and how this actually works?



Otherwise I have to change my setup to have a seperate root partition (outside the LVM) so that the rest can be mounted after boot, or to have luks inside the lvm. But both are the last options I want to choose.



Thx!










share|improve this question
















bumped to the homepage by Community 28 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.




















    2















    I have the following setup: A LUKS encrypted SSD on which a LVM is used to form the typical linux partitions (/, /home/, etc.). This setup is unlocked at boot by a password. I'm using Debian Jessie.



    Due to the lack of space, I wanted to add another PV to the LVM, which of course should be LUKS encrypted and decrypted at boot - with the use of key derivation from the first PV or by using the same password as the first PV.



    This means that the LVM (which includes /, /home/, etc.) spans over two LUKS encrypted SSDs (of course each SSD contains one partition that is actually encrypted and not the SSDs themselves, but I think this is obvious.).



    It seems impossible to unlock this kind of setup at boot since Systemd has been integrated - all found instructions derive keys (or else) that is not possible to do anymore with Systemd beacause the key derivation scripts are not executed anymore at boot (or the instructions just fail).



    Does someone know if and how this actually works?



    Otherwise I have to change my setup to have a seperate root partition (outside the LVM) so that the rest can be mounted after boot, or to have luks inside the lvm. But both are the last options I want to choose.



    Thx!










    share|improve this question
















    bumped to the homepage by Community 28 mins ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.


















      2












      2








      2








      I have the following setup: A LUKS encrypted SSD on which a LVM is used to form the typical linux partitions (/, /home/, etc.). This setup is unlocked at boot by a password. I'm using Debian Jessie.



      Due to the lack of space, I wanted to add another PV to the LVM, which of course should be LUKS encrypted and decrypted at boot - with the use of key derivation from the first PV or by using the same password as the first PV.



      This means that the LVM (which includes /, /home/, etc.) spans over two LUKS encrypted SSDs (of course each SSD contains one partition that is actually encrypted and not the SSDs themselves, but I think this is obvious.).



      It seems impossible to unlock this kind of setup at boot since Systemd has been integrated - all found instructions derive keys (or else) that is not possible to do anymore with Systemd beacause the key derivation scripts are not executed anymore at boot (or the instructions just fail).



      Does someone know if and how this actually works?



      Otherwise I have to change my setup to have a seperate root partition (outside the LVM) so that the rest can be mounted after boot, or to have luks inside the lvm. But both are the last options I want to choose.



      Thx!










      share|improve this question
















      I have the following setup: A LUKS encrypted SSD on which a LVM is used to form the typical linux partitions (/, /home/, etc.). This setup is unlocked at boot by a password. I'm using Debian Jessie.



      Due to the lack of space, I wanted to add another PV to the LVM, which of course should be LUKS encrypted and decrypted at boot - with the use of key derivation from the first PV or by using the same password as the first PV.



      This means that the LVM (which includes /, /home/, etc.) spans over two LUKS encrypted SSDs (of course each SSD contains one partition that is actually encrypted and not the SSDs themselves, but I think this is obvious.).



      It seems impossible to unlock this kind of setup at boot since Systemd has been integrated - all found instructions derive keys (or else) that is not possible to do anymore with Systemd beacause the key derivation scripts are not executed anymore at boot (or the instructions just fail).



      Does someone know if and how this actually works?



      Otherwise I have to change my setup to have a seperate root partition (outside the LVM) so that the rest can be mounted after boot, or to have luks inside the lvm. But both are the last options I want to choose.



      Thx!







      linux debian lvm luks






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited May 30 '17 at 10:39







      baderas

















      asked May 30 '17 at 10:34









      baderasbaderas

      414




      414





      bumped to the homepage by Community 28 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 28 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
























          1 Answer
          1






          active

          oldest

          votes


















          0














          Method 1
          I found, since Systemd was implemented in *buntu desktop, that it will unlock all additional LUKS partitions if




          1. all of the partitions you want to unlock use the same password

          2. you enter the password for the root partition correctly the first time. If you get it wrong, you'll need to enter it again for every other LUKS partition


          This does not work for me in Ubuntu Server 16.04



          Method 2
          Using the gnome-disk-utility (GUI) app...




          1. select the encrypted LUKS partition


            1. click the gear button (additional partition options)

            2. Edit encryption options

            3. disable auto encryption options

            4. enable Unlock at startup

            5. (optional) change Name. This will label the unlocked partition under /dev/mapper/

            6. enter passphrase. The utility will create a keyfile in /etc/luks-keys/ for each partition you set up this way

            7. (optional) add unlocked partitions to fstab manually or using the disk utility

            8. update-initramfs (not sure if this is required)

            9. update-grub




          Method 3 Using keyutils.



          I haven't tested this. From https://www.redpill-linpro.com/techblog/2016/08/12/btrfs-and-encryption.html




          1. make use of the same passphrase for both of the encrypted volumes.

          2. Boot into your newly installed system:


          3. ~# apt-get install keyutils
            and add the keyscript=decrypt_keyctl option to both of the encrypted volumes listed in /etc/crypttab.

          4. Then issue:
            ~# update-initramfs -u -k all
            to update your initramfs to include keyutils.

          5. Then reboot and check that the entered passphrase is cached and used to unlock both of the encrypted volumes.






          share|improve this answer

























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "106"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f368073%2fis-it-possible-to-unlock-multiple-luks-devices-to-form-a-lvm-at-boot%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            Method 1
            I found, since Systemd was implemented in *buntu desktop, that it will unlock all additional LUKS partitions if




            1. all of the partitions you want to unlock use the same password

            2. you enter the password for the root partition correctly the first time. If you get it wrong, you'll need to enter it again for every other LUKS partition


            This does not work for me in Ubuntu Server 16.04



            Method 2
            Using the gnome-disk-utility (GUI) app...




            1. select the encrypted LUKS partition


              1. click the gear button (additional partition options)

              2. Edit encryption options

              3. disable auto encryption options

              4. enable Unlock at startup

              5. (optional) change Name. This will label the unlocked partition under /dev/mapper/

              6. enter passphrase. The utility will create a keyfile in /etc/luks-keys/ for each partition you set up this way

              7. (optional) add unlocked partitions to fstab manually or using the disk utility

              8. update-initramfs (not sure if this is required)

              9. update-grub




            Method 3 Using keyutils.



            I haven't tested this. From https://www.redpill-linpro.com/techblog/2016/08/12/btrfs-and-encryption.html




            1. make use of the same passphrase for both of the encrypted volumes.

            2. Boot into your newly installed system:


            3. ~# apt-get install keyutils
              and add the keyscript=decrypt_keyctl option to both of the encrypted volumes listed in /etc/crypttab.

            4. Then issue:
              ~# update-initramfs -u -k all
              to update your initramfs to include keyutils.

            5. Then reboot and check that the entered passphrase is cached and used to unlock both of the encrypted volumes.






            share|improve this answer






























              0














              Method 1
              I found, since Systemd was implemented in *buntu desktop, that it will unlock all additional LUKS partitions if




              1. all of the partitions you want to unlock use the same password

              2. you enter the password for the root partition correctly the first time. If you get it wrong, you'll need to enter it again for every other LUKS partition


              This does not work for me in Ubuntu Server 16.04



              Method 2
              Using the gnome-disk-utility (GUI) app...




              1. select the encrypted LUKS partition


                1. click the gear button (additional partition options)

                2. Edit encryption options

                3. disable auto encryption options

                4. enable Unlock at startup

                5. (optional) change Name. This will label the unlocked partition under /dev/mapper/

                6. enter passphrase. The utility will create a keyfile in /etc/luks-keys/ for each partition you set up this way

                7. (optional) add unlocked partitions to fstab manually or using the disk utility

                8. update-initramfs (not sure if this is required)

                9. update-grub




              Method 3 Using keyutils.



              I haven't tested this. From https://www.redpill-linpro.com/techblog/2016/08/12/btrfs-and-encryption.html




              1. make use of the same passphrase for both of the encrypted volumes.

              2. Boot into your newly installed system:


              3. ~# apt-get install keyutils
                and add the keyscript=decrypt_keyctl option to both of the encrypted volumes listed in /etc/crypttab.

              4. Then issue:
                ~# update-initramfs -u -k all
                to update your initramfs to include keyutils.

              5. Then reboot and check that the entered passphrase is cached and used to unlock both of the encrypted volumes.






              share|improve this answer




























                0












                0








                0







                Method 1
                I found, since Systemd was implemented in *buntu desktop, that it will unlock all additional LUKS partitions if




                1. all of the partitions you want to unlock use the same password

                2. you enter the password for the root partition correctly the first time. If you get it wrong, you'll need to enter it again for every other LUKS partition


                This does not work for me in Ubuntu Server 16.04



                Method 2
                Using the gnome-disk-utility (GUI) app...




                1. select the encrypted LUKS partition


                  1. click the gear button (additional partition options)

                  2. Edit encryption options

                  3. disable auto encryption options

                  4. enable Unlock at startup

                  5. (optional) change Name. This will label the unlocked partition under /dev/mapper/

                  6. enter passphrase. The utility will create a keyfile in /etc/luks-keys/ for each partition you set up this way

                  7. (optional) add unlocked partitions to fstab manually or using the disk utility

                  8. update-initramfs (not sure if this is required)

                  9. update-grub




                Method 3 Using keyutils.



                I haven't tested this. From https://www.redpill-linpro.com/techblog/2016/08/12/btrfs-and-encryption.html




                1. make use of the same passphrase for both of the encrypted volumes.

                2. Boot into your newly installed system:


                3. ~# apt-get install keyutils
                  and add the keyscript=decrypt_keyctl option to both of the encrypted volumes listed in /etc/crypttab.

                4. Then issue:
                  ~# update-initramfs -u -k all
                  to update your initramfs to include keyutils.

                5. Then reboot and check that the entered passphrase is cached and used to unlock both of the encrypted volumes.






                share|improve this answer















                Method 1
                I found, since Systemd was implemented in *buntu desktop, that it will unlock all additional LUKS partitions if




                1. all of the partitions you want to unlock use the same password

                2. you enter the password for the root partition correctly the first time. If you get it wrong, you'll need to enter it again for every other LUKS partition


                This does not work for me in Ubuntu Server 16.04



                Method 2
                Using the gnome-disk-utility (GUI) app...




                1. select the encrypted LUKS partition


                  1. click the gear button (additional partition options)

                  2. Edit encryption options

                  3. disable auto encryption options

                  4. enable Unlock at startup

                  5. (optional) change Name. This will label the unlocked partition under /dev/mapper/

                  6. enter passphrase. The utility will create a keyfile in /etc/luks-keys/ for each partition you set up this way

                  7. (optional) add unlocked partitions to fstab manually or using the disk utility

                  8. update-initramfs (not sure if this is required)

                  9. update-grub




                Method 3 Using keyutils.



                I haven't tested this. From https://www.redpill-linpro.com/techblog/2016/08/12/btrfs-and-encryption.html




                1. make use of the same passphrase for both of the encrypted volumes.

                2. Boot into your newly installed system:


                3. ~# apt-get install keyutils
                  and add the keyscript=decrypt_keyctl option to both of the encrypted volumes listed in /etc/crypttab.

                4. Then issue:
                  ~# update-initramfs -u -k all
                  to update your initramfs to include keyutils.

                5. Then reboot and check that the entered passphrase is cached and used to unlock both of the encrypted volumes.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Sep 4 '17 at 4:34

























                answered Sep 4 '17 at 0:56









                jay armstrongjay armstrong

                114




                114






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Unix & Linux Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f368073%2fis-it-possible-to-unlock-multiple-luks-devices-to-form-a-lvm-at-boot%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    サソリ

                    広島県道265号伴広島線

                    Setup Asymptote in Texstudio