What is the leading 2048 sectors and in the first two partitions?

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








up vote
0
down vote

favorite












After booting from Live USB (16.04):



ubuntu@ubuntu:~$ sudo fdisk -l
[...]
Disk /dev/nvme0n1: 953.9 GiB, 1024209543168 bytes, 2000409264 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: C5CE78D6-06C1-4528-BF0F-098BAEE04CC0

Device Start End Sectors Size Type
/dev/nvme0n1p1 2048 1050623 1048576 512M EFI System
/dev/nvme0n1p2 1050624 2050047 999424 488M Linux filesystem
/dev/nvme0n1p3 2050048 2000408575 1998358528 952.9G Linux filesystem

[...]

# Later, de-crypting nvme0n1p3 and looking inside it:

ubuntu@ubuntu:~$ sudo cryptsetup luksOpen /dev/nvme0n1p3 n1p3
Enter passphrase for /dev/nvme0n1p3:
ubuntu@ubuntu:~$ sudo vgscan
Reading all physical volumes. This may take a while...
Found volume group "ubuntu-vg" using metadata type lvm2
ubuntu@ubuntu:~$ sudo lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
root ubuntu-vg -wi-a----- 867.47g
swap_1 ubuntu-vg -wi-a----- 63.85g
ubuntu@ubuntu:~$ sudo vgchange -ay ubuntu-vg
2 logical volume(s) in volume group "ubuntu-vg" now active
ubuntu@ubuntu:~$ sudo lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
root ubuntu-vg -wi-a----- 867.47g
swap_1 ubuntu-vg -wi-a----- 63.85g
ubuntu@ubuntu:~$ mkdir /tmp/n1p3
ubuntu@ubuntu:~$ sudo mount /dev/ubuntu-vg/root /tmp/n1p3
ubuntu@ubuntu:~$ ls /tmp/n1p3
bin cdrom data etc initrd.img lhome lib32 libx32 measurements mnt proc run snap sys usr vmlinuz
boot core dev home initrd.img.old lib lib64 lost+found media opt root sbin srv tmp var vmlinuz.old
ubuntu@ubuntu:~$


Questions:



  1. What is in the first 2048 sectors of /dev/nvme0n1?

  2. What is in /dev/nvme0n1p1?

  3. What is in /dev/nvme0n1p2?

  4. What is in swap_1?






share|improve this question
























    up vote
    0
    down vote

    favorite












    After booting from Live USB (16.04):



    ubuntu@ubuntu:~$ sudo fdisk -l
    [...]
    Disk /dev/nvme0n1: 953.9 GiB, 1024209543168 bytes, 2000409264 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disklabel type: gpt
    Disk identifier: C5CE78D6-06C1-4528-BF0F-098BAEE04CC0

    Device Start End Sectors Size Type
    /dev/nvme0n1p1 2048 1050623 1048576 512M EFI System
    /dev/nvme0n1p2 1050624 2050047 999424 488M Linux filesystem
    /dev/nvme0n1p3 2050048 2000408575 1998358528 952.9G Linux filesystem

    [...]

    # Later, de-crypting nvme0n1p3 and looking inside it:

    ubuntu@ubuntu:~$ sudo cryptsetup luksOpen /dev/nvme0n1p3 n1p3
    Enter passphrase for /dev/nvme0n1p3:
    ubuntu@ubuntu:~$ sudo vgscan
    Reading all physical volumes. This may take a while...
    Found volume group "ubuntu-vg" using metadata type lvm2
    ubuntu@ubuntu:~$ sudo lvs
    LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
    root ubuntu-vg -wi-a----- 867.47g
    swap_1 ubuntu-vg -wi-a----- 63.85g
    ubuntu@ubuntu:~$ sudo vgchange -ay ubuntu-vg
    2 logical volume(s) in volume group "ubuntu-vg" now active
    ubuntu@ubuntu:~$ sudo lvs
    LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
    root ubuntu-vg -wi-a----- 867.47g
    swap_1 ubuntu-vg -wi-a----- 63.85g
    ubuntu@ubuntu:~$ mkdir /tmp/n1p3
    ubuntu@ubuntu:~$ sudo mount /dev/ubuntu-vg/root /tmp/n1p3
    ubuntu@ubuntu:~$ ls /tmp/n1p3
    bin cdrom data etc initrd.img lhome lib32 libx32 measurements mnt proc run snap sys usr vmlinuz
    boot core dev home initrd.img.old lib lib64 lost+found media opt root sbin srv tmp var vmlinuz.old
    ubuntu@ubuntu:~$


    Questions:



    1. What is in the first 2048 sectors of /dev/nvme0n1?

    2. What is in /dev/nvme0n1p1?

    3. What is in /dev/nvme0n1p2?

    4. What is in swap_1?






    share|improve this question






















      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      After booting from Live USB (16.04):



      ubuntu@ubuntu:~$ sudo fdisk -l
      [...]
      Disk /dev/nvme0n1: 953.9 GiB, 1024209543168 bytes, 2000409264 sectors
      Units: sectors of 1 * 512 = 512 bytes
      Sector size (logical/physical): 512 bytes / 512 bytes
      I/O size (minimum/optimal): 512 bytes / 512 bytes
      Disklabel type: gpt
      Disk identifier: C5CE78D6-06C1-4528-BF0F-098BAEE04CC0

      Device Start End Sectors Size Type
      /dev/nvme0n1p1 2048 1050623 1048576 512M EFI System
      /dev/nvme0n1p2 1050624 2050047 999424 488M Linux filesystem
      /dev/nvme0n1p3 2050048 2000408575 1998358528 952.9G Linux filesystem

      [...]

      # Later, de-crypting nvme0n1p3 and looking inside it:

      ubuntu@ubuntu:~$ sudo cryptsetup luksOpen /dev/nvme0n1p3 n1p3
      Enter passphrase for /dev/nvme0n1p3:
      ubuntu@ubuntu:~$ sudo vgscan
      Reading all physical volumes. This may take a while...
      Found volume group "ubuntu-vg" using metadata type lvm2
      ubuntu@ubuntu:~$ sudo lvs
      LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
      root ubuntu-vg -wi-a----- 867.47g
      swap_1 ubuntu-vg -wi-a----- 63.85g
      ubuntu@ubuntu:~$ sudo vgchange -ay ubuntu-vg
      2 logical volume(s) in volume group "ubuntu-vg" now active
      ubuntu@ubuntu:~$ sudo lvs
      LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
      root ubuntu-vg -wi-a----- 867.47g
      swap_1 ubuntu-vg -wi-a----- 63.85g
      ubuntu@ubuntu:~$ mkdir /tmp/n1p3
      ubuntu@ubuntu:~$ sudo mount /dev/ubuntu-vg/root /tmp/n1p3
      ubuntu@ubuntu:~$ ls /tmp/n1p3
      bin cdrom data etc initrd.img lhome lib32 libx32 measurements mnt proc run snap sys usr vmlinuz
      boot core dev home initrd.img.old lib lib64 lost+found media opt root sbin srv tmp var vmlinuz.old
      ubuntu@ubuntu:~$


      Questions:



      1. What is in the first 2048 sectors of /dev/nvme0n1?

      2. What is in /dev/nvme0n1p1?

      3. What is in /dev/nvme0n1p2?

      4. What is in swap_1?






      share|improve this question












      After booting from Live USB (16.04):



      ubuntu@ubuntu:~$ sudo fdisk -l
      [...]
      Disk /dev/nvme0n1: 953.9 GiB, 1024209543168 bytes, 2000409264 sectors
      Units: sectors of 1 * 512 = 512 bytes
      Sector size (logical/physical): 512 bytes / 512 bytes
      I/O size (minimum/optimal): 512 bytes / 512 bytes
      Disklabel type: gpt
      Disk identifier: C5CE78D6-06C1-4528-BF0F-098BAEE04CC0

      Device Start End Sectors Size Type
      /dev/nvme0n1p1 2048 1050623 1048576 512M EFI System
      /dev/nvme0n1p2 1050624 2050047 999424 488M Linux filesystem
      /dev/nvme0n1p3 2050048 2000408575 1998358528 952.9G Linux filesystem

      [...]

      # Later, de-crypting nvme0n1p3 and looking inside it:

      ubuntu@ubuntu:~$ sudo cryptsetup luksOpen /dev/nvme0n1p3 n1p3
      Enter passphrase for /dev/nvme0n1p3:
      ubuntu@ubuntu:~$ sudo vgscan
      Reading all physical volumes. This may take a while...
      Found volume group "ubuntu-vg" using metadata type lvm2
      ubuntu@ubuntu:~$ sudo lvs
      LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
      root ubuntu-vg -wi-a----- 867.47g
      swap_1 ubuntu-vg -wi-a----- 63.85g
      ubuntu@ubuntu:~$ sudo vgchange -ay ubuntu-vg
      2 logical volume(s) in volume group "ubuntu-vg" now active
      ubuntu@ubuntu:~$ sudo lvs
      LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
      root ubuntu-vg -wi-a----- 867.47g
      swap_1 ubuntu-vg -wi-a----- 63.85g
      ubuntu@ubuntu:~$ mkdir /tmp/n1p3
      ubuntu@ubuntu:~$ sudo mount /dev/ubuntu-vg/root /tmp/n1p3
      ubuntu@ubuntu:~$ ls /tmp/n1p3
      bin cdrom data etc initrd.img lhome lib32 libx32 measurements mnt proc run snap sys usr vmlinuz
      boot core dev home initrd.img.old lib lib64 lost+found media opt root sbin srv tmp var vmlinuz.old
      ubuntu@ubuntu:~$


      Questions:



      1. What is in the first 2048 sectors of /dev/nvme0n1?

      2. What is in /dev/nvme0n1p1?

      3. What is in /dev/nvme0n1p2?

      4. What is in swap_1?








      share|improve this question











      share|improve this question




      share|improve this question










      asked Apr 22 at 4:37









      user1823664

      1306




      1306




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          2
          down vote



          accepted










          1. Out of the initial 2048 sectors at the start of the disk, the very first 34 sectors of a GPT-partitioned drive contain the partition table, the rest of the (2048 - 34 =) 2014 sectors are not used. Partitions need to start on a certain sector for optimal disk-performance, a common practice is to align partitions to 1 MiB (512 B (sector size) x 2048 (number of sectors) = 1 MiB), that's why you see this gap at the start of the disk.


          2. /dev/nvme0n1p1 is the ESP (EFI System Partition), it is the place where boot-loaders are stored. This partition is a must, it is required by UEFI specifications, without this partition you would not be able to boot the machine. This partition will be mounted at /boot/efi in your system.


          3. /dev/nvme0n1p2is your boot-partition and will be mounted at /boot in your system. This partition is not encrypted. You need this extra partition because you use LVM and encryption. The boot-loader can not read from a partition which is encrypted, so the need for this extra partition. This partition holds the kernel(s) and the boot-loader-configuration.


          4. swap_1 is the swap-space. Swap acts as virtual memory. The system will use this space to move contents which are in RAM to the swap-space to free some RAM when necessary (this may happen if an application uses a lot of RAM, it will definitely happen if an application needs to use more RAM than installed, if you don't have swap-space in that case, the application would crash).






          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: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            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%2faskubuntu.com%2fquestions%2f1027092%2fwhat-is-the-leading-2048-sectors-and-in-the-first-two-partitions%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
            2
            down vote



            accepted










            1. Out of the initial 2048 sectors at the start of the disk, the very first 34 sectors of a GPT-partitioned drive contain the partition table, the rest of the (2048 - 34 =) 2014 sectors are not used. Partitions need to start on a certain sector for optimal disk-performance, a common practice is to align partitions to 1 MiB (512 B (sector size) x 2048 (number of sectors) = 1 MiB), that's why you see this gap at the start of the disk.


            2. /dev/nvme0n1p1 is the ESP (EFI System Partition), it is the place where boot-loaders are stored. This partition is a must, it is required by UEFI specifications, without this partition you would not be able to boot the machine. This partition will be mounted at /boot/efi in your system.


            3. /dev/nvme0n1p2is your boot-partition and will be mounted at /boot in your system. This partition is not encrypted. You need this extra partition because you use LVM and encryption. The boot-loader can not read from a partition which is encrypted, so the need for this extra partition. This partition holds the kernel(s) and the boot-loader-configuration.


            4. swap_1 is the swap-space. Swap acts as virtual memory. The system will use this space to move contents which are in RAM to the swap-space to free some RAM when necessary (this may happen if an application uses a lot of RAM, it will definitely happen if an application needs to use more RAM than installed, if you don't have swap-space in that case, the application would crash).






            share|improve this answer


























              up vote
              2
              down vote



              accepted










              1. Out of the initial 2048 sectors at the start of the disk, the very first 34 sectors of a GPT-partitioned drive contain the partition table, the rest of the (2048 - 34 =) 2014 sectors are not used. Partitions need to start on a certain sector for optimal disk-performance, a common practice is to align partitions to 1 MiB (512 B (sector size) x 2048 (number of sectors) = 1 MiB), that's why you see this gap at the start of the disk.


              2. /dev/nvme0n1p1 is the ESP (EFI System Partition), it is the place where boot-loaders are stored. This partition is a must, it is required by UEFI specifications, without this partition you would not be able to boot the machine. This partition will be mounted at /boot/efi in your system.


              3. /dev/nvme0n1p2is your boot-partition and will be mounted at /boot in your system. This partition is not encrypted. You need this extra partition because you use LVM and encryption. The boot-loader can not read from a partition which is encrypted, so the need for this extra partition. This partition holds the kernel(s) and the boot-loader-configuration.


              4. swap_1 is the swap-space. Swap acts as virtual memory. The system will use this space to move contents which are in RAM to the swap-space to free some RAM when necessary (this may happen if an application uses a lot of RAM, it will definitely happen if an application needs to use more RAM than installed, if you don't have swap-space in that case, the application would crash).






              share|improve this answer
























                up vote
                2
                down vote



                accepted







                up vote
                2
                down vote



                accepted






                1. Out of the initial 2048 sectors at the start of the disk, the very first 34 sectors of a GPT-partitioned drive contain the partition table, the rest of the (2048 - 34 =) 2014 sectors are not used. Partitions need to start on a certain sector for optimal disk-performance, a common practice is to align partitions to 1 MiB (512 B (sector size) x 2048 (number of sectors) = 1 MiB), that's why you see this gap at the start of the disk.


                2. /dev/nvme0n1p1 is the ESP (EFI System Partition), it is the place where boot-loaders are stored. This partition is a must, it is required by UEFI specifications, without this partition you would not be able to boot the machine. This partition will be mounted at /boot/efi in your system.


                3. /dev/nvme0n1p2is your boot-partition and will be mounted at /boot in your system. This partition is not encrypted. You need this extra partition because you use LVM and encryption. The boot-loader can not read from a partition which is encrypted, so the need for this extra partition. This partition holds the kernel(s) and the boot-loader-configuration.


                4. swap_1 is the swap-space. Swap acts as virtual memory. The system will use this space to move contents which are in RAM to the swap-space to free some RAM when necessary (this may happen if an application uses a lot of RAM, it will definitely happen if an application needs to use more RAM than installed, if you don't have swap-space in that case, the application would crash).






                share|improve this answer














                1. Out of the initial 2048 sectors at the start of the disk, the very first 34 sectors of a GPT-partitioned drive contain the partition table, the rest of the (2048 - 34 =) 2014 sectors are not used. Partitions need to start on a certain sector for optimal disk-performance, a common practice is to align partitions to 1 MiB (512 B (sector size) x 2048 (number of sectors) = 1 MiB), that's why you see this gap at the start of the disk.


                2. /dev/nvme0n1p1 is the ESP (EFI System Partition), it is the place where boot-loaders are stored. This partition is a must, it is required by UEFI specifications, without this partition you would not be able to boot the machine. This partition will be mounted at /boot/efi in your system.


                3. /dev/nvme0n1p2is your boot-partition and will be mounted at /boot in your system. This partition is not encrypted. You need this extra partition because you use LVM and encryption. The boot-loader can not read from a partition which is encrypted, so the need for this extra partition. This partition holds the kernel(s) and the boot-loader-configuration.


                4. swap_1 is the swap-space. Swap acts as virtual memory. The system will use this space to move contents which are in RAM to the swap-space to free some RAM when necessary (this may happen if an application uses a lot of RAM, it will definitely happen if an application needs to use more RAM than installed, if you don't have swap-space in that case, the application would crash).







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Jul 29 at 7:39









                Mubeen Iqbal

                33




                33










                answered Apr 22 at 7:04









                mook765

                2,8842817




                2,8842817



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1027092%2fwhat-is-the-leading-2048-sectors-and-in-the-first-two-partitions%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    Which professions warranted travel in Medieval times?

                    How do so many people here on Academia.SE, and in general, afford lavish higher education programs?

                    Trouble downloading packages list due to a “Hash sum mismatch” error