How to copy zvol to new pool?

orztrickster

Cadet
Joined
Jun 6, 2022
Messages
7
Because my pool has some failures, I can only import it with the command zpool import -f -o readonly=on
and use rsync to copy my data to the new pool
But rsync seems to have no way to copy zvol. The method I see is to create a snapshot and then use zfs send and zfs recv to copy zvol to the new pool
But because it is readonly, I can't create a snapshot
Is there any other way to copy zvol to new pool
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
zfs send oldpool/path/to/zvol | zfs receive newpool/path/to/zvol

With zvols you do not need to take an explicit snapshot, the above commands will do that on the fly.
 
Top