Saturday, 10 August 2013

ZFS on >2TB disk in Ubuntu 12.04?

ZFS on >2TB disk in Ubuntu 12.04?

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.

No comments:

Post a Comment