How to auto mount a partition during initramfs/inird phase?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I have an encrypted Debian linux system. I also try to detach the LUKS header from the encrypted container. The whole /boot/ partition will be stored on a separate device. I thought I could place the LUKS header under /boot/header/luks.img , but during the initramfs/initrd phase this path doesn't exists because the /boot/ partition isn't mounted yet.



So the question is how to automatically mount the /boot/ partition before the system tries to open the encrypted device? Or is there any other (or better) way to make it work?







share|improve this question




















  • Does /etc/crypttab get it working right? I think there's a "load first or second" option that might help, but I'm not able to check/search now, if crypttab isn't too "late" already
    – Xen2050
    Mar 16 at 21:55










  • It's a little bit complicated setup when you want to make it work the way I wanted to. I've managed to do it ultimately. See the answer
    – Mikhail Morfikov
    Mar 16 at 23:34














up vote
0
down vote

favorite












I have an encrypted Debian linux system. I also try to detach the LUKS header from the encrypted container. The whole /boot/ partition will be stored on a separate device. I thought I could place the LUKS header under /boot/header/luks.img , but during the initramfs/initrd phase this path doesn't exists because the /boot/ partition isn't mounted yet.



So the question is how to automatically mount the /boot/ partition before the system tries to open the encrypted device? Or is there any other (or better) way to make it work?







share|improve this question




















  • Does /etc/crypttab get it working right? I think there's a "load first or second" option that might help, but I'm not able to check/search now, if crypttab isn't too "late" already
    – Xen2050
    Mar 16 at 21:55










  • It's a little bit complicated setup when you want to make it work the way I wanted to. I've managed to do it ultimately. See the answer
    – Mikhail Morfikov
    Mar 16 at 23:34












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I have an encrypted Debian linux system. I also try to detach the LUKS header from the encrypted container. The whole /boot/ partition will be stored on a separate device. I thought I could place the LUKS header under /boot/header/luks.img , but during the initramfs/initrd phase this path doesn't exists because the /boot/ partition isn't mounted yet.



So the question is how to automatically mount the /boot/ partition before the system tries to open the encrypted device? Or is there any other (or better) way to make it work?







share|improve this question












I have an encrypted Debian linux system. I also try to detach the LUKS header from the encrypted container. The whole /boot/ partition will be stored on a separate device. I thought I could place the LUKS header under /boot/header/luks.img , but during the initramfs/initrd phase this path doesn't exists because the /boot/ partition isn't mounted yet.



So the question is how to automatically mount the /boot/ partition before the system tries to open the encrypted device? Or is there any other (or better) way to make it work?









share|improve this question











share|improve this question




share|improve this question










asked Mar 15 at 19:48









Mikhail Morfikov

4,290114067




4,290114067











  • Does /etc/crypttab get it working right? I think there's a "load first or second" option that might help, but I'm not able to check/search now, if crypttab isn't too "late" already
    – Xen2050
    Mar 16 at 21:55










  • It's a little bit complicated setup when you want to make it work the way I wanted to. I've managed to do it ultimately. See the answer
    – Mikhail Morfikov
    Mar 16 at 23:34
















  • Does /etc/crypttab get it working right? I think there's a "load first or second" option that might help, but I'm not able to check/search now, if crypttab isn't too "late" already
    – Xen2050
    Mar 16 at 21:55










  • It's a little bit complicated setup when you want to make it work the way I wanted to. I've managed to do it ultimately. See the answer
    – Mikhail Morfikov
    Mar 16 at 23:34















Does /etc/crypttab get it working right? I think there's a "load first or second" option that might help, but I'm not able to check/search now, if crypttab isn't too "late" already
– Xen2050
Mar 16 at 21:55




Does /etc/crypttab get it working right? I think there's a "load first or second" option that might help, but I'm not able to check/search now, if crypttab isn't too "late" already
– Xen2050
Mar 16 at 21:55












It's a little bit complicated setup when you want to make it work the way I wanted to. I've managed to do it ultimately. See the answer
– Mikhail Morfikov
Mar 16 at 23:34




It's a little bit complicated setup when you want to make it work the way I wanted to. I've managed to do it ultimately. See the answer
– Mikhail Morfikov
Mar 16 at 23:34










1 Answer
1






active

oldest

votes

















up vote
0
down vote













Basically, this setup won't work OOTB because you have to mount some partition (in this case /boot/) in the initramfs/initrd phase, and by default there's no partition mounted there. Without the /boot/ partition you can't use the LUKS header. So the only way to make it work is to write some custom scripts that will mount/unmount the partition in the initramfs/initrd phase.



I've manage to write some HowTo on this subject, and the setup works really great.






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',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    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%2f430475%2fhow-to-auto-mount-a-partition-during-initramfs-inird-phase%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    Basically, this setup won't work OOTB because you have to mount some partition (in this case /boot/) in the initramfs/initrd phase, and by default there's no partition mounted there. Without the /boot/ partition you can't use the LUKS header. So the only way to make it work is to write some custom scripts that will mount/unmount the partition in the initramfs/initrd phase.



    I've manage to write some HowTo on this subject, and the setup works really great.






    share|improve this answer
























      up vote
      0
      down vote













      Basically, this setup won't work OOTB because you have to mount some partition (in this case /boot/) in the initramfs/initrd phase, and by default there's no partition mounted there. Without the /boot/ partition you can't use the LUKS header. So the only way to make it work is to write some custom scripts that will mount/unmount the partition in the initramfs/initrd phase.



      I've manage to write some HowTo on this subject, and the setup works really great.






      share|improve this answer






















        up vote
        0
        down vote










        up vote
        0
        down vote









        Basically, this setup won't work OOTB because you have to mount some partition (in this case /boot/) in the initramfs/initrd phase, and by default there's no partition mounted there. Without the /boot/ partition you can't use the LUKS header. So the only way to make it work is to write some custom scripts that will mount/unmount the partition in the initramfs/initrd phase.



        I've manage to write some HowTo on this subject, and the setup works really great.






        share|improve this answer












        Basically, this setup won't work OOTB because you have to mount some partition (in this case /boot/) in the initramfs/initrd phase, and by default there's no partition mounted there. Without the /boot/ partition you can't use the LUKS header. So the only way to make it work is to write some custom scripts that will mount/unmount the partition in the initramfs/initrd phase.



        I've manage to write some HowTo on this subject, and the setup works really great.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 16 at 23:33









        Mikhail Morfikov

        4,290114067




        4,290114067






















             

            draft saved


            draft discarded


























             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f430475%2fhow-to-auto-mount-a-partition-during-initramfs-inird-phase%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Displaying single band from multi-band raster using QGIS

            How many registers does an x86_64 CPU actually have?