P
P
petrouv2013-10-08 23:29:28
linux
petrouv, 2013-10-08 23:29:28

Missing sectors in disk layout

The physical disk of the virtual machine has been increased, so you need to create a partition in the space that appears and add it to the LMV volume group.
When creating the volume, something strange was discovered - namely, "holes" between the already existing partitions.

$ sudo fdisk /dev/sda

Command (m for help): p

Disk /dev/sda: 128.8 GB, 128849018880 bytes
255 heads, 63 sectors/track, 15665 cylinders, total 251658240 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
Disk identifier: 0x000e7217

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 499711 248832 83 Linux
/dev/sda2 501758 104855551 52176897 5 Extended
/dev/sda5 501760 104855551 52176896 8e Linux LVM

Command (m for help): n

...

First sector (499712-<b>251658239</b>, default 499712):
Using default value 499712
Last sector, +sectors or +size{K,M,G} (499712-<b>501757</b>, default 501757):

You may notice that /dev/sda1 ends at sector 499711, and /dev/sda2 starts at sector 501758 - that is, there is a hole of about 1MB. Accordingly, when creating a new partition, fdisk suggests starting it from sector 499712.

The disk was partitioned automatically when installing Ubuntu.

Questions:
1. Where could this hole come from, and is it worth worrying about this issue?
2. Do I understand correctly that when creating a new partition, I just need to specify the value 104855552 as the first sector?

Thanks in advance.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
KrD, 2013-10-08
@petrouv

1. Don't worry. Where did it come from - see below.
By simple tricks:
a) first partition (/dev/sda1):
offset: 2048 [sector] = 1048576 [bytes] = 1 [megabytes]
size: (499711 - 2048 + 1) = 497664 [sector] = 254803968 [bytes] = 243 [megabytes]
b) second partition (/dev/sda5):
offset: 501760 [sector] = 256901120 [bytes] = 245 [megabytes]
size: (104855551 - 501760 + 1) = 104353792 [sector] = 53429141504 [bytes] ] = 50954 [megabytes]
All received values ​​are integers. Logically, during the installation of the OS, the disk was partitioned with 1 megabyte alignment, which is a good rule. Because of the alignment, this very “hole” was formed. This is not critical in most cases.
2. Yes.
(245 + 50954) [megabytes] = 53686042624 [bytes] = 104855552 [sector].

D
deleted-mifki, 2013-10-09
@deleted-mifki

IMHO, this is just the alignment of the beginning of the sections. I don’t know how relevant it is at present and on your configuration, but the installer can simply play it safe.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question