Physical Sector Boundaries

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help
Post Reply
User avatar
Level 9
Level 9
Posts: 2873
Joined: Thu Dec 31, 2015 3:20 am
Location: Oklahoma where the wind comes sweeping down the plains

Physical Sector Boundaries

Post by AZgl1500 » Sun Feb 25, 2018 10:50 am

I was reading a thread about the condition of the HDD

and I always run thru the same commands comparing my PC with the forum user's situation.
I noticed the following on my PC

Code: Select all

sudo fdisk -l /dev/sda
[sudo] password for john: 
Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0xa985f1c3

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sda1  *         2048 968624127 968622080 461.9G 83 Linux
/dev/sda2       968626174 976771071   8144898   3.9G  5 Extended
/dev/sda5       968626176 976771071   8144896   3.9G 82 Linux swap / Solaris

Partition 2 does not start on physical sector boundary.
My question is, is it important for the partitions to start on a 'sector boundary' ?

IIRC, I just allowed Linux Mint 18.3 to format the HDD and do what it needed to do at install time.

Mute Ant
Level 13
Level 13
Posts: 4942
Joined: Tue Sep 03, 2013 7:45 pm
Location: Norfolk UK

Re: Physical Sector Boundaries

Post by Mute Ant » Sun Feb 25, 2018 12:38 pm

Legacy 512-byte-per-sector magnetic drive ... Partition tables address the storage in logical sectors, so a partition always starts on a logical-sector boundary.

Modern 4096-byte-per-sector magnetic drive ... Normal Mint installation will get this right on your behalf for the physical sectors too. It allocates block-storage in 1 MiB chunks which automatically align with 512 byte sectors and 4096 byte sectors too.

Silicon Storage

New SanDisk USB sticks arrive formatted FAT32 with a single partition starting at sector 32. That's uncontroversial and, I guess, non-optimum. Probing with the flashbench command suggests they are really 4MiB WORM devices arranged as a self-healing RAID0 array. There might be some advantage...
o Starting the partitions on 4MiB 'device' boundaries. That would be sector 8192 in legacy measure.
o Using a stripe_width=1024 so that writes are bunched into 4MiB chunks. That's a feature of the ext4 file system intended to avoid a single write operation spanning two physical drives.

The only practical test I have done is with a USB stick formatted without any partition (called a super-floppy) and an ext4 with 'bigalloc' to set clusters of 4MiB, the same as the underlying 'device' size. That has the same effect as a stripe_width=1024 applied to each file. Every file uses a minimum of 4MiB, which is no problem if it's an archive of big files like photographs or music. Writing was astonishingly fast, I guess because the USB stick firmware had almost no work to do...
Here is 4MiB -----> Put it in WORM 'x'
Here is 4MiB -----> Put it in WORM 'y'
Here is 4MiB -----> Put it in WORM 'z' Without "erasure group size" information it is impossible to align partitions correctly when installing Arch on any kind of flash medium (USB stick, Compact Flash Card, SSD).
Tommy reports the scan of zircon and opal storage is complete. When shall we go today?

Post Reply

Return to “Installation & Boot”