Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Mac OS X 10.7.4 has a Sharkoon Quickdeck Pro USB enclosure attached. That USB enclosure contains a 4TB Advanced Format hard drive which has 4096 bytes (4K) sector size. The drive is GPT/GUID partitioned.

When listing the properties os the drive, it is being seen as "512 bytes per sector":

$ diskutil info W | grep -E 'Total Size:|Volume Free Space:|Device Block Size:'
   Total Size:               4.0 TB (4000787022336 Bytes) (exactly 7814037153 512-Byte-Blocks)
   Volume Free Space:        4.0 TB (4000772390912 Bytes) (exactly 7814008576 512-Byte-Blocks)
   Device Block Size:        512 Bytes

Or when formatting the disk with newfs_hfs the drive is being seen as "512b sector size".

$ sudo newfs_hfs -N -J /dev/disk3s1
7814037153 sectors (512 bytes per sector)
HFS Plus format parameters:
    volume name: "untitled"
    block-size: 8192
    total blocks: 488377322
    journal-size: 311296k
    first free catalog node id: 16
    catalog b-tree node size: 8192
    initial catalog file size: 354418688
    extents b-tree node size: 4096
    initial extents file size: 16777216
    attributes b-tree node size: 8192
    initial attributes file size: 354418688
    initial allocation file size: 61054976 (7453 blocks)
    data fork clump size: 65536
    resource fork clump size: 65536

How to make/force OS X to recognize Advanced Format 4K sector size drives as 4096 bytes per sector using command line tools

or

which USB drive/enclosure natively supports 4K sectors on OS X?

PS When reading the source code of newfs_hfs the sectorSize value seems to be derived from this function call ioctl(fso, DKIOCBLKSIZE, &dip.sectorSize)

share|improve this question
    
What partition scheme are you using? It needs to be GPT (GUID Partition Table) to support the 4K drives. Otherwise I think OS X should have native support for that, no problem. Have you tried using Disk Utility instead of the command line? –  robmathers Jul 24 '12 at 18:26
    
The drive is GPT (GUID) partioned. –  Pro Backup Jul 24 '12 at 19:49
    
Did you try using Disk Utility? It seems like a long shot, but it may do something different than directly accessing the newfs utility. –  robmathers Jul 24 '12 at 20:35
    
I don't want to use graphical utilities, only command line. –  Pro Backup Jul 24 '12 at 23:05
    
Disk Utility has the same problem for me with a USB enclosure and a 3TB Seagate drive with 4k sectors. Sees the drive as 801.57GB which would equate to 1k sectors. OSX 10.7.4, Disk Utility 12.1.1 (353) –  user27443 Aug 15 '12 at 4:53
add comment

3 Answers 3

up vote 1 down vote accepted

You may have a non-issue that you're worrying about. I have experienced this with several "enclosured" hard drives. The enclosure manufacturers want to sell more units, so they have developed their devices for the lowest common denominator--often Windows XP and USB.

The newer hard drive mechanisms utilize 4k blocks for better performance and media utilization. "Most" newer systems can directly talk to drives with the 4k interface. Unfortunately, I would assume these "most newer systems" represent less than 20% of the total market.

The enclosures manufacturers write and build the hardware/software interfaces between the native mechanism and the computer. This interface translates the eight 512-byte USB calls to single 4k SATA commands, aligning the USB blocks so they don't break the 4k boundaries.

new_hfs is reporting the USB controller's capabilities.

share|improve this answer
    
Indeed the newer hard drive "enclosures" like 3TB Toshiba Canvio and the 4TB HGST Touro both have "4096 Bytes" (4K) "Device Block Size" on 10.7.5. –  Pro Backup Jan 8 '13 at 16:16
add comment

I had this same issue. I finally resolved it by connecting to the drive using eSATA instead of USB or Firewire. My USB/FW enclosure has an eSATA port on the back, and I connected to that instead of USB. Bypassing the USB circuit in the external enclosure allowed Mac Disk Utility to directly recognize the WD30EZRX 3.0 TB drive, and to partition it correctly to that size.

Luckily I have an older Macbook Pro with and Express/34 slot and an eSATA adapter for that. I don't know how we are going fix this with newer MacBooks. Perhaps newer USB interfaces can correctly represent the Advanced Format sector info.

share|improve this answer
    
This is not an acceptable answer because eSATA is not USB. It would be nice as a comment, not as an answer. –  Pro Backup Dec 30 '12 at 16:40
    
It's not that bad actually. I have been able to reformat drives by changing enclosings before as well. –  patrix Dec 30 '12 at 17:13
add comment

There are several possible explanations for what you are seeing:


1. Diskutil is reporting incorrect information

On my system, I have a Western Digital Black 750 plugged into the sata port previously occupied by my super drive

I documented the install here:
https://spuder.wordpress.com/2011/02/17/hard-drive-upgrade/

Even though my advanced format drive has 4k sectors, the Block Size reports 512 Bytes. Since a Block is a collection of sectors, It would seem that my sector size is 512, and my block size is also 512.

spuders-MacBook-Pro:~ spuder$ diskutil info /dev/disk0| grep -E "Total Size:|Device Block Size:"
   Total Size:               750.2 GB (750156374016 Bytes) (exactly 1465149168 512-Byte-Blocks)
   Device Block Size:        512 Bytes 

However further investigation casts doubt on the output of diskutil

According to this website ( How to get HFS+ filesystem blocksize ), You can query the block size using the stat command.

Spuders-MacBook-Pro:~ spuder$ stat -f "%k" ~/.ssh/id_rsa.pub 
4096

4096 seems more like it.

So one possible solution is that diskutil simply can't be trusted.

It would be great if some other people could compare the output of their diskutil.


2. The usb enclosure does not support 4k sectors

This is the more likely answer.

If a hard drive enclosure supports 4k, it is likely to brag about it.

Here is an enclosure which people have reported working with 4k http://www.amazon.com/StarTech-com-3-5-Inch-Removable-Enclosure-S352U2RER/dp/B002GWQ4IW

This could easily be tested by someone who has access to a 4k drive, and an enclosure that is known to support 4k.


3. The drive is mis-reporting the sector size

According to this wiki, drives are not guaranteed to report the correct sector size

Unfortunately, some HDD manufacturers do not properly respond to the device inquiry sizes. ... The problem is that some HDDs misrepresent 4KB sector disks as having a physical sector size of 512 bytes.

http://wiki.illumos.org/plugins/viewsource/viewpagesrc.action?pageId=1147716

Additional Resources
http://pressf1.pcworld.co.nz/showthread.php?110190-4K-Sector-HDD-in-an-external-enclosure

share|improve this answer
    
Further investigation reveals that this might be an issue with diskutil (Explanation #1). I have checked 2 iMac computers, both created after 2011, which should have 4k drives, yet still show 512 sector size in diskutil info –  spuder Jul 22 '13 at 17:37
    
I connected a Toshiba DT01ACA300 3TB via eSATA cable to the eSATA ExpressCard AKE BC338 in my MacBookPro2,2 running OS X 10.6.8. diskutil shows me 512 byte sectors, whereas stat shows 4096. smartctl shows me 512 logical / 4096 physical. These differing infos assert nothing, just leave me insecure, not really knowing what's happening under the hood. I have to trust my BlackBoxes I guess. ;-) Hoping that one of the involved devices just misreports and the optimum happens in reality. –  porg Oct 8 '13 at 22:19
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.