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

Clash 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:
- What is in the first 2048 sectors of /dev/nvme0n1?
- What is in /dev/nvme0n1p1?
- What is in /dev/nvme0n1p2?
- What is in swap_1?
partitioning uefi disk disk-usage luks
add a comment |Â
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:
- What is in the first 2048 sectors of /dev/nvme0n1?
- What is in /dev/nvme0n1p1?
- What is in /dev/nvme0n1p2?
- What is in swap_1?
partitioning uefi disk disk-usage luks
add a comment |Â
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:
- What is in the first 2048 sectors of /dev/nvme0n1?
- What is in /dev/nvme0n1p1?
- What is in /dev/nvme0n1p2?
- What is in swap_1?
partitioning uefi disk disk-usage luks
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:
- What is in the first 2048 sectors of /dev/nvme0n1?
- What is in /dev/nvme0n1p1?
- What is in /dev/nvme0n1p2?
- What is in swap_1?
partitioning uefi disk disk-usage luks
asked Apr 22 at 4:37
user1823664
1306
1306
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
2
down vote
accepted
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.
/dev/nvme0n1p1is 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/efiin your system./dev/nvme0n1p2is yourboot-partition and will be mounted at/bootin 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.swap_1is 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).
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
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.
/dev/nvme0n1p1is 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/efiin your system./dev/nvme0n1p2is yourboot-partition and will be mounted at/bootin 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.swap_1is 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).
add a comment |Â
up vote
2
down vote
accepted
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.
/dev/nvme0n1p1is 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/efiin your system./dev/nvme0n1p2is yourboot-partition and will be mounted at/bootin 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.swap_1is 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).
add a comment |Â
up vote
2
down vote
accepted
up vote
2
down vote
accepted
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.
/dev/nvme0n1p1is 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/efiin your system./dev/nvme0n1p2is yourboot-partition and will be mounted at/bootin 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.swap_1is 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).
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.
/dev/nvme0n1p1is 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/efiin your system./dev/nvme0n1p2is yourboot-partition and will be mounted at/bootin 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.swap_1is 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).
edited Jul 29 at 7:39
Mubeen Iqbal
33
33
answered Apr 22 at 7:04
mook765
2,8842817
2,8842817
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password