How to change the password of an encrypted LVM system (done with the alternate Installation)?











up vote
50
down vote

favorite
19












I installed Ubuntu 11.10 with the alternate CD and encrypted the whole system (except boot) with the encrypted LVM. Everything works great as before, but I would like to change the password of the encrypted LVM. I tried to follow the Tips and Tricks of this article, but it does not work.
After typing:



sudo cryptsetup luksDump /dev/sda5


It says: "Device /dev/sd5 doesn't exist or access denied."
I thought the encrypted partition is /dev/sda5.
Any help how to change the password?










share|improve this question




















  • 1




    Oops, it was indeed a typo! I always typed /dev/sd5 instead of /dev/sd5. Thanks Hamish for the hint. So I answer the question with the information from Andreas Härter (blog.andreas-haerter.com/2011/06/18/ubuntu-full-disk-encryption-lvm-luks#tips_and_tricks)
    – Filbuntu
    Mar 5 '12 at 12:53








  • 2




    possible duplicate of How to change LUKS passphrase?
    – Gilles
    Jul 11 '12 at 23:09















up vote
50
down vote

favorite
19












I installed Ubuntu 11.10 with the alternate CD and encrypted the whole system (except boot) with the encrypted LVM. Everything works great as before, but I would like to change the password of the encrypted LVM. I tried to follow the Tips and Tricks of this article, but it does not work.
After typing:



sudo cryptsetup luksDump /dev/sda5


It says: "Device /dev/sd5 doesn't exist or access denied."
I thought the encrypted partition is /dev/sda5.
Any help how to change the password?










share|improve this question




















  • 1




    Oops, it was indeed a typo! I always typed /dev/sd5 instead of /dev/sd5. Thanks Hamish for the hint. So I answer the question with the information from Andreas Härter (blog.andreas-haerter.com/2011/06/18/ubuntu-full-disk-encryption-lvm-luks#tips_and_tricks)
    – Filbuntu
    Mar 5 '12 at 12:53








  • 2




    possible duplicate of How to change LUKS passphrase?
    – Gilles
    Jul 11 '12 at 23:09













up vote
50
down vote

favorite
19









up vote
50
down vote

favorite
19






19





I installed Ubuntu 11.10 with the alternate CD and encrypted the whole system (except boot) with the encrypted LVM. Everything works great as before, but I would like to change the password of the encrypted LVM. I tried to follow the Tips and Tricks of this article, but it does not work.
After typing:



sudo cryptsetup luksDump /dev/sda5


It says: "Device /dev/sd5 doesn't exist or access denied."
I thought the encrypted partition is /dev/sda5.
Any help how to change the password?










share|improve this question















I installed Ubuntu 11.10 with the alternate CD and encrypted the whole system (except boot) with the encrypted LVM. Everything works great as before, but I would like to change the password of the encrypted LVM. I tried to follow the Tips and Tricks of this article, but it does not work.
After typing:



sudo cryptsetup luksDump /dev/sda5


It says: "Device /dev/sd5 doesn't exist or access denied."
I thought the encrypted partition is /dev/sda5.
Any help how to change the password?







password encryption lvm






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 28 at 2:23

























asked Mar 4 '12 at 12:46









Filbuntu

2,620144274




2,620144274








  • 1




    Oops, it was indeed a typo! I always typed /dev/sd5 instead of /dev/sd5. Thanks Hamish for the hint. So I answer the question with the information from Andreas Härter (blog.andreas-haerter.com/2011/06/18/ubuntu-full-disk-encryption-lvm-luks#tips_and_tricks)
    – Filbuntu
    Mar 5 '12 at 12:53








  • 2




    possible duplicate of How to change LUKS passphrase?
    – Gilles
    Jul 11 '12 at 23:09














  • 1




    Oops, it was indeed a typo! I always typed /dev/sd5 instead of /dev/sd5. Thanks Hamish for the hint. So I answer the question with the information from Andreas Härter (blog.andreas-haerter.com/2011/06/18/ubuntu-full-disk-encryption-lvm-luks#tips_and_tricks)
    – Filbuntu
    Mar 5 '12 at 12:53








  • 2




    possible duplicate of How to change LUKS passphrase?
    – Gilles
    Jul 11 '12 at 23:09








1




1




Oops, it was indeed a typo! I always typed /dev/sd5 instead of /dev/sd5. Thanks Hamish for the hint. So I answer the question with the information from Andreas Härter (blog.andreas-haerter.com/2011/06/18/ubuntu-full-disk-encryption-lvm-luks#tips_and_tricks)
– Filbuntu
Mar 5 '12 at 12:53






Oops, it was indeed a typo! I always typed /dev/sd5 instead of /dev/sd5. Thanks Hamish for the hint. So I answer the question with the information from Andreas Härter (blog.andreas-haerter.com/2011/06/18/ubuntu-full-disk-encryption-lvm-luks#tips_and_tricks)
– Filbuntu
Mar 5 '12 at 12:53






2




2




possible duplicate of How to change LUKS passphrase?
– Gilles
Jul 11 '12 at 23:09




possible duplicate of How to change LUKS passphrase?
– Gilles
Jul 11 '12 at 23:09










6 Answers
6






active

oldest

votes

















up vote
39
down vote



accepted










Here is the answer that worked for me, after Hamish helped me to realize my typo.



First, you need to find out which is the encrypted LVM partition, it may be sda3, but it can also be sda5, sdX2, ...:



cat /etc/crypttab


To add a new password, use luksAddKey:



sudo cryptsetup luksAddKey /dev/sda3


To remove an existing password, use luksRemoveKey:



sudo cryptsetup luksRemoveKey /dev/sda3


View currently used slots of the encrypted partition:



sudo cryptsetup luksDump /dev/sd3


Cited from this blog. Thanks.






share|improve this answer



















  • 1




    does this imply you can have more than one password to unencrypt the disk?
    – bph
    Jan 18 '16 at 16:05






  • 4




    You can. I tested it out
    – bph
    Jan 25 '16 at 22:31






  • 1




    There are slots - eight of them I believe. Each slot is an unlock option. Could be 8 passwords if you wanted.
    – Cookie
    Jul 31 '16 at 14:44




















up vote
22
down vote













Download "Disks" from Software Manager. Run it. Select your encrypted device partition. Click gear icon. Select "Change passphrase". That's it






share|improve this answer




























    up vote
    11
    down vote













    Without thinking I set the passphrase to be really long, and it became a pain to type. I ended up using the following to change it to something more manageable.



    sudo cryptsetup luksChangeKey /dev/sda5





    share|improve this answer




























      up vote
      11
      down vote













      To see the slots used:



      sudo cryptsetup luksDump /dev/sda5


      And to find out which partition to use



      cat /etc/crypttab


      And if it is listed by uuid, use



      ls -l /dev/disk/by-uuid/{insert your uuid here}


      Then use



      sudo cryptsetup luksAddKey /dev/sda5
      sudo cryptsetup luksRemoveKey /dev/sda5


      or



      sudo cryptsetup luksChangeKey /dev/sda5


      and for faster reference (assuming only 1 entry in /etc/crypttab)



      sudo cryptsetup luksAddKey /dev/disk/by-uuid/$(cat /etc/crypttab | sed -e "s|(.*) UUID=(.*) none.*|2|g")
      sudo cryptsetup luksChangeKey /dev/disk/by-uuid/$(cat /etc/crypttab | sed -e "s|(.*) UUID=(.*) none.*|2|g")





      share|improve this answer






























        up vote
        6
        down vote













        The encrypted partition may well be using /dev/sda5 (note the a in sda5) and that is the device you probably need to use (unless that is just a typo in your question).



        However the encrypted device itself will have another name - something like /dev/mapper/cryptroot. For the device name you could:




        • look in the file /etc/crypttab - this will have both the partition and the mapper name in it, but only for permanent partitions

        • run mount and see what the mapper name is - this is useful when you have plugged in an encrypted disk via USB. (Though I'm not sure how you then find the actual underlying device name).






        share|improve this answer




























          up vote
          0
          down vote













          I had issues locating partition name, so created this guide:





          1. Locate your LMV partition



            # install jq if you don't have it
            sudo apt-get install jq

            # find LVM partition
            LVMPART=$(lsblk -p --json | jq -r '.blockdevices | select(.children) | .children | select(.children) as $partition | .children | select(.type == "crypt") | $partition.name')

            # check if it was found
            echo $LVMPART

            # (optional)
            # if above output is empty, locate it in a tree view using this command
            lsblk -p

            # partition `/dev/some_name` should be the parent object of the one with TYPE of `crypt`, set it
            LVMPART=`/dev/some_name`



          2. Check LVM partition meta by dumping it



            sudo cryptsetup luksDump $LVMPART



          3. Add new key (you can have multiple keys)



            sudo cryptsetup luksAddKey $LVMPART



          4. After dumping it again, you should see multiple keys



            sudo cryptsetup luksDump $LVMPART



          5. Delete old key if desired



            sudo cryptsetup luksRemoveKey $LVMPART







          share|improve this answer























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "89"
            };
            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: 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%2faskubuntu.com%2fquestions%2f109898%2fhow-to-change-the-password-of-an-encrypted-lvm-system-done-with-the-alternate-i%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            6 Answers
            6






            active

            oldest

            votes








            6 Answers
            6






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            39
            down vote



            accepted










            Here is the answer that worked for me, after Hamish helped me to realize my typo.



            First, you need to find out which is the encrypted LVM partition, it may be sda3, but it can also be sda5, sdX2, ...:



            cat /etc/crypttab


            To add a new password, use luksAddKey:



            sudo cryptsetup luksAddKey /dev/sda3


            To remove an existing password, use luksRemoveKey:



            sudo cryptsetup luksRemoveKey /dev/sda3


            View currently used slots of the encrypted partition:



            sudo cryptsetup luksDump /dev/sd3


            Cited from this blog. Thanks.






            share|improve this answer



















            • 1




              does this imply you can have more than one password to unencrypt the disk?
              – bph
              Jan 18 '16 at 16:05






            • 4




              You can. I tested it out
              – bph
              Jan 25 '16 at 22:31






            • 1




              There are slots - eight of them I believe. Each slot is an unlock option. Could be 8 passwords if you wanted.
              – Cookie
              Jul 31 '16 at 14:44

















            up vote
            39
            down vote



            accepted










            Here is the answer that worked for me, after Hamish helped me to realize my typo.



            First, you need to find out which is the encrypted LVM partition, it may be sda3, but it can also be sda5, sdX2, ...:



            cat /etc/crypttab


            To add a new password, use luksAddKey:



            sudo cryptsetup luksAddKey /dev/sda3


            To remove an existing password, use luksRemoveKey:



            sudo cryptsetup luksRemoveKey /dev/sda3


            View currently used slots of the encrypted partition:



            sudo cryptsetup luksDump /dev/sd3


            Cited from this blog. Thanks.






            share|improve this answer



















            • 1




              does this imply you can have more than one password to unencrypt the disk?
              – bph
              Jan 18 '16 at 16:05






            • 4




              You can. I tested it out
              – bph
              Jan 25 '16 at 22:31






            • 1




              There are slots - eight of them I believe. Each slot is an unlock option. Could be 8 passwords if you wanted.
              – Cookie
              Jul 31 '16 at 14:44















            up vote
            39
            down vote



            accepted







            up vote
            39
            down vote



            accepted






            Here is the answer that worked for me, after Hamish helped me to realize my typo.



            First, you need to find out which is the encrypted LVM partition, it may be sda3, but it can also be sda5, sdX2, ...:



            cat /etc/crypttab


            To add a new password, use luksAddKey:



            sudo cryptsetup luksAddKey /dev/sda3


            To remove an existing password, use luksRemoveKey:



            sudo cryptsetup luksRemoveKey /dev/sda3


            View currently used slots of the encrypted partition:



            sudo cryptsetup luksDump /dev/sd3


            Cited from this blog. Thanks.






            share|improve this answer














            Here is the answer that worked for me, after Hamish helped me to realize my typo.



            First, you need to find out which is the encrypted LVM partition, it may be sda3, but it can also be sda5, sdX2, ...:



            cat /etc/crypttab


            To add a new password, use luksAddKey:



            sudo cryptsetup luksAddKey /dev/sda3


            To remove an existing password, use luksRemoveKey:



            sudo cryptsetup luksRemoveKey /dev/sda3


            View currently used slots of the encrypted partition:



            sudo cryptsetup luksDump /dev/sd3


            Cited from this blog. Thanks.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Nov 22 at 1:16

























            answered Mar 5 '12 at 12:58









            Filbuntu

            2,620144274




            2,620144274








            • 1




              does this imply you can have more than one password to unencrypt the disk?
              – bph
              Jan 18 '16 at 16:05






            • 4




              You can. I tested it out
              – bph
              Jan 25 '16 at 22:31






            • 1




              There are slots - eight of them I believe. Each slot is an unlock option. Could be 8 passwords if you wanted.
              – Cookie
              Jul 31 '16 at 14:44
















            • 1




              does this imply you can have more than one password to unencrypt the disk?
              – bph
              Jan 18 '16 at 16:05






            • 4




              You can. I tested it out
              – bph
              Jan 25 '16 at 22:31






            • 1




              There are slots - eight of them I believe. Each slot is an unlock option. Could be 8 passwords if you wanted.
              – Cookie
              Jul 31 '16 at 14:44










            1




            1




            does this imply you can have more than one password to unencrypt the disk?
            – bph
            Jan 18 '16 at 16:05




            does this imply you can have more than one password to unencrypt the disk?
            – bph
            Jan 18 '16 at 16:05




            4




            4




            You can. I tested it out
            – bph
            Jan 25 '16 at 22:31




            You can. I tested it out
            – bph
            Jan 25 '16 at 22:31




            1




            1




            There are slots - eight of them I believe. Each slot is an unlock option. Could be 8 passwords if you wanted.
            – Cookie
            Jul 31 '16 at 14:44






            There are slots - eight of them I believe. Each slot is an unlock option. Could be 8 passwords if you wanted.
            – Cookie
            Jul 31 '16 at 14:44














            up vote
            22
            down vote













            Download "Disks" from Software Manager. Run it. Select your encrypted device partition. Click gear icon. Select "Change passphrase". That's it






            share|improve this answer

























              up vote
              22
              down vote













              Download "Disks" from Software Manager. Run it. Select your encrypted device partition. Click gear icon. Select "Change passphrase". That's it






              share|improve this answer























                up vote
                22
                down vote










                up vote
                22
                down vote









                Download "Disks" from Software Manager. Run it. Select your encrypted device partition. Click gear icon. Select "Change passphrase". That's it






                share|improve this answer












                Download "Disks" from Software Manager. Run it. Select your encrypted device partition. Click gear icon. Select "Change passphrase". That's it







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 28 '14 at 3:43









                zoubak

                22122




                22122






















                    up vote
                    11
                    down vote













                    Without thinking I set the passphrase to be really long, and it became a pain to type. I ended up using the following to change it to something more manageable.



                    sudo cryptsetup luksChangeKey /dev/sda5





                    share|improve this answer

























                      up vote
                      11
                      down vote













                      Without thinking I set the passphrase to be really long, and it became a pain to type. I ended up using the following to change it to something more manageable.



                      sudo cryptsetup luksChangeKey /dev/sda5





                      share|improve this answer























                        up vote
                        11
                        down vote










                        up vote
                        11
                        down vote









                        Without thinking I set the passphrase to be really long, and it became a pain to type. I ended up using the following to change it to something more manageable.



                        sudo cryptsetup luksChangeKey /dev/sda5





                        share|improve this answer












                        Without thinking I set the passphrase to be really long, and it became a pain to type. I ended up using the following to change it to something more manageable.



                        sudo cryptsetup luksChangeKey /dev/sda5






                        share|improve this answer












                        share|improve this answer



                        share|improve this answer










                        answered May 9 '15 at 1:41









                        jc00ke

                        23123




                        23123






















                            up vote
                            11
                            down vote













                            To see the slots used:



                            sudo cryptsetup luksDump /dev/sda5


                            And to find out which partition to use



                            cat /etc/crypttab


                            And if it is listed by uuid, use



                            ls -l /dev/disk/by-uuid/{insert your uuid here}


                            Then use



                            sudo cryptsetup luksAddKey /dev/sda5
                            sudo cryptsetup luksRemoveKey /dev/sda5


                            or



                            sudo cryptsetup luksChangeKey /dev/sda5


                            and for faster reference (assuming only 1 entry in /etc/crypttab)



                            sudo cryptsetup luksAddKey /dev/disk/by-uuid/$(cat /etc/crypttab | sed -e "s|(.*) UUID=(.*) none.*|2|g")
                            sudo cryptsetup luksChangeKey /dev/disk/by-uuid/$(cat /etc/crypttab | sed -e "s|(.*) UUID=(.*) none.*|2|g")





                            share|improve this answer



























                              up vote
                              11
                              down vote













                              To see the slots used:



                              sudo cryptsetup luksDump /dev/sda5


                              And to find out which partition to use



                              cat /etc/crypttab


                              And if it is listed by uuid, use



                              ls -l /dev/disk/by-uuid/{insert your uuid here}


                              Then use



                              sudo cryptsetup luksAddKey /dev/sda5
                              sudo cryptsetup luksRemoveKey /dev/sda5


                              or



                              sudo cryptsetup luksChangeKey /dev/sda5


                              and for faster reference (assuming only 1 entry in /etc/crypttab)



                              sudo cryptsetup luksAddKey /dev/disk/by-uuid/$(cat /etc/crypttab | sed -e "s|(.*) UUID=(.*) none.*|2|g")
                              sudo cryptsetup luksChangeKey /dev/disk/by-uuid/$(cat /etc/crypttab | sed -e "s|(.*) UUID=(.*) none.*|2|g")





                              share|improve this answer

























                                up vote
                                11
                                down vote










                                up vote
                                11
                                down vote









                                To see the slots used:



                                sudo cryptsetup luksDump /dev/sda5


                                And to find out which partition to use



                                cat /etc/crypttab


                                And if it is listed by uuid, use



                                ls -l /dev/disk/by-uuid/{insert your uuid here}


                                Then use



                                sudo cryptsetup luksAddKey /dev/sda5
                                sudo cryptsetup luksRemoveKey /dev/sda5


                                or



                                sudo cryptsetup luksChangeKey /dev/sda5


                                and for faster reference (assuming only 1 entry in /etc/crypttab)



                                sudo cryptsetup luksAddKey /dev/disk/by-uuid/$(cat /etc/crypttab | sed -e "s|(.*) UUID=(.*) none.*|2|g")
                                sudo cryptsetup luksChangeKey /dev/disk/by-uuid/$(cat /etc/crypttab | sed -e "s|(.*) UUID=(.*) none.*|2|g")





                                share|improve this answer














                                To see the slots used:



                                sudo cryptsetup luksDump /dev/sda5


                                And to find out which partition to use



                                cat /etc/crypttab


                                And if it is listed by uuid, use



                                ls -l /dev/disk/by-uuid/{insert your uuid here}


                                Then use



                                sudo cryptsetup luksAddKey /dev/sda5
                                sudo cryptsetup luksRemoveKey /dev/sda5


                                or



                                sudo cryptsetup luksChangeKey /dev/sda5


                                and for faster reference (assuming only 1 entry in /etc/crypttab)



                                sudo cryptsetup luksAddKey /dev/disk/by-uuid/$(cat /etc/crypttab | sed -e "s|(.*) UUID=(.*) none.*|2|g")
                                sudo cryptsetup luksChangeKey /dev/disk/by-uuid/$(cat /etc/crypttab | sed -e "s|(.*) UUID=(.*) none.*|2|g")






                                share|improve this answer














                                share|improve this answer



                                share|improve this answer








                                edited Aug 17 '16 at 9:09

























                                answered Aug 10 '16 at 14:20









                                Cookie

                                4911715




                                4911715






















                                    up vote
                                    6
                                    down vote













                                    The encrypted partition may well be using /dev/sda5 (note the a in sda5) and that is the device you probably need to use (unless that is just a typo in your question).



                                    However the encrypted device itself will have another name - something like /dev/mapper/cryptroot. For the device name you could:




                                    • look in the file /etc/crypttab - this will have both the partition and the mapper name in it, but only for permanent partitions

                                    • run mount and see what the mapper name is - this is useful when you have plugged in an encrypted disk via USB. (Though I'm not sure how you then find the actual underlying device name).






                                    share|improve this answer

























                                      up vote
                                      6
                                      down vote













                                      The encrypted partition may well be using /dev/sda5 (note the a in sda5) and that is the device you probably need to use (unless that is just a typo in your question).



                                      However the encrypted device itself will have another name - something like /dev/mapper/cryptroot. For the device name you could:




                                      • look in the file /etc/crypttab - this will have both the partition and the mapper name in it, but only for permanent partitions

                                      • run mount and see what the mapper name is - this is useful when you have plugged in an encrypted disk via USB. (Though I'm not sure how you then find the actual underlying device name).






                                      share|improve this answer























                                        up vote
                                        6
                                        down vote










                                        up vote
                                        6
                                        down vote









                                        The encrypted partition may well be using /dev/sda5 (note the a in sda5) and that is the device you probably need to use (unless that is just a typo in your question).



                                        However the encrypted device itself will have another name - something like /dev/mapper/cryptroot. For the device name you could:




                                        • look in the file /etc/crypttab - this will have both the partition and the mapper name in it, but only for permanent partitions

                                        • run mount and see what the mapper name is - this is useful when you have plugged in an encrypted disk via USB. (Though I'm not sure how you then find the actual underlying device name).






                                        share|improve this answer












                                        The encrypted partition may well be using /dev/sda5 (note the a in sda5) and that is the device you probably need to use (unless that is just a typo in your question).



                                        However the encrypted device itself will have another name - something like /dev/mapper/cryptroot. For the device name you could:




                                        • look in the file /etc/crypttab - this will have both the partition and the mapper name in it, but only for permanent partitions

                                        • run mount and see what the mapper name is - this is useful when you have plugged in an encrypted disk via USB. (Though I'm not sure how you then find the actual underlying device name).







                                        share|improve this answer












                                        share|improve this answer



                                        share|improve this answer










                                        answered Mar 4 '12 at 16:40









                                        Hamish Downer

                                        13.9k125688




                                        13.9k125688






















                                            up vote
                                            0
                                            down vote













                                            I had issues locating partition name, so created this guide:





                                            1. Locate your LMV partition



                                              # install jq if you don't have it
                                              sudo apt-get install jq

                                              # find LVM partition
                                              LVMPART=$(lsblk -p --json | jq -r '.blockdevices | select(.children) | .children | select(.children) as $partition | .children | select(.type == "crypt") | $partition.name')

                                              # check if it was found
                                              echo $LVMPART

                                              # (optional)
                                              # if above output is empty, locate it in a tree view using this command
                                              lsblk -p

                                              # partition `/dev/some_name` should be the parent object of the one with TYPE of `crypt`, set it
                                              LVMPART=`/dev/some_name`



                                            2. Check LVM partition meta by dumping it



                                              sudo cryptsetup luksDump $LVMPART



                                            3. Add new key (you can have multiple keys)



                                              sudo cryptsetup luksAddKey $LVMPART



                                            4. After dumping it again, you should see multiple keys



                                              sudo cryptsetup luksDump $LVMPART



                                            5. Delete old key if desired



                                              sudo cryptsetup luksRemoveKey $LVMPART







                                            share|improve this answer



























                                              up vote
                                              0
                                              down vote













                                              I had issues locating partition name, so created this guide:





                                              1. Locate your LMV partition



                                                # install jq if you don't have it
                                                sudo apt-get install jq

                                                # find LVM partition
                                                LVMPART=$(lsblk -p --json | jq -r '.blockdevices | select(.children) | .children | select(.children) as $partition | .children | select(.type == "crypt") | $partition.name')

                                                # check if it was found
                                                echo $LVMPART

                                                # (optional)
                                                # if above output is empty, locate it in a tree view using this command
                                                lsblk -p

                                                # partition `/dev/some_name` should be the parent object of the one with TYPE of `crypt`, set it
                                                LVMPART=`/dev/some_name`



                                              2. Check LVM partition meta by dumping it



                                                sudo cryptsetup luksDump $LVMPART



                                              3. Add new key (you can have multiple keys)



                                                sudo cryptsetup luksAddKey $LVMPART



                                              4. After dumping it again, you should see multiple keys



                                                sudo cryptsetup luksDump $LVMPART



                                              5. Delete old key if desired



                                                sudo cryptsetup luksRemoveKey $LVMPART







                                              share|improve this answer

























                                                up vote
                                                0
                                                down vote










                                                up vote
                                                0
                                                down vote









                                                I had issues locating partition name, so created this guide:





                                                1. Locate your LMV partition



                                                  # install jq if you don't have it
                                                  sudo apt-get install jq

                                                  # find LVM partition
                                                  LVMPART=$(lsblk -p --json | jq -r '.blockdevices | select(.children) | .children | select(.children) as $partition | .children | select(.type == "crypt") | $partition.name')

                                                  # check if it was found
                                                  echo $LVMPART

                                                  # (optional)
                                                  # if above output is empty, locate it in a tree view using this command
                                                  lsblk -p

                                                  # partition `/dev/some_name` should be the parent object of the one with TYPE of `crypt`, set it
                                                  LVMPART=`/dev/some_name`



                                                2. Check LVM partition meta by dumping it



                                                  sudo cryptsetup luksDump $LVMPART



                                                3. Add new key (you can have multiple keys)



                                                  sudo cryptsetup luksAddKey $LVMPART



                                                4. After dumping it again, you should see multiple keys



                                                  sudo cryptsetup luksDump $LVMPART



                                                5. Delete old key if desired



                                                  sudo cryptsetup luksRemoveKey $LVMPART







                                                share|improve this answer














                                                I had issues locating partition name, so created this guide:





                                                1. Locate your LMV partition



                                                  # install jq if you don't have it
                                                  sudo apt-get install jq

                                                  # find LVM partition
                                                  LVMPART=$(lsblk -p --json | jq -r '.blockdevices | select(.children) | .children | select(.children) as $partition | .children | select(.type == "crypt") | $partition.name')

                                                  # check if it was found
                                                  echo $LVMPART

                                                  # (optional)
                                                  # if above output is empty, locate it in a tree view using this command
                                                  lsblk -p

                                                  # partition `/dev/some_name` should be the parent object of the one with TYPE of `crypt`, set it
                                                  LVMPART=`/dev/some_name`



                                                2. Check LVM partition meta by dumping it



                                                  sudo cryptsetup luksDump $LVMPART



                                                3. Add new key (you can have multiple keys)



                                                  sudo cryptsetup luksAddKey $LVMPART



                                                4. After dumping it again, you should see multiple keys



                                                  sudo cryptsetup luksDump $LVMPART



                                                5. Delete old key if desired



                                                  sudo cryptsetup luksRemoveKey $LVMPART








                                                share|improve this answer














                                                share|improve this answer



                                                share|improve this answer








                                                edited Nov 21 at 18:55

























                                                answered Nov 21 at 18:30









                                                user2174835

                                                11




                                                11






























                                                     

                                                    draft saved


                                                    draft discarded



















































                                                     


                                                    draft saved


                                                    draft discarded














                                                    StackExchange.ready(
                                                    function () {
                                                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f109898%2fhow-to-change-the-password-of-an-encrypted-lvm-system-done-with-the-alternate-i%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

                                                    Mont Emei

                                                    Province de Neuquén

                                                    Journaliste