Ubuntu – How to format a 4k sector hard drive

gpartedhard drivepartitioning

I bought a Seagate ST3000DM001 3TB hard drive. It was sold inside an enclosure. I formatted to ext4, copied some data to it and then I removed it from the enclosure and connected it directly to the motherboard. My data wasn't visible to OS (it was seeing one unknown ~300GiB partition and the rest as free space) so I started reading about Advanced Format and >2TB drives.

I connected the disk with USB again, copied all the data, and plugged to sata once again. I used gparted to create a GPT partition table (the ubuntu disk utility wouldn't let me with Error synchronizing after initial wipe: Timed out waiting for object (udisks-error-quark, 0), created one big 3Tb Ext4 partition, left the default Align to value to MiB and formatted.

The drive is recognized correctly, and mounts properly. Files can be copied from and to the drive successfully.

However:

Gparted shows the disk having 512k sectors which I know is not true1

gparted screenshot

while cat /sys/block/sdb/queue/physical_block_size reports 4096

I have found some reports that libparted has a problem with non-512k sectors2 and others3 that say that aligning to MiB is enough.

Parted reports that the drive is aligned when I choose minimal:

(parted) align-check 
alignment type(min/opt)  [optimal]/minimal? min                           
Partition number? 1                                                       
1 aligned
(parted)    

Is my configuration correct? Do I have performance penalty because the disk is formatted with 512k sectors, is gParted reporting false values or I have understood the whole thing wrong?

  1. http://www.storagereview.com/seagate_barracuda_3tb_review_1tb_platters_st3000dm001
  2. http://ubuntuforums.org/showthread.php?t=1536933&p=9754234#post9754234
  3. http://wdc.custhelp.com/app/answers/detail/a_id/5655

Best Answer

It reports 512 bytes because that is the logical sector size for backward compatibility with older OSes ( Windows ). (g)parted aligns partitions to 1 MiB, which is more than enough to work properly with drives using 4k physical sectors, so it is fine the way it is.

Related Question