4096 physical block size drives

Posted by 춘자 리눅스/리눅스설정 : 2014.05.02 21:09

If you buy a new hard drive today, there is a big chance that the disk has the new format of 4KB physical block size instead of the classic 512-byte. The drive willwork, however, you may experience some performance issues. I realized this when my usb2 external drive would pause -without errors or warnings- when there was heavy IO or something new was attached to the usb bus. You can query the drive to see what type of block size it has, but beware, some drives … lie.

An honest example:

$ sudo hdparm -I /dev/sde |grep size
Logical  Sector size:                   512 bytes
Physical Sector size:                  4096 bytes
device size with M = 1024*1024:     1430799 MBytes
device size with M = 1000*1000:     1500301 MBytes (1500 GB)
cache/buffer size  = unknown

Some drives may report 512 while being of the 4096 bytes type. To enhance the performance of the drive, you should align your partitions. In short, this means than when creating partitions, these need to start at a cylinder that is a factor of 8. If you only have one partition, let it start at cylinder 64.

For further reference, these are the model numbers of the Western Digital (the pioneer in 4096 byte block size) I have:

$ sudo hdparm -I /dev/sde |grep Model
Model Number:       WDC WD15EADS-11P8B1
$ sudo hdparm -I /dev/sdc |grep Model
Model Number:       WDC WD10EADS-00M2B0

(The last drive does not print having a 4096 byte block size. Because of the identical performance problem as the other one, I am sure it has that type of block size.)

The quickest solution -if you are not installing Windows XP and previous on the disk- is to format the drive without the DOS compatibility setting. E.g. (replace ‘x’ by the correct device name of your drive).

sudo fdisk -uc /dev/sdx

Command (m for help): d
Selected partition 1

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

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): 83

Command (m for help): p

Disk /dev/sdx: 1500.3 GB, 1500301910016 bytes
81 heads, 63 sectors/track, 574226 cylinders, total 2930277168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x4fabbfc4

Device Boot      Start         End      Blocks   Id  System
/dev/sdx1            2048  2930277167  1465137560   83  Linux

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

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

Use mkfs.ext4 or gparted (gui) to create a filesystem on the newly formatted drive.

출 처 : http://nxadm.wordpress.com/2010/04/30/4096-physical-block-size-drives/

댓글을 달아 주세요

 «이전 1 2 3 4 5 6 ··· 98  다음»