I just got a 4TB disk and I'm running Ubuntu 12.04. http://www.thegeekstuff.com/2012/08/2tb-gtp-parted/ says you need to partition your disk with GPT if you want to use >2TB (and that you can do this with fdisk/gparted).
However I'm interested in using ZFS. However, every tool I've tried only reports 2TB, and the hdparm -N
output for reporting max sectors is sketchy:
$ uname -a
Linux nuthouse 3.2.0-49-generic #75-Ubuntu SMP Tue Jun 18 17:39:32 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
$ dmesg | fgrep sde
[2505154.456871] sd 5:0:0:0: [sde] 488370432 4096-byte logical blocks: (2.00 TB/1.81 TiB)
[2505154.460111] sd 5:0:0:0: [sde] No Caching mode page present
[2505154.460117] sd 5:0:0:0: [sde] Assuming drive cache: write through
[2505154.508410] sde: sde1 sde9
$ sudo hdparm -N /dev/sde
/dev/sde:
SG_IO: bad/missing sense data, sb[]: 70 00 02 00 00 00 00 0a 00 00 00 00 04 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
SG_IO: bad/missing sense data, sb[]: 70 00 02 00 00 00 00 0a 00 00 00 00 04 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
max sectors = 0/1, HPA is enabled
$ sudo parted /dev/sde print
Model: WD My Book 1140 (scsi)
Disk /dev/sde: 2000GB
Sector size (logical/physical): 4096B/4096B
Partition Table: gpt
Number Start End Size File system Name Flags
$ sudo gdisk /dev/sde
GPT fdisk (gdisk) version 0.8.1
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
Command (? for help): p
Disk /dev/sde: 488370432 sectors, 1.8 TiB
Logical sector size: 4096 bytes
Disk identifier (GUID): 2B18FE55-5944-2946-A9C6-69C21EFEEAB8
Partition table holds up to 128 entries
First usable sector is 6, last usable sector is 488370426
Partitions will be aligned on 256-sector boundaries
Total free space is 488370421 sectors (1.8 TiB)
Number Start (sector) End (sector) Size Code Name
Command (? for help): v
No problems found. 488370421 free sectors (1.8 TiB) available in 1
segments, the largest of which is 488370421 (1.8 TiB) in size.
Command (? for help): q
$ sudo zpool create tank /dev/sde
$ sudo zpool list
NAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOT
tank 1.81T 576K 1.81T 0% 1.00x ONLINE -
$ sudo parted /dev/sde print
Model: WD My Book 1140 (scsi)
Disk /dev/sde: 2000GB
Sector size (logical/physical): 4096B/4096B
Partition Table: gpt
Number Start End Size File system Name Flags
1 8389kB 2000GB 2000GB zfs
9 2000GB 2000GB 67.1MB
$ sudo gdisk /dev/sde
GPT fdisk (gdisk) version 0.8.1
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
Command (? for help): p
Disk /dev/sde: 488370432 sectors, 1.8 TiB
Logical sector size: 4096 bytes
Disk identifier (GUID): 2B18FE55-5944-2946-A9C6-69C21EFEEAB8
Partition table holds up to 128 entries
First usable sector is 6, last usable sector is 488370426
Partitions will be aligned on 256-sector boundaries
Total free space is 2293 sectors (9.0 MiB)
Number Start (sector) End (sector) Size Code Name
1 2048 488353791 1.8 TiB BF01 zfs
9 488353792 488370175 64.0 MiB BF07
Command (? for help): v
No problems found. 2293 free sectors (9.0 MiB) available in 2
segments, the largest of which is 2042 (8.0 MiB) in size.
Command (? for help): q
How should I proceed? Thanks for any hints.
Since
parted
is reporting the disk as being 2000GB, blanking the partition table is unlikely to help. (Those size reports are based on the size of the hardware and are unrelated to what's in the partition table.) It's more likely that something has set the Host Protected Area (HPA) for the disk, thus limiting its apparent size. You can adjust this with the Linuxhdparm
command, and in particular its-N
option. (Typeman hdparm
and search on-N
to find the details.) Typingsudo hdparm -N /dev/sde
will report the current HPA status without changing it, so try that as a diagnostic.Another possibility is that there's something wrong in the disk hardware or software stack. Your
parted
output indicates that you've got a WD My Book 1140. A Web search on this suggests that this is an external hard disk. Sometimes they can be problematic because of USB stack problems. Usually, though, such problems are issues with the firmware in the enclosure -- if the enclosure has a 32-bit limit on sector numbers, it will do weird things to the apparent size of the disk. In this case, though, it would be shocking if WD were to ship inadequate firmware with an over-2TiB disk, so this is plausible only if you've replaced the disk in the enclosure with a larger model yourself. Still, there could be a problem somewhere along these lines, especially if you're using an unusual USB adapter or something like that. It might be worth describing your hardware in more detail (both the drive and the motherboard or whatever type of adapter to which it's connected).One more diagnostic to try is
gdisk
: Launchgdisk
on the disk, typep
,v
, and thenq
to quit. Post the complete results. It's unlikely that this will provide any big clues, but there's an off chance that it will do so. You may need to installgdisk
first (it's in either thegdisk
orgptfdisk
package; I don't recall which name Ubuntu uses, offhand).Edit: Your
hdparm -N
output is weird. Perhaps the enclosure's firmware isn't passing through that feature correctly. OTOH, the output does indicate that HPA is active, so it might be worth digging into that further with other utilities. (Maybe something Windows-based from the disk's manufacturer would fare better, especially if the disk is odd in some way.)The
gdisk
output doesn't provide any new clues, although I did notice something I hadn't the first time around: The disk uses 4096-byte logical sectors. This means that you could use MBR on the disk, despite its size. (With 4096-byte sectors, MBR's limit goes up to 16TiB.) Using MBR isn't likely to help you because of the underlying problem that Linux is mis-detecting its size, though.I have a few suggestions for things to try now:
Try these in any order that you like.