# 2TB 4k Sector HDD (Samsung HD204UI) exposes 512B sectors

## EliasP

I've recently bought 2 Samsung 2TB HDDs (Spinpoint F4, HD204UI).

These are AFT disks, which have 4k sector sizes, but it seems like the HDDs only expose 512b sectors to the OS:

```

homeserver ~ # uname -a

Linux homeserver 2.6.37-gentoo #1 SMP Sat Jan 29 00:52:53 CET 2011 x86_64 Intel(R) Core(TM)2 CPU 6600 @ 2.40GHz GenuineIntel GNU/Linux

homeserver ~ # cat /sys/devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0/block/sdb/queue/max_sectors_kb

512

homeserver ~ # cat /sys/devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0/block/sdb/queue/hw_sector_size

512

homeserver ~ # hdparm -iv /dev/sdb

/dev/sdb:

 multcount     =  0 (off)

 IO_support    =  1 (32-bit)

 readonly      =  0 (off)

 readahead     = 256 (on)

 geometry      = 243201/255/63, sectors = 3907029168, start = 0

 Model=SAMSUNG HD204UI, FwRev=1AQ10001, SerialNo=S2H7J1BZA02513

 Config={ Fixed }

 RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=4

 BuffType=unknown, BuffSize=unknown, MaxMultSect=16, MultSect=off

 CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=3907029168

 IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}

 PIO modes:  pio0 pio1 pio2 pio3 pio4

 DMA modes:  mdma0 mdma1 mdma2

 UDMA modes: udma0 udma1 udma2 udma3 udma4 udma5 *udma6

 AdvancedPM=yes: disabled (255) WriteCache=enabled

 Drive conforms to: unknown:  ATA/ATAPI-0,1,2,3,4,5,6,7

 * signifies the current active mode

```

Since I'm running a DM raid + LVM on them, I cannot do manual alignment of the partitions to ensure 4k block alignment.

I'm running the latest firmware which also fixes the data corruption caused by SMART commands and haven't found any hints in the documentation about jumper settings to enforce 4k sectors.

I think this 512B sectors are shown for compatibility reasons for operating systems like Win XP which aren't capable of dealing properly with 4k disks.

But as 512B alignment causes massive performance loss, I don't want to use this at all.

Does anyone have any ideas how to enforce 4k blocks for these HDDs?

I'm close to trashing them - this were definitely the last Samsung disks I bought. The professional handling of the SMART/firmware bug by Samsung says enough: fix a critical bug in firmware - don't change the revision number of the firmware. Scumbag Samsung!

----------

## gorkypl

Yeah, I've got one - the lies about physical 512b are quite disappointing, but I have to admit that the disk itself is really fast and cool.

Unfortunately I can't help you, because I'm using it only with LVM, no RAID - and placing LVM on well aligned (starting on 2048s) partition seemes to be enough, as LVM uses quite large chunks of data (like 1MB or so). But when I was googleing while installing it in my system I've found an article which may help in some way (albeit the author doesn;t seem to be concerned of what he writes):

http://blog.bigsmoke.us/2010/05/13/aligning-partitions-with-raid-and-lvm-on-drives-with-4-kb-sectors

----------

## EliasP

So what he did, was using a partition on each disk which was 4k aligned.

I'll probably end up doing this too, as it looks, like it's the most simple solution to work around this vendor stupidity.

----------

## s_bernstein

The problem is, that the WD Green Caviar 2TB also reports 512B sectors to the OS. So maybe the best way is to go with a 3TB disc because they can't report 512B blocks.

----------

## Hu

Even though the drives report wrong information about their internal design, that only causes the kernel to pass the misleading data to user tools.  If you use a tool, such as sfdisk, which can set layout on arbitrary sectors, then you can partition the device with any layout you want.  You may need to use --force, and you will need to work out the "correct" layout on your own, since sfdisk is not told that its default is a bad idea.

----------

