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
Your hard disk has Advanced Format 4096-byte sectors to which the partition is not perfectly aligned
This line explains the warning:
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.
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.
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.)
As pointed out by izx:
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:
To accomplish this using the graphical hard-drive partitioning software that is called GParted then you can:
Launch the Gparted application with super-user privileges; exercise caution!
Select the storage device containing the erroneously sized partition from the pull-down menu in the upper right hand corner of the GParted menu.
Select the erroneously-sized partition by clicking on it in the rectangular partition map.
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
.
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.
Just delete all partitions and do this with
fdisk
:1. Solve it
I also encounter this problem, and this is how I suppress the annoying warning!
The key point is:
set the start to any logical sector, which is a multiple of 8
.I set
204800
(because I can only choose from 65535-976773167).step1 fdisk
step2 format the disk
step3 the result
And, finally the warning is disappear.
2.How this problem looks like
Show disk
fdisk
format
the problem
Partition 1 does not start on physical sector boundary.
I complete other excellent answers in this thread with an example of how to fix the warning numerically.
I could do all these operations from a live USB stick: it provides the terminal, a calculator and, of course, GParted. The problem is to adjust the start boundary of the partition.
Givens
For my case
sudo fdisk -l
signalled a few important things:Sector size (logical/physical): 512 bytes / 4096 bytes
;Units: sectors of 1 * 512 = 512 bytes
.Requirements
The requirement behind the warning
is that the partition boundary should be be at the beginning of a logical sector (individual size 512 B) and of a physical sector (individual size 4096 B). Therefore, the disk space in bytes before the beginning of the offending partition must be such that
where
n_L
is the logical-sector count (the output offdisk
) andn_P
is the physical-sector count. Both counts must be integers. Since 4096/512=8, this explains why 8 must be an integer divisor ofn_L
.Action
In my case: 12001278/8 = 1500159.75, so the decimals spoil the party. I have then the choice to move the start of the partition to the left (making it larger) or to the right (making it smaller). The choice depends on what is convenient for you with the current partition table. Either way, Gparted will ask you to move the partition using MiB as units. So it is necessary to compute the displacement.
I chose to move the partition start to the left and round down the ratio 1500159.75:
n_L/8 = 1500159
, you needn_L = 12001272
. Compare with 12001278, so move the partition's start 6 logical sectors to the left.After this displacement of 3 MiB, the warning disappeared. Of course:
12001272 * 512 = 4096 * 1500159
.If you have a windows dual boot you can use MiniTool Partition Wizard. This thing has saved my ass multiple times. Just right click the partition and click align. Don't forget to click apply.