Samsung HD204UI 2TB - 4k or 512?

Status
Not open for further replies.

Milhouse

Guru
Joined
Jun 1, 2011
Messages
564
These Samsung HD204UI 2TB drives are apparently 4K sectors internally, but the Samsung drive firmware presents them as 512 bytes at the hardware level.

Question is, when creating a ZFS volume is it better to select 4K support or not with these drives? I'm guessing not, as they're seen as 512 byte drives, but just wanted to sanity check this theory!

I suppose the problem then becomes when you replace these drives as they fail, most likely with true 4K sector drives, would it then have been better to use 4K support from the outset even if these Samsung drives are 512 byte?
 
I

ixdwhite

Guest
Experimentation is recommended :)

You will probably want to use a real FreeBSD machine so you can change the GEOM stack and install perf tools and so forth, but what you learn could be applied to FreeNAS with some care.

A trick I learned the other day was that there is a 'gnop' GEOM class (GEOM no-op) that lets you change the sector size on the provider side. You can stack gnop over the raw disk device and emulate 4K sectors on the top. You can then run perf tests with and without the gnop class and see if batching I/Os into 4K blocks makes a difference (minus the gnop overhead which is apparently about 2% with sector-sized IOPS and less as the I/Os increase in size).

In BETA I think we had a '4K disk mode' checkbox in FreeNAS that would do just this if the underlying disk was presenting 512 byte sectors.
 

jafin

Explorer
Joined
May 30, 2011
Messages
51
In BETA I think we had a '4K disk mode' checkbox in FreeNAS that would do just this if the underlying disk was presenting 512 byte sectors.

Yes i saw the tick box for 4k in 8.0.1 beta.
 

Milhouse

Guru
Joined
Jun 1, 2011
Messages
564
Cheers Doug.

Experimentation is recommended :)

Yeah, although my Samsung HD204UI 2TB disks are currently setup for 512 byte/ashift=9 and loaded with data (not that I can't blow the pool away and start again, just hoped I wouldn't have to!)

However even when experimenting in the past (with zfsguru and FN0.7.2) I saw little difference between 4K and 512byte, but then these particular drives may be accounting for that lack of performance difference, other "real" 4K drives may perform very differently. So the question remains - would it be better to plan ahead and create the vdev/pool with 4K sectors even if the current 2TB disks are 512 byte (either actual or through firmware emulation), on the assumption that future replacement disks WILL be 4K and benefit from the 4K sector alignment?

I suppose I'm looking for some general "best practice" guidance that could be useful to everyone who is currently building a zfs pool with 2TB/512byte disks, when the future likelihood is that replacement disks will not use 512 byte sectors.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
I've been checking the 4K box and I completely saturate my Gbit connection with a single drive or 4 drives in RAIDZ. A RAIDZ2 is slower due to processing overhead I suspect. My speed is ~970MB/sec solid. No dips or jumps, steady. I do get a TRAP 28 failure after a period of time transferring data while testing the NAS out but that's another story. Once I fix my trap issue I'll try FreeNAS without the 4K box checked to see if there is any measurable difference on my machine.

A little off topic:
One thing no one has shared from the Samsung company is how the translation works other than it's 512 byte emulation. I'd like to know the physical track layout and how the 512 bytes from sector 63 through XX work. If you command a write to sector 63 does it actually go to sector 63 or does it really go to sector 64, then a read of the rest of the 4K sector is done and then all data is written as a 4K chunk with the new 512 bytes inserted. That is how I would have designed emulation but I would think the write would wait long enough to verify no more data was going to be changed in the 4K chunk. Knowing about how sector 63 is affected makes the difference in how external software would interact on the drive.

My two+ cents.
avatar.gif
 

Milhouse

Guru
Joined
Jun 1, 2011
Messages
564
Thanks Joe. Just out of interest, what protocol were you using to saturate your Gbit connection - CIFS, NFS, iSCSI? And were your disks Samsung HD204UI?
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
Milhouse,
CIFS was the beast at hand and yes, I was using the HD204UI drives. This was with a current build, the Beta would be close enough. Also I am using Rosewill and D-Link Gigabit Switches throughout my home network, a hub will not work as well. My D-Link wireless router is only for Internet access, everything connects to the switches and one switch connects to the router. This made a huge change in my speed around the house. I stream video and have 3 DirecTv DVRs with whole house sharing. I need the bandwidth.

Hope that helps.
-Mark
 

runrun

Cadet
Joined
Jul 30, 2011
Messages
2
I'm also trying to find a definitive answer to the same question.
They're 4k Drives internally, presented as 512b through emulation.

My (very) limited testing shows very good performance with either 4k or 512 on a single zfs disk - but I wouldn't trust my rather limited copy&paste dd 'benchmark' commands.

Has anyone come to a conclusion as to whether these 2tb Samsung HD204UI drives should have the 4kb option checked or left blank?
 

Milhouse

Guru
Joined
Jun 1, 2011
Messages
564
I went with 4K in the end, as I concluded that when a drive dies in the future it will most likely be replaced with another "advanced format" drive that won't necessarily be another HD204UI and this new drive may present native 4K to the OS so creating the vdev with 512K might cause me problems in the future when I try to add in a non-512K supporting replacement drive.

Since the HD204UI's work fine with 4K selected, it seems the safest long term option.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
I went with 4K in the end, as I concluded that when a drive dies in the future it will most likely be replaced with another "advanced format" drive that won't necessarily be another HD204UI and this new drive may present native 4K to the OS so creating the vdev with 512K might cause me problems in the future when I try to add in a non-512K supporting replacement drive.

Since the HD204UI's work fine with 4K selected, it seems the safest long term option.

How can I tell if my drive is truly saving data in 4K chunks? I know we can look at the ashift which tells me the starting sector is now sector 64 (I hope) but that doesn't tell me a block of data is 4K as seen by the FreeNAS or ZFS, does it? I do know the Advanced Format drives are 4K internally but the HD204UI is 512bytes at the interface, nothing can change that. I hope you understand my question and I'm really not trying to beat any dead horse.
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
Mark, are you spreading your bugs to FreeNAS or the other way around? I think they're multiplying! ;)
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
Mark, are you spreading your bugs to FreeNAS or the other way around? I think they're multiplying! ;)
Admit it, you like it. Have you tried to get them off your screen lately:rolleyes:
 
T

Teddie

Guest
Hello! :-D
It excuses good evening that my English is not so good and needs therefore a short summary.

HD204UI Patch : yes or no (Samsung Website (FAQ))

HD204UI forced 4K : yes or no
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
Hello! :-D
It excuses good evening that my English is not so good and needs therefore a short summary.

HD204UI Patch : yes or no (Samsung Website (FAQ))

HD204UI forced 4K : yes or no

If your drive manufacturing date is January 2011 or later the patch is already there. The firmware number does not change so you cannot tell just by looking for the firmware number.

You should use forced 4K if all your drives are 4K capable. Even though it's 512 byte emulation, the software should write in 4K blocks so it will still speed things up. This drive is a 4K drive.
 
T

Teddie

Guest
If your drive manufacturing date is January 2011 or later the patch is already there. The firmware number does not change so you cannot tell just by looking for the firmware number.

You should use forced 4K if all your drives are 4K capable. Even though it's 512 byte emulation, the software should write in 4K blocks so it will still speed things up. This drive is a 4K drive.

Thank you! ;)
 
Status
Not open for further replies.
Top