script to automate luksHeaderBackup for multiple partitionsAuto de-crypt all LUKS partitions in DebianHow to...

What does 'made on' mean here?

Copy previous line to current line from text file

Pressure inside an infinite ocean?

Causes of bimodal distributions when bootstrapping a meta-analysis model

Decoupling cap routing on a 4 layer PCB

Did we get closer to another plane than we were supposed to, or was the pilot just protecting our delicate sensibilities?

How long would it take for people to notice a mass disappearance?

Are Finitely generated modules over a ring also finitely generated over a subring containing the identity?

Where are the "shires" in the UK?

Where can I go to avoid planes overhead?

How can I support myself financially as a 17 year old with a loan?

Introducing Gladys, an intrepid globetrotter

Frequency of specific viral sequence in .BAM or .fastq

What is the solution to this metapuzzle from a university puzzling column?

Has a commercial or military jet bi-plane ever been manufactured?

Upside-Down Pyramid Addition...REVERSED!

I need a disease

What was the first story to feature the plot "the monsters were human all along"?

Why do people keep telling me that I am a bad photographer?

Understanding trademark infringements in a world where many dictionary words are trademarks?

SafeCracker #3 - We've Been Blocked

My advisor talks about me to his colleague

Manager is threatening to grade me poorly if I don't complete the project

What to use instead of cling film to wrap pastry



script to automate luksHeaderBackup for multiple partitions


Auto de-crypt all LUKS partitions in DebianHow to identify LVM-over-LUKS or LUKS-over-LVMHow can I set a label on a dm-crypt+LUKS container?USB key not mounting at boot to unlock LUKS systemAre big LUKS file containers a bad idea?Can I hide the fact that my USB is LUKS encryted?How to install new Linux distro onto existing encrypted partitions?The password of previously encrypted volume got changed by the Debian installerDual boot setup with LUKS and rEFInd: Can't Restore Backup to Second Partitioninvalid line /etc/crypttab






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







0















I have several servers each with at least six dm-crypt partitions. I would like to have an automated way to make sure I always have a luks header backup stored in a safe place. I've been making header backups manually until now. My problem with that is that I tend to forget to make a new luks header backup when I have to swap out a hard drive or make other system changes.



I'm looking for an existing script that will check to see if a luks header backup exists, and if not, create one. I have to assume somebody has written such a script already. (The need for it seems obvious.)



If one does not exist, I'll attempt to make a bash script for the purpose.



My manual commands look like this:



cryptsetup luksHeaderBackup /dev/sdXN --header-backup-file /path/to/backup/$mountpoint_luksHeader_$devUUID.img


I would like to have both the mountpoint and the device UUID in the file name of the header image file.



The only clue I have about getting started is that I would need to iterate through all devices and find the partitions of type crypt, then find the corresponding mount point and UUID. I know most of that info exists in lsblk and blkid. I'm not sure how to extract it for use in a script.









share





























    0















    I have several servers each with at least six dm-crypt partitions. I would like to have an automated way to make sure I always have a luks header backup stored in a safe place. I've been making header backups manually until now. My problem with that is that I tend to forget to make a new luks header backup when I have to swap out a hard drive or make other system changes.



    I'm looking for an existing script that will check to see if a luks header backup exists, and if not, create one. I have to assume somebody has written such a script already. (The need for it seems obvious.)



    If one does not exist, I'll attempt to make a bash script for the purpose.



    My manual commands look like this:



    cryptsetup luksHeaderBackup /dev/sdXN --header-backup-file /path/to/backup/$mountpoint_luksHeader_$devUUID.img


    I would like to have both the mountpoint and the device UUID in the file name of the header image file.



    The only clue I have about getting started is that I would need to iterate through all devices and find the partitions of type crypt, then find the corresponding mount point and UUID. I know most of that info exists in lsblk and blkid. I'm not sure how to extract it for use in a script.









    share

























      0












      0








      0








      I have several servers each with at least six dm-crypt partitions. I would like to have an automated way to make sure I always have a luks header backup stored in a safe place. I've been making header backups manually until now. My problem with that is that I tend to forget to make a new luks header backup when I have to swap out a hard drive or make other system changes.



      I'm looking for an existing script that will check to see if a luks header backup exists, and if not, create one. I have to assume somebody has written such a script already. (The need for it seems obvious.)



      If one does not exist, I'll attempt to make a bash script for the purpose.



      My manual commands look like this:



      cryptsetup luksHeaderBackup /dev/sdXN --header-backup-file /path/to/backup/$mountpoint_luksHeader_$devUUID.img


      I would like to have both the mountpoint and the device UUID in the file name of the header image file.



      The only clue I have about getting started is that I would need to iterate through all devices and find the partitions of type crypt, then find the corresponding mount point and UUID. I know most of that info exists in lsblk and blkid. I'm not sure how to extract it for use in a script.









      share














      I have several servers each with at least six dm-crypt partitions. I would like to have an automated way to make sure I always have a luks header backup stored in a safe place. I've been making header backups manually until now. My problem with that is that I tend to forget to make a new luks header backup when I have to swap out a hard drive or make other system changes.



      I'm looking for an existing script that will check to see if a luks header backup exists, and if not, create one. I have to assume somebody has written such a script already. (The need for it seems obvious.)



      If one does not exist, I'll attempt to make a bash script for the purpose.



      My manual commands look like this:



      cryptsetup luksHeaderBackup /dev/sdXN --header-backup-file /path/to/backup/$mountpoint_luksHeader_$devUUID.img


      I would like to have both the mountpoint and the device UUID in the file name of the header image file.



      The only clue I have about getting started is that I would need to iterate through all devices and find the partitions of type crypt, then find the corresponding mount point and UUID. I know most of that info exists in lsblk and blkid. I'm not sure how to extract it for use in a script.







      scripting luks





      share












      share










      share



      share










      asked 4 mins ago









      MountainXMountainX

      5,3762882137




      5,3762882137






















          0






          active

          oldest

          votes












          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%2f516877%2fscript-to-automate-luksheaderbackup-for-multiple-partitions%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          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%2f516877%2fscript-to-automate-luksheaderbackup-for-multiple-partitions%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

          Hudson River Historic District Contents Geography History The district today Aesthetics Cultural...

          The number designs the writing. Feandra Aversely Definition: The act of ingrafting a sprig or shoot of one...

          Ayherre Geografie Demografie Externe links Navigatiemenu43° 23′ NB, 1° 15′ WL43° 23′ NB, 1°...