Can I attach a zvol to mirror?

Hi

I have a mirror which have a disk not stable. I don't have disk to replace it now. I created a zvol from other pool. And try to attach the zvol to the mirror. But I got "no such pool or dataset " error message.

The target mirror
Code:
	NAME        STATE     READ WRITE CKSUM
	safe        ONLINE       0     0     0
	  mirror-0  ONLINE       0     0     0
	    ada0p1  ONLINE       0     0     0
	    ada1p1  ONLINE       0     0     0
Code:
zpool attach safe ada0p1 /dev/zvol/data/safedisk
cannot attach /dev/zvol/data/safedisk to ada0p1: no such pool or dataset

Does FreeBSD support the use of a zvol as a device for a zpool?
 
chunlinyao said:
zpool attach safe ada0p1 /dev/zvol/data/safedisk
cannot attach /dev/zvol/data/safedisk to ada0p1: no such pool or dataset

You should be able to that theoretically, but this must be the first time I´ve seen anyone actually trying to do it:)

Maybe try "fooling" it by GPT partitioning the zvol and use the GPT partition-name (or label-name) when attaching?

/Sebulon
 
@chunlinyao

Have you tried to GPT-partition the zvol?

# gpart create -s gpt /dev/zvol/data/safedisk
# gpart add -t freebsd-zfs -l safedisk /dev/zvol/data/safedisk
# zpool attach safe ada0p1 gpt/safedisk

/Sebulon
 
Sebulon said:
@chunlinyao

Have you tried to GPT-partition the zvol?

# gpart create -s gpt /dev/zvol/data/safedisk
# gpart add -t freebsd-zfs -l safedisk /dev/zvol/data/safedisk
# zpool attach safe ada0p1 gpt/safedisk

/Sebulon

I tried it. Got same error.
Code:
nas4free:~# zpool attach safe ada0p1 gpt/safedisk
cannot attach gpt/safedisk to ada0p1: no such pool or dataset
nas4free:~# zpool create test gpt/safedisk
cannot create 'test': no such pool or dataset
 
@ chunlinyao

Rats. What FreeBSD version are you on?
# uname -a

Perhaps this is fixed in newer versions? I don´t know, but maybe it would be worth a shot to csup and build a new world, or freebsd-update?

/Sebulon
 
Sebulon said:
@ chunlinyao

Rats. What FreeBSD version are you on?
# uname -a

Perhaps this is fixed in newer versions? I don´t know, but maybe it would be worth a shot to csup and build a new world, or freebsd-update?

/Sebulon

All posts before this did on nas4free, which is based on freebsd 9.0

Today I installed freebsd-9.1-RC1 in another machine and test the zfs on zvol feature.
Got same error message. I tried with and without gpt.
 
I have the same problem. 9.0-RELEASE.

I test it on solaris 11, it works fine.
can attach zvol to rpool as a mirror device.
 
Still not working in 9.1-RELEASE.

A similar thing that does work is to create a zpool from normal files on a ZFS dataset (see this blog). Unfortunately the performance was really bad. I got about 3 MB/s sequential write on a 260 MB/s pool. Mucking about with the checksum and sync parameters may improve performance.
 
Back
Top