I have a Seagate disk that I am trying to get partition aligned. I've tried this command in parted:

sudo parted /dev/sda mklabel gpt

sudo parted -a opt /dev/sda mkpart primary ext4 0% 100%

Get this fdisk error:

Device     Start         End     Sectors  Size Type
/dev/sda1  65535 15628000379 15627934845  7.3T Linux filesystem

Partition 1 does not start on physical sector boundary.

How do I get this disk partion aligment in parted ?

(I've also tried this guide: https://rainbow.chard.org/2013/01/30/how-to-align-partitions-for-best-performance-using-parted/


A little info about harddrive:

root@odroidxu4:~# cat /sys/block/sda/queue/optimal_io_size 33553920
root@odroidxu4:~# cat /sys/block/sda/queue/minimum_io_size 4096
root@odroidxu4:~# cat /sys/block/sda/alignment_offset 0
root@odroidxu4:~# cat /sys/block/sda/queue/physical_block_size 4096
root@odroidxu4:~# hdparm -I /dev/sda

ATA device, with non-removable media
    Model Number:       ST8000VN0022-2EL112
    Serial Number:      ZA1CH2SF
    Firmware Revision:  SC61
    Transport:          Serial, ATA8-AST, SATA 1.0a, SATA II Extensions, SAT                                                                                        A Rev 2.5, SATA Rev 2.6, SATA Rev 3.0

    Logical         max     current
    cylinders       16383   16383
    heads           16      16
    sectors/track   63      63
    CHS current addressable sectors:    16514064
    LBA    user addressable sectors:   268435455
    LBA48  user addressable sectors: 15628053168
    Logical  Sector size:                   512 bytes
    Physical Sector size:                  4096 bytes
    Logical Sector-0 offset:                  0 bytes
    device size with M = 1024*1024:     7630885 MBytes
    device size with M = 1000*1000:     8001563 MBytes (8001 GB)
    cache/buffer size  = unknown
    Form Factor: 3.5 inch
    Nominal Media Rotation Rate: 7200
  • Please format your code/data blocks. Select each block in turn and use the {} button on the editing menu to indent it four spaces. Also ensure there's a blank line above and below each block. (I'd do it for you if i weren't on a mobile device that doesn't have {}.) – roaima Jan 4 at 23:16
  • get rid of -a opt and use mib instead of % – frostschutz Jan 4 at 23:39
  • I am not a linux nerd can you write full command frostschutz ? – Rene Mortensen Jan 4 at 23:40
  • As I understand "-a opt" to tell parted to must align (optimal) but why it doesn't work I don't understand? When I check if it is aligned in parted it is ok but not in fdisk :/ – Rene Mortensen Jan 4 at 23:43
  • 1
    parted /dev/sda mkpart PARTITION_NAME ext4 1MiB 100% – AlexP Jan 5 at 0:47

Don't use parted, as it is obviously not up to the job. To partition a GPT disk, use gdisk. Alternatively, if your version of fdisk understands GPT partitions, you can use that as well. Just delete the partition and create a new partition. Format the partition with mkfs.ext4. Note that doing so will destroy any data you already have written to the disk.

  • parted is perfectly able to do the job. Just tell it where to put the partition. It accepts exact positioning at the level of sectors. – AlexP Jan 5 at 0:44
  • @AlexP Well, why don't you show how to use parted to create a partition that is aligned so that the starting sector is a multiple of eight (required by the physical sector size of the disk)? Gdisk does this automatically. – Johan Myréen Jan 5 at 0:49
  • 1
    parted <disk> mkpart <partition_name> <filesystem_type> <start> <end>, where <start> and <end> can be given in sectors (e.g., 2048s), binary megabytes (e.g., 1MiB) etc. – AlexP Jan 5 at 1:07
  • Now I have tried Gdisk and it seems to work out of the box but what should I choose in : Hex code or GUID (L to show codes, Enter = 8300): Is just a linux etx4 share on debian – Rene Mortensen Jan 5 at 11:44
  • The default value 8300 stands for "Linux filesystem", which is OK in this case. – Johan Myréen Jan 5 at 13:33

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.