Gentoo Archives: gentoo-user

From: Michael <confabulate@××××××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Gparted leaves gaps
Date: Thu, 01 Apr 2021 10:13:32
Message-Id: 43714615.fMDQidcC6G@lenovo.localdomain
In Reply to: Re: [gentoo-user] Gparted leaves gaps by William Kenworthy
1 On Thursday, 1 April 2021 03:04:31 BST William Kenworthy wrote:
2 > On 1/4/21 12:39 am, Peter Humphrey wrote:
3 > > Hello list,
4 > >
5 > > I use gparted often, usually from SystemRescueCD, and a common task is to
6 > > move partitions to allow for one to be enlarged. I should be able to
7 > > specify all the operations in a list, but whenever I do that gparted
8 > > inserts 1MB gaps between partitions, so I have to do one at a time. Even
9 > > the latest bootable gparted CD image does the same.
10 > >
11 > > Can anyone tell me what causes this? Has it anything to do with my always
12 > > specifying partition size as a power of 8? (I'm of the old school, having
13 > > been sent on my first computer hardware course in 1972.)
14 >
15 > Forcing alignment on megabyte boundaries? - I cant find a reason, but I
16 > think I read in the past it was for efficiency with modern file systems.
17 >
18 > BillK
19
20 Yes, 4K physical sector size and partition alignment, ubiquitous on modern
21 'Advanced Format' drives, is used by all partitioning tools these days.
22
23 There are many references in the interwebs, but in summary modern AF spinning
24 drives have 4096 byte physical sector size with a 512 byte logical sector
25 size. To ensure alignment you could start a partition at an LBA divisible by
26 8, but since Microsoft came out with Vista's partition manager a convention of
27 1MB has been set as the starting point:
28
29 512 * 2048 = 1,048,576
30
31 The 1MB (2048 logical sectors) convention for the start of a partition is used
32 to cater for various hardware and partitioning requirements, inc. different
33 RAID data stripe sizes, SSDs with different erase block sizes, etc. It
34 ensures logical-physical partition alignment to optimise performance when
35 delete/write operations take place and as long as you are not trying to
36 squeeze the very last ounce of usable space out of your terabytes of storage,
37 it achieves its stated aim.
38
39 Parted has 3 options for aligning the start of a partition: none, minimal and
40 optimal. With 'none' it will start a partition wherever you ask it, without
41 paying heed to logical-to-physical sector alignment. With 'minimal' it will
42 shift the start/end of a partition to make sure the minimum alignment between
43 logical and physical sectors is achieved. With 'optimal' it will check if the
44 partition is aligned to a multiple of the physical block size. 'Optimal' is
45 the default. You could check/set the alignment of logical-physical sectors
46 yourself, by making sure the start of your partitions is divisible by 8,
47 instead of adopting the GParted 1MB default boundary in any cases where it is
48 not necessary.

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-user] Gparted leaves gaps Peter Humphrey <peter@××××××××××××.uk>