Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Aug 2012 19:07:42 +0300
From:      Zeus Panchenko <zeus@ibs.dn.ua>
To:        <freebsd-geom@FreeBSD.ORG>
Cc:        freebsd-fs@FreeBSD.ORG
Subject:   `zpool create' fails on geli ...
Message-ID:  <20120821190742.54449@relay.ibs.dn.ua>

next in thread | raw e-mail | index | archive | help
hi all,

SYNOPSIS: `zpool create poolname device.eli' available on .eli device only after dd some
          random data to .eli first

I am trying to get ZFS on GELI disk ...

Here is the issue:

#> uname -a
FreeBSD 9.0-RELEASE #0 amd64

for /dev/ada2 I do:

#> geli init -K /path/key -s 4096 -a hmac/sha256 -e aes-xts /dev/ada2
Enter new passphrase:
Reenter new passphrase:

Metadata backup can be found in /var/backups/ada2.eli and
can be restored with the following command:

        # geli restore /var/backups/ada2.eli /dev/ada2


#> geli attach -k /path/key /dev/ada2

now I have .eli device

#> ls -al /dev/*eli
lrwxr-xr-x  1 root  wheel            8 Aug 16 15:43 /dev/ad14.eli -> ada2.eli
crw-r-----  1 root  operator    0,  99 Aug 16 15:43 /dev/ada2.eli

now I am trying to create zfs on it:

>  zpool create geliz /dev/ada2.eli
cannot create 'geliz': one or more devices is currently unavailable

`zpool create -f ...' gave the same result and in messages I have plenty
rows like these:

cat /var/log/messages
...
GEOM_ELI: ada2.eli: 131072 bytes corrupted at offset 444539600896.
GEOM_ELI: ada2.eli: 131072 bytes corrupted at offset 444539863040.
GEOM_ELI: ada2.eli: 8192 bytes corrupted at offset 270336.
GEOM_ELI: ada2.eli: 8192 bytes corrupted at offset 444539609088.
GEOM_ELI: ada2.eli: 8192 bytes corrupted at offset 444539871232.
GEOM_ELI: ada2.eli: 4096 bytes corrupted at offset 444540313600.
GEOM_ELI: ada2.eli: 8192 bytes corrupted at offset 65536.
GEOM_ELI: ada2.eli: 8192 bytes corrupted at offset 8192.
GEOM_ELI: ada2.eli: 8192 bytes corrupted at offset 0.
GEOM_ELI: ada2.eli: 8192 bytes corrupted at offset 262144.
...



but after 
#> dd if=/dev/random of=/dev/ada2.eli bs=10m count=10
10+0 records in
10+0 records out
104857600 bytes transferred in 7.124000 secs (14718922 bytes/sec)

I was able to do it!

#> zpool create geliz /dev/ada2.eli

pool was successfully created 

but pool status looks weird for me:

#> zpool status geliz
  pool: geliz
 state: ONLINE
status: One or more devices has experienced an unrecoverable error.  An
        attempt was made to correct the error.  Applications are unaffected.
action: Determine if the device needs to be replaced, and clear the errors
        using 'zpool clear' or replace the device with 'zpool replace'.
   see: http://www.sun.com/msg/ZFS-8000-9P
 scan: none requested
config:

        NAME        STATE     READ WRITE CKSUM
        geliz       ONLINE       0     0     0
          ada2.eli  ONLINE      10     0     0

errors: No known data errors

after `zscub' and `zpool clear' I have clean pool:

#> zpool status geliz
  pool: geliz
 state: ONLINE
 scan: scrub repaired 0 in 0h0m with 0 errors on Thu Aug 16 16:36:44 2012
config:

	NAME        STATE     READ WRITE CKSUM
	geliz       ONLINE       0     0     0
	  ada2.eli  ONLINE       0     0     0

errors: No known data errors


QUESTION:

1. Am I correct to think I really have correct ZFS over GELI set?

2. Why it was needed to dd? What am I missing here, please?


may somebody explain that for me please ...?

-- 
Zeus V. Panchenko				jid:zeus@im.ibs.dn.ua
IT Dpt., I.B.S. LLC					  GMT+2 (EET)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120821190742.54449>