Solved cannot attach disk to mirror

I think I have a syntax error in my command I just can't see it.

Code:
anders@aasennas:/dev % zpool list -v fastzfs
NAME                 SIZE  ALLOC   FREE  EXPANDSZ   FRAG    CAP  DEDUP  HEALTH  ALTROOT
fastzfs             19.8T  17.0T  2.79T     3.65T    30%    85%  1.21x  ONLINE  -
  mirror            3.59T  3.08T   531G     3.65T    28%    85%
    gpt/nyzfsdisk1      -      -      -         -      -      -
    gpt/nyzfsdisk2      -      -      -         -      -      -
  mirror            3.59T  3.06T   550G         -    29%    85%
    gpt/zfsdisk8        -      -      -         -      -      -
    gpt/zfsdisk9        -      -      -         -      -      -
  mirror            3.59T  3.06T   551G         -    29%    85%
    gpt/zfsdisk10       -      -      -         -      -      -
    gpt/zfsdisk11       -      -      -         -      -      -
  mirror            3.59T  3.00T   605G         -    28%    83%
    gpt/zfsdisk12       -      -      -         -      -      -
    gpt/zfsdisk13       -      -      -         -      -      -
  mirror            1.80T  1.60T   205G         -    34%    88%
    gpt/zfsdisk14       -      -      -         -      -      -
    gpt/zfsdisk15       -      -      -         -      -      -
  mirror            1.80T  1.59T   210G         -    35%    88%
    gpt/zfsdisk16       -      -      -         -      -      -
    gpt/zfsdisk17       -      -      -         -      -      -
  mirror            1.80T  1.60T   206G         -    33%    88%
    gpt/zfsdisk18       -      -      -         -      -      -
    gpt/zfsdisk6        -      -      -         -      -      -
anders@aasennas:/dev % sudo zpool attach fastzfs gpt/nyzfsdisk1 zvol/bigyoda/iscsi/nyzfsdisk1copy
cannot attach zvol/bigyoda/iscsi/nyzfsdisk1copy to gpt/nyzfsdisk1: no such pool or dataset
anders@aasennas:/dev % ls gpt/nyzfsdisk1 && ls zvol/bigyoda/iscsi/nyzfsdisk1copy
gpt/nyzfsdisk1
zvol/bigyoda/iscsi/nyzfsdisk1copy
anders@aasennas:/dev %

I can't see where I went wrong. I don't understand why zpool think gpt/nyzfsdisk1 is the pool name.

Thanks for any help.
 
You're not seriously trying to create a ZFS pool out of iSCSI-exported zvols, are you? :confused: What benefit could there possibly be in that?
 
I am changing some disk layout so it is just to continue having mirror and not having one single disk as a failure point, if you understand what i mean.

And they are not iSCSI exported, i just like having my zvols in one dataset.
 
Use absolute pathnames with zpool attach. At least that's what my zpool histroy says I've been using to expand my mirrors ;)
However, I *think* it should also work with paths relative to /dev, but not sure you maybe triggered some edge case with the iscsi target.

Of course if this zvol is on the same pool you're trying to attach it to, it should never work (if it does, thats really dangerous/stupid and is most likely a bug).
OTOH I also don't really understand your setup - are you trying to create a ZFS pool on top of (iSCSI-exported) zvols of another pool? This is mostly a bad Idea and performance will be horrible...
 
I also tried attaching with full path name
Code:
anders@aasennas:/dev % sudo zpool attach fastzfs /dev/gpt/nyzfsdisk1  /dev/zvol/bigyoda/iscsi/nyzfsdisk1copy
cannot attach /dev/zvol/bigyoda/iscsi/nyzfsdisk1copy to /dev/gpt/nyzfsdisk1: no such pool or dataset

same result

no its not a permanent solution it is migrate my data and re create another pool as a reaiz2 instead of mirrors, sins i don't need the iops.

and none of the disks are actually exported iscsi, i just like having all my zvols in one folder.
 
I am changing some disk layout so it is just to continue having mirror and not having one single disk as a failure point, if you understand what i mean.

What you want is logically impossible. A thing cannot be redundant unto itself. You're basically trying to use one disk to do the work of two.

Back up your data and recreate the pool. This kind of "creativity" is bound to destroy it anyway.
 
If you want to keep redundancý while you're replacing a device of a mirror VDEV you have to have a three-way mirror, no other way around it.
 
What you want is logically impossible. A thing cannot be redundant unto itself. You're basically trying to use one disk to do the work of two.

Back up your data and recreate the pool. This kind of "creativity" is bound to destroy it anyway.

i am not trying to to make anything redundant until itself,
Code:
zvol/bigyoda/iscsi/nyzfsdisk1copy
is on the pool bigyoda while i am attaching a disk in a pool named fastzfs. that means that one "disk" in fastzfs is actually a zvol in bigyoda. and yes it wont be that fast but it will be redundant wont it?

and even if it is stupid, shuddent it still work?
 
Code:
anders@aasennas:/dev % sudo zpool attach fastzfs mirror /dev/gpt/nyzfsdisk1 /dev/zvol/bigyoda/iscsi/nyzfsdisk1copy
too many arguments
usage:
   attach [-f] <pool> <device> <new-device>

The attach command is already for making mirrors aren't it? so it is trying to attach /dev/zvol/bigyoda/iscsi/nyzfsdisk1copy to /dev/gpt/nyzfsdisk1 as a mirror automatically?
 
i found a "problem" i seams i cant have a dataset in front of the zvol i am creating a pool with.

Code:
root@bsdserver:/usr/local/etc # zfs create -s -V 1G oceanpool/iscsidisktest
root@bsdserver:/usr/local/etc # zpool create testpool /dev/zvol/oceanpool/iscsidisktest 
root@bsdserver:/usr/local/etc # zpool list testpool
NAME       SIZE  ALLOC   FREE  EXPANDSZ   FRAG    CAP  DEDUP  HEALTH  ALTROOT
testpool  1008M   624K  1007M         -     0%     0%  1.00x  ONLINE  -
root@bsdserver:/usr/local/etc # zfs create -s -V 1G oceanpool/iscsi/disktest
root@bsdserver:/usr/local/etc # zpool create testpool2 /dev/zvol/oceanpool/iscsi/disktest
cannot create 'testpool2': no such pool or dataset

i guess this i a bug?

But this works on my router running FreeBSD 10.3 and my server running 10.3 not on my laptop running 12. current or my home server running 11.0
 
Well, putting a pool on top of a sparse volume is bound to blow up anyways, but try using the correct pool name: you created "testpool" and not "testpool2"
 
i created both testpool and testpool2 but, but the solution was to do
Code:
sysctl vfs.zfs.vol.recursive=1
vfs.zfs.vol.recursive: Allow zpools to use zvols as vdevs (DANGEROUS)

and to have an extra "disk" if one disk starts to throw errors cant be worse then not having it while waiting for a new disk? that is my original use for it.
 
Back
Top