Booting to an encrypted Debian install, which has /boot on LVM-on-LUKS Unicorn Meta Zoo #1:...

A journey... into the MIND

What to do with someone that cheated their way though university and a PhD program?

Is there a possibility to generate a list dynamically in Latex?

What's called a person who works as someone who puts products on shelves in stores?

Why do people think Winterfell crypts is the safest place for women, children & old people?

Raising a bilingual kid. When should we introduce the majority language?

Protagonist's race is hidden - should I reveal it?

Did war bonds have better investment alternatives during WWII?

Writing a T-SQL stored procedure to receive 4 numbers and insert them into a table

How long can a nation maintain a technological edge over the rest of the world?

Where/What are Arya's scars from?

Will I be more secure with my own router behind my ISP's router?

Is there a verb for listening stealthily?

When speaking, how do you change your mind mid-sentence?

How can I wire a 9-position switch so that each position turns on one more LED than the one before?

How to translate "red flag" into Spanish?

Page Layouts : 1 column , 2 columns-left , 2 columns-right , 3 column

Why is arima in R one time step off?

What helicopter has the most rotor blades?

What's parked in Mil Moscow helicopter plant?

Bright yellow or light yellow?

Does Prince Arnaud cause someone holding the Princess to lose?

What is a good proxy for government quality?

Why did Israel vote against lifting the American embargo on Cuba?



Booting to an encrypted Debian install, which has /boot on LVM-on-LUKS



Unicorn Meta Zoo #1: Why another podcast?
Announcing the arrival of Valued Associate #679: Cesar Manara
2019 Community Moderator Election Results
Why I closed the “Why is Kali so hard” questionCan Grub2 multi-boot LUKS/LVM distros with only one boot partition?Ubuntu overwrites grub, no boot option encrypted debianGrub disable recovery not working on detected OSBoot Entry for Loading Encrypted LVMBoot Debian and Gentoo with Grub. Kernel Panic!Chainloading in LUKS on LVM from ESPModify LUKS encryption after installBooting from LVM on encrypted devicedebian and grub with raid10+lvm+luksUnable to enable discard/fstrim on a luks encrypted lvm-volume with Siduction (Debian Unstable)





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







3















I have a setup with a grub2 bootloader, and the rest of the system on an encrypted partition (LVM-on-LUKS). I have two OSes installed inside of the LUKS container, Kali Sana and Debian 8, as well as a shared swap partition.



This was setup by installing Kali with full disk encryption, and then making room for Debian. The grub install is from Kali.



I am fully aware that it is simply easier to have a second /boot partition for Debian. However, given the way this was setup, there is no room left for the Debian bootloader, and resizing everything to make room will be a pain.



So, here is what I need to do under grub:




  • Mount the encrypted partition (already managed to do this)

  • Start initramfs and the kernel for Debian (This is where there is trouble).


I have done some research on this, and I am attempting to do this by editing the /boot/grub/custom.cfg file. After each edit, I have run sudo grub-mkconfig and sudo update-grub. Then I have restarted to see if it will boot. While it can decrypt the LUKS container, it can't find initramfs or the kernel.



Here is my custom.cfg file. Note: I am fuzzy on what all of this does. It is most likely completely wrong.



menuentry "Debian 8 Jessie"{
insmod luks
insmod lvm
cryptdevice=UUID=ffe7a64d-e552-4db9-b0f3-1e42be118059:cryptolvm
set root=/dev/Outsider-vg/Outsider-debianroot
linux /boot/vmlinuz-3.16.0-4-amd64 root=/dev/Outsider-vg/Outsider-debianroot
initrd /boot/initrd.img-3.16.0-4-amd64
}


Note about the above: cryptdevice=UUID=ffe7a64d-e552-4db9-b0f3-1e42be118059:cryptolvm was originally set root=/dev/sda5. This version of the file fails to decrypt the container. Note that I already know how to get this to work, I was just messing with it to see if changing it would help.



I have been referencing this link for help editing this file.



Basically, I need to know the syntax to point grub at the correct initramfs and vmlinuz files, after the LUKS partition has been decrypted. They are under the logical volume Outsider--debianroot. My only real issue is that I don't know how to do this.



I apologize for being somewhat vague. Part of the problem is that I am not sure what I am looking for. If you do not have an answer, but can direct me to a comprehensive guide to editing custom.cfg, that would also be appreciated. Please let me know if you need more details.



EDIT: Upon further research, here is what I have found:



Basically, I need to give Grub the correct path to a root directory which is on an LVM. After doing some digging around on the file system, I have found two paths which could work: /dev/mapper/volumeGroup-volumeName and /dev/volumeGroup/volumeName. In the case of the above example, they are /dev/mapper/Outsider--vg-Outsider--debianroot and /dev/Outsider-vg/Outsider-debianroot.



I need to know which is the path to the correct root directory, allowing that distro to boot. Either one is right, both need to be used together, or there is a different path which I am missing which I need to use instead. Any ideas?



Furthermore, what is the difference between these two paths? What do they each point to? What is the difference between /dev/mapper/volumeGroup and just /dev/volumeGroup?



EDIT 2: I believe that /dev/volumeGroup/volumeName is the correct path, based off of the end syntax for this tutorial. I will experiment with this and report back.



Note: I will come and clean this up later, when I have solved it.










share|improve this question
















bumped to the homepage by Community 2 hours ago


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
















  • If you've solved the problem, add it as an Answer, not as an edit to the post, please.

    – Jeff Schaller
    Mar 26 '17 at 19:04


















3















I have a setup with a grub2 bootloader, and the rest of the system on an encrypted partition (LVM-on-LUKS). I have two OSes installed inside of the LUKS container, Kali Sana and Debian 8, as well as a shared swap partition.



This was setup by installing Kali with full disk encryption, and then making room for Debian. The grub install is from Kali.



I am fully aware that it is simply easier to have a second /boot partition for Debian. However, given the way this was setup, there is no room left for the Debian bootloader, and resizing everything to make room will be a pain.



So, here is what I need to do under grub:




  • Mount the encrypted partition (already managed to do this)

  • Start initramfs and the kernel for Debian (This is where there is trouble).


I have done some research on this, and I am attempting to do this by editing the /boot/grub/custom.cfg file. After each edit, I have run sudo grub-mkconfig and sudo update-grub. Then I have restarted to see if it will boot. While it can decrypt the LUKS container, it can't find initramfs or the kernel.



Here is my custom.cfg file. Note: I am fuzzy on what all of this does. It is most likely completely wrong.



menuentry "Debian 8 Jessie"{
insmod luks
insmod lvm
cryptdevice=UUID=ffe7a64d-e552-4db9-b0f3-1e42be118059:cryptolvm
set root=/dev/Outsider-vg/Outsider-debianroot
linux /boot/vmlinuz-3.16.0-4-amd64 root=/dev/Outsider-vg/Outsider-debianroot
initrd /boot/initrd.img-3.16.0-4-amd64
}


Note about the above: cryptdevice=UUID=ffe7a64d-e552-4db9-b0f3-1e42be118059:cryptolvm was originally set root=/dev/sda5. This version of the file fails to decrypt the container. Note that I already know how to get this to work, I was just messing with it to see if changing it would help.



I have been referencing this link for help editing this file.



Basically, I need to know the syntax to point grub at the correct initramfs and vmlinuz files, after the LUKS partition has been decrypted. They are under the logical volume Outsider--debianroot. My only real issue is that I don't know how to do this.



I apologize for being somewhat vague. Part of the problem is that I am not sure what I am looking for. If you do not have an answer, but can direct me to a comprehensive guide to editing custom.cfg, that would also be appreciated. Please let me know if you need more details.



EDIT: Upon further research, here is what I have found:



Basically, I need to give Grub the correct path to a root directory which is on an LVM. After doing some digging around on the file system, I have found two paths which could work: /dev/mapper/volumeGroup-volumeName and /dev/volumeGroup/volumeName. In the case of the above example, they are /dev/mapper/Outsider--vg-Outsider--debianroot and /dev/Outsider-vg/Outsider-debianroot.



I need to know which is the path to the correct root directory, allowing that distro to boot. Either one is right, both need to be used together, or there is a different path which I am missing which I need to use instead. Any ideas?



Furthermore, what is the difference between these two paths? What do they each point to? What is the difference between /dev/mapper/volumeGroup and just /dev/volumeGroup?



EDIT 2: I believe that /dev/volumeGroup/volumeName is the correct path, based off of the end syntax for this tutorial. I will experiment with this and report back.



Note: I will come and clean this up later, when I have solved it.










share|improve this question
















bumped to the homepage by Community 2 hours ago


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
















  • If you've solved the problem, add it as an Answer, not as an edit to the post, please.

    – Jeff Schaller
    Mar 26 '17 at 19:04














3












3








3








I have a setup with a grub2 bootloader, and the rest of the system on an encrypted partition (LVM-on-LUKS). I have two OSes installed inside of the LUKS container, Kali Sana and Debian 8, as well as a shared swap partition.



This was setup by installing Kali with full disk encryption, and then making room for Debian. The grub install is from Kali.



I am fully aware that it is simply easier to have a second /boot partition for Debian. However, given the way this was setup, there is no room left for the Debian bootloader, and resizing everything to make room will be a pain.



So, here is what I need to do under grub:




  • Mount the encrypted partition (already managed to do this)

  • Start initramfs and the kernel for Debian (This is where there is trouble).


I have done some research on this, and I am attempting to do this by editing the /boot/grub/custom.cfg file. After each edit, I have run sudo grub-mkconfig and sudo update-grub. Then I have restarted to see if it will boot. While it can decrypt the LUKS container, it can't find initramfs or the kernel.



Here is my custom.cfg file. Note: I am fuzzy on what all of this does. It is most likely completely wrong.



menuentry "Debian 8 Jessie"{
insmod luks
insmod lvm
cryptdevice=UUID=ffe7a64d-e552-4db9-b0f3-1e42be118059:cryptolvm
set root=/dev/Outsider-vg/Outsider-debianroot
linux /boot/vmlinuz-3.16.0-4-amd64 root=/dev/Outsider-vg/Outsider-debianroot
initrd /boot/initrd.img-3.16.0-4-amd64
}


Note about the above: cryptdevice=UUID=ffe7a64d-e552-4db9-b0f3-1e42be118059:cryptolvm was originally set root=/dev/sda5. This version of the file fails to decrypt the container. Note that I already know how to get this to work, I was just messing with it to see if changing it would help.



I have been referencing this link for help editing this file.



Basically, I need to know the syntax to point grub at the correct initramfs and vmlinuz files, after the LUKS partition has been decrypted. They are under the logical volume Outsider--debianroot. My only real issue is that I don't know how to do this.



I apologize for being somewhat vague. Part of the problem is that I am not sure what I am looking for. If you do not have an answer, but can direct me to a comprehensive guide to editing custom.cfg, that would also be appreciated. Please let me know if you need more details.



EDIT: Upon further research, here is what I have found:



Basically, I need to give Grub the correct path to a root directory which is on an LVM. After doing some digging around on the file system, I have found two paths which could work: /dev/mapper/volumeGroup-volumeName and /dev/volumeGroup/volumeName. In the case of the above example, they are /dev/mapper/Outsider--vg-Outsider--debianroot and /dev/Outsider-vg/Outsider-debianroot.



I need to know which is the path to the correct root directory, allowing that distro to boot. Either one is right, both need to be used together, or there is a different path which I am missing which I need to use instead. Any ideas?



Furthermore, what is the difference between these two paths? What do they each point to? What is the difference between /dev/mapper/volumeGroup and just /dev/volumeGroup?



EDIT 2: I believe that /dev/volumeGroup/volumeName is the correct path, based off of the end syntax for this tutorial. I will experiment with this and report back.



Note: I will come and clean this up later, when I have solved it.










share|improve this question
















I have a setup with a grub2 bootloader, and the rest of the system on an encrypted partition (LVM-on-LUKS). I have two OSes installed inside of the LUKS container, Kali Sana and Debian 8, as well as a shared swap partition.



This was setup by installing Kali with full disk encryption, and then making room for Debian. The grub install is from Kali.



I am fully aware that it is simply easier to have a second /boot partition for Debian. However, given the way this was setup, there is no room left for the Debian bootloader, and resizing everything to make room will be a pain.



So, here is what I need to do under grub:




  • Mount the encrypted partition (already managed to do this)

  • Start initramfs and the kernel for Debian (This is where there is trouble).


I have done some research on this, and I am attempting to do this by editing the /boot/grub/custom.cfg file. After each edit, I have run sudo grub-mkconfig and sudo update-grub. Then I have restarted to see if it will boot. While it can decrypt the LUKS container, it can't find initramfs or the kernel.



Here is my custom.cfg file. Note: I am fuzzy on what all of this does. It is most likely completely wrong.



menuentry "Debian 8 Jessie"{
insmod luks
insmod lvm
cryptdevice=UUID=ffe7a64d-e552-4db9-b0f3-1e42be118059:cryptolvm
set root=/dev/Outsider-vg/Outsider-debianroot
linux /boot/vmlinuz-3.16.0-4-amd64 root=/dev/Outsider-vg/Outsider-debianroot
initrd /boot/initrd.img-3.16.0-4-amd64
}


Note about the above: cryptdevice=UUID=ffe7a64d-e552-4db9-b0f3-1e42be118059:cryptolvm was originally set root=/dev/sda5. This version of the file fails to decrypt the container. Note that I already know how to get this to work, I was just messing with it to see if changing it would help.



I have been referencing this link for help editing this file.



Basically, I need to know the syntax to point grub at the correct initramfs and vmlinuz files, after the LUKS partition has been decrypted. They are under the logical volume Outsider--debianroot. My only real issue is that I don't know how to do this.



I apologize for being somewhat vague. Part of the problem is that I am not sure what I am looking for. If you do not have an answer, but can direct me to a comprehensive guide to editing custom.cfg, that would also be appreciated. Please let me know if you need more details.



EDIT: Upon further research, here is what I have found:



Basically, I need to give Grub the correct path to a root directory which is on an LVM. After doing some digging around on the file system, I have found two paths which could work: /dev/mapper/volumeGroup-volumeName and /dev/volumeGroup/volumeName. In the case of the above example, they are /dev/mapper/Outsider--vg-Outsider--debianroot and /dev/Outsider-vg/Outsider-debianroot.



I need to know which is the path to the correct root directory, allowing that distro to boot. Either one is right, both need to be used together, or there is a different path which I am missing which I need to use instead. Any ideas?



Furthermore, what is the difference between these two paths? What do they each point to? What is the difference between /dev/mapper/volumeGroup and just /dev/volumeGroup?



EDIT 2: I believe that /dev/volumeGroup/volumeName is the correct path, based off of the end syntax for this tutorial. I will experiment with this and report back.



Note: I will come and clean this up later, when I have solved it.







kernel dual-boot lvm grub luks






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 20 '18 at 7:13









Rui F Ribeiro

42.3k1485143




42.3k1485143










asked Feb 6 '17 at 6:17









MonsoonMonsoon

165




165





bumped to the homepage by Community 2 hours 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 2 hours ago


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















  • If you've solved the problem, add it as an Answer, not as an edit to the post, please.

    – Jeff Schaller
    Mar 26 '17 at 19:04



















  • If you've solved the problem, add it as an Answer, not as an edit to the post, please.

    – Jeff Schaller
    Mar 26 '17 at 19:04

















If you've solved the problem, add it as an Answer, not as an edit to the post, please.

– Jeff Schaller
Mar 26 '17 at 19:04





If you've solved the problem, add it as an Answer, not as an edit to the post, please.

– Jeff Schaller
Mar 26 '17 at 19:04










1 Answer
1






active

oldest

votes


















0














You should have something like:



menuentry 'Debian' --class debian --class gnu-linux --class gnu --class os {
load_video
set gfxpayload=keep
insmod gzio
insmod ext2
insmod fat
echo 'Loading Linux ...'
linux /boot/vmlinuz-3.16.0-4-amd64 cryptdevice=UUID=ffe7a64d-e552-4db9-b0f3-1e42be118059:cryptolvm root=/dev/Outsider-vg/Outsider-debianroot rw
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.16.0-4-amd64
}


But note that insmod part_gpt should already be added in your grub.cfg. lvm and luks are not needed because it is the kernel that will handle it (you need proper kernel hooks), grub only load the linux image.






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%2f342800%2fbooting-to-an-encrypted-debian-install-which-has-boot-on-lvm-on-luks%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














    You should have something like:



    menuentry 'Debian' --class debian --class gnu-linux --class gnu --class os {
    load_video
    set gfxpayload=keep
    insmod gzio
    insmod ext2
    insmod fat
    echo 'Loading Linux ...'
    linux /boot/vmlinuz-3.16.0-4-amd64 cryptdevice=UUID=ffe7a64d-e552-4db9-b0f3-1e42be118059:cryptolvm root=/dev/Outsider-vg/Outsider-debianroot rw
    echo 'Loading initial ramdisk ...'
    initrd /boot/initrd.img-3.16.0-4-amd64
    }


    But note that insmod part_gpt should already be added in your grub.cfg. lvm and luks are not needed because it is the kernel that will handle it (you need proper kernel hooks), grub only load the linux image.






    share|improve this answer




























      0














      You should have something like:



      menuentry 'Debian' --class debian --class gnu-linux --class gnu --class os {
      load_video
      set gfxpayload=keep
      insmod gzio
      insmod ext2
      insmod fat
      echo 'Loading Linux ...'
      linux /boot/vmlinuz-3.16.0-4-amd64 cryptdevice=UUID=ffe7a64d-e552-4db9-b0f3-1e42be118059:cryptolvm root=/dev/Outsider-vg/Outsider-debianroot rw
      echo 'Loading initial ramdisk ...'
      initrd /boot/initrd.img-3.16.0-4-amd64
      }


      But note that insmod part_gpt should already be added in your grub.cfg. lvm and luks are not needed because it is the kernel that will handle it (you need proper kernel hooks), grub only load the linux image.






      share|improve this answer


























        0












        0








        0







        You should have something like:



        menuentry 'Debian' --class debian --class gnu-linux --class gnu --class os {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod ext2
        insmod fat
        echo 'Loading Linux ...'
        linux /boot/vmlinuz-3.16.0-4-amd64 cryptdevice=UUID=ffe7a64d-e552-4db9-b0f3-1e42be118059:cryptolvm root=/dev/Outsider-vg/Outsider-debianroot rw
        echo 'Loading initial ramdisk ...'
        initrd /boot/initrd.img-3.16.0-4-amd64
        }


        But note that insmod part_gpt should already be added in your grub.cfg. lvm and luks are not needed because it is the kernel that will handle it (you need proper kernel hooks), grub only load the linux image.






        share|improve this answer













        You should have something like:



        menuentry 'Debian' --class debian --class gnu-linux --class gnu --class os {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod ext2
        insmod fat
        echo 'Loading Linux ...'
        linux /boot/vmlinuz-3.16.0-4-amd64 cryptdevice=UUID=ffe7a64d-e552-4db9-b0f3-1e42be118059:cryptolvm root=/dev/Outsider-vg/Outsider-debianroot rw
        echo 'Loading initial ramdisk ...'
        initrd /boot/initrd.img-3.16.0-4-amd64
        }


        But note that insmod part_gpt should already be added in your grub.cfg. lvm and luks are not needed because it is the kernel that will handle it (you need proper kernel hooks), grub only load the linux image.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 21 at 18:07









        norajnoraj

        14117




        14117






























            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%2f342800%2fbooting-to-an-encrypted-debian-install-which-has-boot-on-lvm-on-luks%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

            Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

            Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

            Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...