Setting up luks encrypted drive to automount












0















So I'm trying to setup my luks encrypted drive which holds the root partition to automount on server start. I'm having an issue where it doesn't automount and instead prompts for a passphrase.



lsblk Output:
sda5
|_sda5_crypt
|_srv--vg-root lvm /
|_srv--vg-swap_1 lvm [SWAP]

/etc/crypttab:
sda5_crypt UUID=uuid goes here /boot/keyfile luks,discard

/etc/fstab:
/dev/mapper/srv--vg-root / ext4 errors=remount-ro 0 1


Now I know that I'm supposed to create a new entry like



/dev/mapper/sda5_crypt / ext4 defaults 0 2


but my / is already defined in fstab, how do I add the crypt entry to fstab so it knows to mount it so the lvm volume groups can be mounted on boot?










share|improve this question























  • You must enter at least one password, otherwise what would be the point of an encrypted drive? You can auto-mount other partitions because their keys are kets in the first partition which isn't auto-mounted. One can also wonder what is the point of encrypting a server? Are you expecting it to be stolen with sensitive data on it?

    – xenoid
    Jan 16 at 15:27











  • LUKS supports using keyfiles, and /boot is accessible outside of the encrypted partition. I know it's not the best solution, but this is for a client and unfortunately, it's what they want.

    – Mekkon
    Jan 16 at 15:58
















0















So I'm trying to setup my luks encrypted drive which holds the root partition to automount on server start. I'm having an issue where it doesn't automount and instead prompts for a passphrase.



lsblk Output:
sda5
|_sda5_crypt
|_srv--vg-root lvm /
|_srv--vg-swap_1 lvm [SWAP]

/etc/crypttab:
sda5_crypt UUID=uuid goes here /boot/keyfile luks,discard

/etc/fstab:
/dev/mapper/srv--vg-root / ext4 errors=remount-ro 0 1


Now I know that I'm supposed to create a new entry like



/dev/mapper/sda5_crypt / ext4 defaults 0 2


but my / is already defined in fstab, how do I add the crypt entry to fstab so it knows to mount it so the lvm volume groups can be mounted on boot?










share|improve this question























  • You must enter at least one password, otherwise what would be the point of an encrypted drive? You can auto-mount other partitions because their keys are kets in the first partition which isn't auto-mounted. One can also wonder what is the point of encrypting a server? Are you expecting it to be stolen with sensitive data on it?

    – xenoid
    Jan 16 at 15:27











  • LUKS supports using keyfiles, and /boot is accessible outside of the encrypted partition. I know it's not the best solution, but this is for a client and unfortunately, it's what they want.

    – Mekkon
    Jan 16 at 15:58














0












0








0








So I'm trying to setup my luks encrypted drive which holds the root partition to automount on server start. I'm having an issue where it doesn't automount and instead prompts for a passphrase.



lsblk Output:
sda5
|_sda5_crypt
|_srv--vg-root lvm /
|_srv--vg-swap_1 lvm [SWAP]

/etc/crypttab:
sda5_crypt UUID=uuid goes here /boot/keyfile luks,discard

/etc/fstab:
/dev/mapper/srv--vg-root / ext4 errors=remount-ro 0 1


Now I know that I'm supposed to create a new entry like



/dev/mapper/sda5_crypt / ext4 defaults 0 2


but my / is already defined in fstab, how do I add the crypt entry to fstab so it knows to mount it so the lvm volume groups can be mounted on boot?










share|improve this question














So I'm trying to setup my luks encrypted drive which holds the root partition to automount on server start. I'm having an issue where it doesn't automount and instead prompts for a passphrase.



lsblk Output:
sda5
|_sda5_crypt
|_srv--vg-root lvm /
|_srv--vg-swap_1 lvm [SWAP]

/etc/crypttab:
sda5_crypt UUID=uuid goes here /boot/keyfile luks,discard

/etc/fstab:
/dev/mapper/srv--vg-root / ext4 errors=remount-ro 0 1


Now I know that I'm supposed to create a new entry like



/dev/mapper/sda5_crypt / ext4 defaults 0 2


but my / is already defined in fstab, how do I add the crypt entry to fstab so it knows to mount it so the lvm volume groups can be mounted on boot?







ubuntu luks ubuntu-18.04






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 16 at 14:59









MekkonMekkon

1




1













  • You must enter at least one password, otherwise what would be the point of an encrypted drive? You can auto-mount other partitions because their keys are kets in the first partition which isn't auto-mounted. One can also wonder what is the point of encrypting a server? Are you expecting it to be stolen with sensitive data on it?

    – xenoid
    Jan 16 at 15:27











  • LUKS supports using keyfiles, and /boot is accessible outside of the encrypted partition. I know it's not the best solution, but this is for a client and unfortunately, it's what they want.

    – Mekkon
    Jan 16 at 15:58



















  • You must enter at least one password, otherwise what would be the point of an encrypted drive? You can auto-mount other partitions because their keys are kets in the first partition which isn't auto-mounted. One can also wonder what is the point of encrypting a server? Are you expecting it to be stolen with sensitive data on it?

    – xenoid
    Jan 16 at 15:27











  • LUKS supports using keyfiles, and /boot is accessible outside of the encrypted partition. I know it's not the best solution, but this is for a client and unfortunately, it's what they want.

    – Mekkon
    Jan 16 at 15:58

















You must enter at least one password, otherwise what would be the point of an encrypted drive? You can auto-mount other partitions because their keys are kets in the first partition which isn't auto-mounted. One can also wonder what is the point of encrypting a server? Are you expecting it to be stolen with sensitive data on it?

– xenoid
Jan 16 at 15:27





You must enter at least one password, otherwise what would be the point of an encrypted drive? You can auto-mount other partitions because their keys are kets in the first partition which isn't auto-mounted. One can also wonder what is the point of encrypting a server? Are you expecting it to be stolen with sensitive data on it?

– xenoid
Jan 16 at 15:27













LUKS supports using keyfiles, and /boot is accessible outside of the encrypted partition. I know it's not the best solution, but this is for a client and unfortunately, it's what they want.

– Mekkon
Jan 16 at 15:58





LUKS supports using keyfiles, and /boot is accessible outside of the encrypted partition. I know it's not the best solution, but this is for a client and unfortunately, it's what they want.

– Mekkon
Jan 16 at 15:58










1 Answer
1






active

oldest

votes


















0














Does it prompt for a password at boot? If so, then it is already trying to automount the partition, but the keyfile is unavailable / incorrect. You could try specifying the partition the keyfile is on by changing the path to /dev/disk/by-uuid/<uuid>:/keyfile






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "3"
    };
    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: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    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%2fsuperuser.com%2fquestions%2f1394978%2fsetting-up-luks-encrypted-drive-to-automount%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














    Does it prompt for a password at boot? If so, then it is already trying to automount the partition, but the keyfile is unavailable / incorrect. You could try specifying the partition the keyfile is on by changing the path to /dev/disk/by-uuid/<uuid>:/keyfile






    share|improve this answer




























      0














      Does it prompt for a password at boot? If so, then it is already trying to automount the partition, but the keyfile is unavailable / incorrect. You could try specifying the partition the keyfile is on by changing the path to /dev/disk/by-uuid/<uuid>:/keyfile






      share|improve this answer


























        0












        0








        0







        Does it prompt for a password at boot? If so, then it is already trying to automount the partition, but the keyfile is unavailable / incorrect. You could try specifying the partition the keyfile is on by changing the path to /dev/disk/by-uuid/<uuid>:/keyfile






        share|improve this answer













        Does it prompt for a password at boot? If so, then it is already trying to automount the partition, but the keyfile is unavailable / incorrect. You could try specifying the partition the keyfile is on by changing the path to /dev/disk/by-uuid/<uuid>:/keyfile







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 17 at 10:50









        user10186803user10186803

        12




        12






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Super User!


            • 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%2fsuperuser.com%2fquestions%2f1394978%2fsetting-up-luks-encrypted-drive-to-automount%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

            Plaza Victoria

            Puebla de Zaragoza

            Musa