[zfs-discuss] four unknown ZFS disks - how do I know to recombine?

Derek Williams flyddw at gmail.com
Mon May 27 11:19:49 EDT 2013


I'm remembering now - I actually did some tricky multi learning exercises.
I create 4 files of 256MB each, then I shared them out via iSCSI, and then
on another VM server I had installed ZFS Fuse on, I attached them, and made
a raidz-1 pool, then I shared that pool out via SAMBA.

So, by copying those files over to a Solaris 11 Intel VM, I used the native
ZFS to look at it.  I still can't mount it, but at least I have more clues
as to how to do it:

[root at centos6 disk2]# strings sda.img | grep dev
vdev_children
        vdev_tree
/dev/sdg
/dev/sdh
/dev/sdi
/dev/sdj

[root at centos6 disk2]# ls -Fal
total 483696
drwxr-xr-x 2 root   root        4096 May 26 12:52 ./
drwxrwxrwx 3 nobody nobody      4096 May 27 11:14 ../
-rw-r--r-- 1 root   root        2501 May 26 13:11 recreate.txt
-rw-r--r-- 1 root   root   268435456 Apr  3 19:52 sda.img
-rw-r--r-- 1 root   root   268435456 Apr  3 19:52 sdb.img
-rw-r--r-- 1 root   root   268435456 Apr  3 19:52 sdc.img
-rw-r--r-- 1 root   root   268435456 Apr  3 19:52 sdd.img
[root at centos6 disk2]# more recreate.txt

root at new-host-4:~/zfs-disks# pwd
/root/zfs-disks
root at new-host-4:~/zfs-disks# zpool import -d /root/zfs-disks/
  pool: ddwzfs
    id: 3379962567018686195
 state: UNAVAIL
status: One or more devices are missing from the system.
action: The pool cannot be imported. Attach the missing
        devices and try again.
   see: http://www.sun.com/msg/ZFS-8000-3C
config:

        ddwzfs                       UNAVAIL  insufficient replicas
          raidz1-0                   UNAVAIL  insufficient replicas
            /root/zfs-disks/sda.img  UNAVAIL  cannot open
            /root/zfs-disks/sdb.img  UNAVAIL  cannot open
            /root/zfs-disks/sdc.img  UNAVAIL  cannot open
            /root/zfs-disks/sdd.img  UNAVAIL  cannot open
root at new-host-4:~/zfs-disks# zdb -l /root/zfs-disks/*
------------------------------------------
LABEL 0
------------------------------------------
    version: 23
    name: 'ddwzfs'
    state: 0
    txg: 23372
    pool_guid: 3379962567018686195
    hostname: 'centos63'
    top_guid: 7605289063886138055
    guid: 7841091704341328932
    vdev_children: 1
    vdev_tree:
        type: 'raidz'
        id: 0
        guid: 7605289063886138055
        nparity: 1
        metaslab_array: 23
        metaslab_shift: 23
        ashift: 9
        asize: 1054867456
        is_log: 0
        create_txg: 4
        children[0]:
            type: 'disk'
            id: 0
            guid: 7841091704341328932
            path: '/dev/sdg'
            whole_disk: 0
            DTL: 95
            create_txg: 4
        children[1]:
            type: 'disk'
            id: 1
            guid: 7052492910236321451
            path: '/dev/sdh'
            whole_disk: 0
            DTL: 94
            create_txg: 4
        children[2]:
            type: 'disk'
            id: 2
            guid: 5894364482174933990
            path: '/dev/sdi'
            whole_disk: 0
            DTL: 93
            create_txg: 4
        children[3]:
            type: 'disk'
            id: 3
            guid: 272044450848045578
            path: '/dev/sdj'
            whole_disk: 0
            DTL: 92
            create_txg: 4
------------------------------------------
LABEL 1 - CONFIG MATCHES LABEL 0
------------------------------------------
------------------------------------------
LABEL 2 - CONFIG MATCHES LABEL 0
------------------------------------------
------------------------------------------
LABEL 3 - CONFIG MATCHES LABEL 0
------------------------------------------



On Thu, May 23, 2013 at 10:22 AM, Derek Williams <flyddw at gmail.com> wrote:

> Thanks Gregor!
>
> I will try this and report back.
>
>
> On Wed, May 22, 2013 at 9:25 AM, Gregor Kopka <gregor at kopka.net> wrote:
>
>>  Convert the files through losetup into block devices, symlink these into
>> a directory, then issue
>> $ zpool import -d <dir with the symlinks>
>> and ZFS should report if there is a pool to import, it's name and layout.
>>
>> Gregor
>>
>>
>> Am 22.05.2013 14:58, schrieb Derek Williams:
>>
>>  I will try the zpool import, with all kinda of combinations.  I,
>> however, in trying to simplify the question failed to say that the "disks"
>> weren't really "disks", but just 4 large files. Also, I am using the Linux
>> version (if it matters). ZFS doesn't care where it gets the storage from
>> (usb, san, nfs, files, etc). I just used four 256MB files named sda1, sda2,
>> sda3, sda4, created the pool (forgot the name too), mount it, and reshared
>> it out via Samba.
>>
>>  When I use the unix command "file sda1", it just says "data" :-)
>>
>>  I love the simplicity of ZFS, and can only imagine the power when used
>> in more complex situations.
>>
>>
>> On Wed, May 22, 2013 at 8:15 AM, Gregor Kopka <gregor at kopka.net> wrote:
>>
>>> $ zpool import
>>>
>>> without any pool name given should scan all devices for members of
>>> unimported pools.
>>>
>>> Gregor
>>>
>>> Am 22.05.2013 01:51, schrieb flyddw at gmail.com:
>>>
>>>> Using Virtual disks in vmware, I made a ZFS pool. I later rebuilt the
>>>> system, but forgot what kind of pool I created using the disks (mirror,
>>>> raid, raidz).
>>>>
>>>> Is it possible for the ZFS commands to look at the disks, and tell me,
>>>> so I can recreate it?
>>>>
>>>
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.zfsonlinux.org/pipermail/zfs-discuss/attachments/20130527/30970bf8/attachment.html>


More information about the zfs-discuss mailing list