How to fix "Partition does not start on physical sector boundary" warning?

274,052

Solution 1

Your hard disk has Advanced Format 4096-byte sectors to which the partition is not perfectly aligned

This line explains the warning:

Sector size (logical/physical): 512 bytes / 4096 bytes
  • Your hard disk is one of the newer models which uses the Advanced Format of 4096 bytes per physical sector instead of the older 512 bytes/sector.
  • These HDDs can still provide a "legacy" emulation of 512 bytes/sector, which is why you see the logical sector size as 512.
  • In fact, lshw shows it's a Western Digital drive, the first company to switch to AF. They have an extensive page with lots of information on it, which you may wish to look at.

Thus, the warning occurs because partition 1 starts at logical sector 63 = byte 32256, a number not divisible by 4096; in fact it's near the end of the 7th physical sector (position 7.875 to be exact :)

Should you fix it? If so, how? [always backup!]

In theory this sort of partitioning may affect read/write IO rates somewhat, depending on your drive's firmware. If you are happy with the performance now, ignore the warning, and no need to do anything. If not, backup all important data first, and then use Gparted to move the partition so that it starts at 4096-byte sector; setting the start boundary at 1 MiB is an easy way to do it.

  • Technically, you can set the start to any logical sector which is a multiple of 8, e.g. 64 is good, 256 is good, etc., but 63, 255... are not.

Solution 2

For your new HDD, first create partitions using gparted as per your wish.

Then, access your HDD using sudo fdisk device_name. m command in fdisk will print help menu.

npcompete@npcompete-desktop:~$ sudo fdisk /dev/sda

The device presents a logical sector size that is smaller than
the physical sector size. Aligning to a physical sector (or optimal
I/O) size boundary is recommended, or performance may be impacted.

Command (m for help): p

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 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
Disk identifier: 0x0008e009

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048   209717247   104857600   83  Linux
/dev/sda2       209717248  1953525167   871903960    5  Extended
/dev/sda5       600349113   795667319    97659103+  83  Linux
Partition 5 does not start on physical sector boundary.
/dev/sda6       795667383   990985589    97659103+  83  Linux
Partition 6 does not start on physical sector boundary.
/dev/sda7       990985653  1953520064   481267206   83  Linux
Partition 7 does not start on physical sector boundary.
/dev/sda8       209719296   600349112   195314908+  83  Linux

Partition table entries are not in disk order
Command (m for help): d
Partition number (1-8): 5

Command (m for help): p

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 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
Disk identifier: 0x0008e009

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048   209717247   104857600   83  Linux
/dev/sda2       209717248  1953525167   871903960    5  Extended
/dev/sda5       795667383   990985589    97659103+  83  Linux
Partition 5 does not start on physical sector boundary.
/dev/sda6       990985653  1953520064   481267206   83  Linux
Partition 6 does not start on physical sector boundary.
/dev/sda7       209719296   600349112   195314908+  83  Linux

Partition table entries are not in disk order

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
npcompete@npcompete-desktop:~$ sudo fdisk /dev/sda

The device presents a logical sector size that is smaller than
the physical sector size. Aligning to a physical sector (or optimal
I/O) size boundary is recommended, or performance may be impacted.

Command (m for help): n
Partition type:
   p   primary (1 primary, 1 extended, 2 free)
   l   logical (numbered from 5)
Select (default p): l
Adding logical partition 8
First sector (600351161-1953525167, default 600352768): 
Using default value 600352768
Last sector, +sectors or +size{K,M,G} (600352768-795667382, default 795667382): 
Using default value 795667382

Command (m for help): p

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 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
Disk identifier: 0x0008e009

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048   209717247   104857600   83  Linux
/dev/sda2       209717248  1953525167   871903960    5  Extended
/dev/sda5       795667383   990985589    97659103+  83  Linux
Partition 5 does not start on physical sector boundary.
/dev/sda6       990985653  1953520064   481267206   83  Linux
Partition 6 does not start on physical sector boundary.
/dev/sda7       209719296   600349112   195314908+  83  Linux
/dev/sda8       600352768   795667382    97657307+  83  Linux

Partition table entries are not in disk order

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

Now delete the partition which gives warning using d option in fdisk.

First Command d, then the partition number (mentioned in the warning).

Now write the changes to the disk using w command. It will exit from the fdisk.

Second time access your HDD using sudo fdisk device_name.

Now create a new partition using the free space(previously we have deleted a partition, that will be the free space or unallocated space) using n command in fdisk.

In New partition command don't enter any value for First and Last Sector, just press Enter. it will take the default value.

Now write the changes to the disk using w command. It will exit from the fdisk.

Do the above steps for all the partitions. After finishing this format your newly created partitions, using gparted. (That's what I did worked for me. No warnings in fdisk -l output.)

Solution 3

As pointed out by izx:

your hard disk has Advanced Format 4096-byte sectors to which the partition is not perfectly aligned.

The advanced format specification and its impact on user-side hard drive partitioning practices is explained nicely by this article.

To fix this issue you must backup your data and then:

  1. Either resize the erroneously sized partition to the proper size;
  2. Or delete the erroneously sized partition and create a new partition of the proper size.

To accomplish this using the graphical hard-drive partitioning software that is called GParted then you can:

  1. Launch the Gparted application with super-user privileges; exercise caution!

    gksudo gparted
    
  2. Select the storage device containing the erroneously sized partition from the pull-down menu in the upper right hand corner of the GParted menu.

  3. Select the erroneously-sized partition by clicking on it in the rectangular partition map.

  4. Now you may choose to delete and create a new partition or you may choose to resize the existing partition. Regardless of your choice you will reach a menu that allows you to set the size of the partition. You must clear the "Round to cylinders" checkbox and set the size of the free space preceding to 1MiB. It will look similar to

GParted - Create new partition.

Solution 4

By switching the "u" units. The default sector size will show up when you create the partition. If you are starting to partition a new disk and you get this error, you can.

  1. create a partion with the defaut.
  2. n,p,1,Enter, Enter
  3. Display and get the partition error message. "p".
  4. switch units "u"
  5. delete the partition. "d"
  6. Now create again. this time the defaults will show the correct sector. (in my case it was 1024).

Command (m for help): p

Disk /dev/sdb: 599.9 GB, 599932844032 bytes
255 heads, 63 sectors/track, 72937 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 262144 bytes / 524288 bytes
Disk identifier: 0x2016bdc5

   Device Boot      Start         End      Blocks   Id  System

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-72937, default 1): 1
Last cylinder, +cylinders or +size{K,M,G} (1-72937, default 72937):
Using default value 72937

Command (m for help): p

Disk /dev/sdb: 599.9 GB, 599932844032 bytes
255 heads, 63 sectors/track, 72937 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 262144 bytes / 524288 bytes
Disk identifier: 0x2016bdc5

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       72937   585866421   83  Linux
Partition 1 does not start on physical sector boundary.

Command (m for help): u
Changing display/entry units to sectors

Command (m for help): p

Disk /dev/sdb: 599.9 GB, 599932844032 bytes
255 heads, 63 sectors/track, 72937 cylinders, total 1171743836 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 262144 bytes / 524288 bytes
Disk identifier: 0x2016bdc5

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1              63  1171732904   585866421   83  Linux
Partition 1 does not start on physical sector boundary.

Command (m for help): d
Selected partition 1

Command (m for help): p

Disk /dev/sdb: 599.9 GB, 599932844032 bytes
255 heads, 63 sectors/track, 72937 cylinders, total 1171743836 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 262144 bytes / 524288 bytes
Disk identifier: 0x2016bdc5

   Device Boot      Start         End      Blocks   Id  System

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 8
Value out of range.
Partition number (1-4): 1
First sector (63-1171743835, default 1024):
Using default value 1024
Last sector, +sectors or +size{K,M,G} (1024-1171743835, default 1171743835):
Using default value 1171743835

Command (m for help): p

Disk /dev/sdb: 599.9 GB, 599932844032 bytes
255 heads, 63 sectors/track, 72937 cylinders, total 1171743836 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 262144 bytes / 524288 bytes
Disk identifier: 0x2016bdc5

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            1024  1171743835   585871406   83  Linux

Command (m for help): w
The partition table has been altered!
Share:
274,052

Related videos on Youtube

jasmines
Author by

jasmines

Ubuntu wins

Updated on September 18, 2022

Comments

  • jasmines
    jasmines over 1 year

    I have one HDD on my laptop, with two partitions (one ext3 with Ubuntu 12.04 installed and one swap).

    fdisk is giving me the following warning:

    Partition 1 does not start on physical sector boundary
    

    What is the cause and do I need to fix it? If so, how?


    This is sudo fdisk -l:

    Disk /dev/sda: 750.2 GB, 750156374016 bytes
    255 testine, 63 settori/tracce, 91201 cilindri, totale 1465149168 settori
    Unità = settori di 1 * 512 = 512 byte
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    Identificativo disco: 0x5a25087f
    
    Dispositivo Boot      Start         End      Blocks   Id  System
    /dev/sda1   *          63  1448577023   724288480+  83  Linux
    Partition 1 does not start on physical sector boundary.
    /dev/sda2      1448577024  1465147391     8285184   82  Linux swap / Solaris
    

    This is sudo lshw related result:

     *-disk
                    description: ATA Disk
                    product: WDC WD7500BPKT-0
                    vendor: Western Digital
                    physical id: 0
                    bus info: scsi@0:0.0.0
                    logical name: /dev/sda
                    version: 01.0
                    serial: WD-WX21CC1T0847
                    size: 698GiB (750GB)
                    capabilities: partitioned partitioned:dos
                    configuration: ansiversion=5 signature=5a25087f
                  *-volume:0
                       description: EXT3 volume
                       vendor: Linux
                       physical id: 1
                       bus info: scsi@0:0.0.0,1
                       logical name: /dev/sda1
                       logical name: /
                       version: 1.0
                       serial: cc5c562a-bc59-4a37-b589-805b27b2cbd7
                       size: 690GiB
                       capacity: 690GiB
                       capabilities: primary bootable journaled extended_attributes large_files recover ext3 ext2 initialized
                       configuration: created=2010-02-27 09:18:28 filesystem=ext3 modified=2012-06-23 18:33:59 mount.fstype=ext3 mount.options=rw,relatime,errors=remount-ro,user_xattr,barrier=1,data=ordered mounted=2012-06-28 00:20:47 state=mounted
                  *-volume:1
                       description: Linux swap volume
                       physical id: 2
                       bus info: scsi@0:0.0.0,2
                       logical name: /dev/sda2
                       version: 1
                       serial: 16a7fee0-be9e-4e34-9dc3-28f4eeb61bf6
                       size: 8091MiB
                       capacity: 8091MiB
                       capabilities: primary nofs swap initialized
                       configuration: filesystem=swap pagesize=4096
    

    These are related /etc/fstab lines:

    UUID=cc5c562a-bc59-4a37-b589-805b27b2cbd7 /               ext3    errors=remount-ro,user_xattr 0       1
    UUID=16a7fee0-be9e-4e34-9dc3-28f4eeb61bf6 none            swap    sw              0       0
    
  • JosephH
    JosephH over 9 years
    I tried the approaches from other answers, but switching to 'u' mode was the only one that worked for me.
  • Avanst
    Avanst over 9 years
    Of all the answers, this is the one that worked for me as well.
  • markling
    markling about 5 years
    Thsi answer suggests it might not be a problem: askubuntu.com/a/880152/297529
  • mckenzm
    mckenzm over 3 years
    .. not a problem if it is an extended partition, which cannot imagine Partition 1 would ever be. Normally 3.