is it possible to create partition table inside crypt mapper?

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











up vote
1
down vote

favorite












i.e. not



fdisk /dev/sda; cryptsetup create xxx /dev/sda1



but vice versa



cryptsetup create xxx /dev/sda ; fdisk /dev/mapper/xxx



is it allowed?







share|improve this question
























    up vote
    1
    down vote

    favorite












    i.e. not



    fdisk /dev/sda; cryptsetup create xxx /dev/sda1



    but vice versa



    cryptsetup create xxx /dev/sda ; fdisk /dev/mapper/xxx



    is it allowed?







    share|improve this question






















      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      i.e. not



      fdisk /dev/sda; cryptsetup create xxx /dev/sda1



      but vice versa



      cryptsetup create xxx /dev/sda ; fdisk /dev/mapper/xxx



      is it allowed?







      share|improve this question












      i.e. not



      fdisk /dev/sda; cryptsetup create xxx /dev/sda1



      but vice versa



      cryptsetup create xxx /dev/sda ; fdisk /dev/mapper/xxx



      is it allowed?









      share|improve this question











      share|improve this question




      share|improve this question










      asked Dec 6 '17 at 21:53









      bdimych

      404




      404




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          3
          down vote



          accepted










          It's possible, but might need additional steps (kpartx) to make those partitions available.



          parted /dev/mapper/cryptsda
          kpartx -a /dev/mapper/cryptsda
          mount /dev/mapper/cryptsda1 /mnt/firstpartition


          Most people just use LVM instead, of course LVM also needs VG/LV to be enabled first, but this is usually handled for you by whatever init system you use.



          However, you should still partition the raw drive regardless, otherwise there is a high risk of data loss. A seemingly unpartitioned drive is fair game for all partitioners, installers, etc.



          So usually it's /dev/sda » /dev/sda1 » cryptsetup/LUKS » LVM » filesystem.






          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%2f409325%2fis-it-possible-to-create-partition-table-inside-crypt-mapper%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
            3
            down vote



            accepted










            It's possible, but might need additional steps (kpartx) to make those partitions available.



            parted /dev/mapper/cryptsda
            kpartx -a /dev/mapper/cryptsda
            mount /dev/mapper/cryptsda1 /mnt/firstpartition


            Most people just use LVM instead, of course LVM also needs VG/LV to be enabled first, but this is usually handled for you by whatever init system you use.



            However, you should still partition the raw drive regardless, otherwise there is a high risk of data loss. A seemingly unpartitioned drive is fair game for all partitioners, installers, etc.



            So usually it's /dev/sda » /dev/sda1 » cryptsetup/LUKS » LVM » filesystem.






            share|improve this answer
























              up vote
              3
              down vote



              accepted










              It's possible, but might need additional steps (kpartx) to make those partitions available.



              parted /dev/mapper/cryptsda
              kpartx -a /dev/mapper/cryptsda
              mount /dev/mapper/cryptsda1 /mnt/firstpartition


              Most people just use LVM instead, of course LVM also needs VG/LV to be enabled first, but this is usually handled for you by whatever init system you use.



              However, you should still partition the raw drive regardless, otherwise there is a high risk of data loss. A seemingly unpartitioned drive is fair game for all partitioners, installers, etc.



              So usually it's /dev/sda » /dev/sda1 » cryptsetup/LUKS » LVM » filesystem.






              share|improve this answer






















                up vote
                3
                down vote



                accepted







                up vote
                3
                down vote



                accepted






                It's possible, but might need additional steps (kpartx) to make those partitions available.



                parted /dev/mapper/cryptsda
                kpartx -a /dev/mapper/cryptsda
                mount /dev/mapper/cryptsda1 /mnt/firstpartition


                Most people just use LVM instead, of course LVM also needs VG/LV to be enabled first, but this is usually handled for you by whatever init system you use.



                However, you should still partition the raw drive regardless, otherwise there is a high risk of data loss. A seemingly unpartitioned drive is fair game for all partitioners, installers, etc.



                So usually it's /dev/sda » /dev/sda1 » cryptsetup/LUKS » LVM » filesystem.






                share|improve this answer












                It's possible, but might need additional steps (kpartx) to make those partitions available.



                parted /dev/mapper/cryptsda
                kpartx -a /dev/mapper/cryptsda
                mount /dev/mapper/cryptsda1 /mnt/firstpartition


                Most people just use LVM instead, of course LVM also needs VG/LV to be enabled first, but this is usually handled for you by whatever init system you use.



                However, you should still partition the raw drive regardless, otherwise there is a high risk of data loss. A seemingly unpartitioned drive is fair game for all partitioners, installers, etc.



                So usually it's /dev/sda » /dev/sda1 » cryptsetup/LUKS » LVM » filesystem.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Dec 6 '17 at 22:14









                frostschutz

                24.5k14774




                24.5k14774



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f409325%2fis-it-possible-to-create-partition-table-inside-crypt-mapper%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?

                    Bahrain

                    Postfix configuration issue with fips on centos 7; mailgun relay