zpool gives only 3GB instead of 2.7TB

dvl@

Developer
I am setting up to run some tests on FreeBSD 9.1 with ZFS.

I'm blocked by this series of command which results in a 3GB zpool, instead of an expected 2.7TB zpool.

Here are the commands:

Code:
[root@floater:~] # gpart create -s GPT ada1
ada1 created

[root@floater:~] # gpart add -a 1m -t freebsd-zfs -l Bay1.ada1 ada1
ada1p1 added

[root@floater:~] # gnop create -S 4k gpt/Bay1.ada1

[root@floater:~] # zpool create -f  -m /mnt examplecluster   /dev/gpt/Bay1.ada1.nop

[root@floater:~] # # df -h examplecluster
Filesystem        Size    Used   Avail Capacity  Mounted on
examplecluster    3.7G    144k    3.7G     0%    /mnt
[root@floater:~] # 

[root@floater:~] # gpart show ada1
=>        34  5860533101  ada1  GPT  (2.7T)
          34        2014        - free -  (1M)
        2048  5860530176     1  freebsd-zfs  (2.7T)
  5860532224         911        - free -  (455k)


I'm sure this is something simple that I'm overlooking.

FWIW, /mnt is empty before and after this process.
 
FWIW, this seems to a problem related to this one drive. I tried the same thing on ada5, all good.
 
Is this relevant?

Code:
$ ls -l /dev/gpt/
total 0
crw-r-----  1 root  operator  0x90 Mar 20 18:00 Bay1.ada1
 
The partition has been deleted.

Code:
[dan@floater:~/bin/benchmarks] $ gpart show ada1
=>        34  5860533101  ada1  GPT  (2.7T)
          34  5860533101        - free -  (2.7T)

[dan@floater:~/bin/benchmarks] $ ls -l /dev/gpt/
total 0
crw-r-----  1 root  operator  0x90 Mar 20 18:00 Bay1.ada1
[dan@floater:~/bin/benchmarks] $
 
Code:
root@floater:/home/dan/bin/benchmarks # true > /dev/ada1

root@floater:/home/dan/bin/benchmarks # ls -l /dev/gpt/
total 0
crw-r-----  1 root  operator  0x90 Mar 20 18:00 Bay1.ada1

root@floater:/home/dan/bin/benchmarks # gpart destroy ada1
ada1 destroyed

root@floater:/home/dan/bin/benchmarks # ls -l /dev/gpt/
total 0
crw-r-----  1 root  operator  0x90 Mar 20 18:00 Bay1.ada1
root@floater:/home/dan/bin/benchmarks #
 
BINGO! *ding* *ding* *ding*

Code:
# gpart show -l -p
=>       34  976773101    ada0  GPT  (465G)
         34         94  ada0p1  (null)  (47k)
        128         34          - free -  (17k)
        162    8388480  ada0p2  root  (4G)
    8388642   12582912  ada0p3  (null)  (6.0G)
   20971554   12582912  ada0p4  var  (6.0G)
   33554466   12582912  ada0p5  tmp  (6.0G)
   46137378  922746880  ada0p6  usr  (440G)
  968884258       2014          - free -  (1M)
  968886272    7886848  ada0p7  Bay1.ada1  (3.8G)
  976773120         15          - free -  (7.5k)

Now let's clean up:

Code:
# gpart delete -i 7 ada0
ada0p7 deleted

And try again:

Code:
gpart create -s GPT ada1
gpart add -a 1m -t freebsd-zfs -l Bay1.ada1 ada1
gnop create -S 4k gpt/Bay1.ada1
zpool create -f  -m /mnt examplecluster   /dev/gpt/Bay1.ada1.nop
df -h examplecluster

which gives:

Code:
# df -h examplecluster
Filesystem        Size    Used   Avail Capacity  Mounted on
examplecluster    2.7T    144k    2.7T     0%    /mnt

... as expected.

Now, how could I have figured this out earlier, say, without that gpart show command?
 
gpart(8) ought to check for an existing GPT label before allowing it to be assigned again. And that should have a flag to override it and assign the duplicate GPT label anyway, an "I know what I'm doing" option.
 
Back
Top