Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

With a setup with two disk is there a way to migrate from software RAID1 to ZFS mirror ?

This kind of procedure would be inspired by the migration that is possible from a disk stored on a single drive to software RAID1 : setup the software RAID in degraded mode with a missing drive, copy the data, add the first drive to the array.

zpool create -f -m /data data mirror /dev/sdb 
invalid vdev specification: mirror requires at least 2 devices

Does anyone know a way of doing this ? With a fake device that writes to null ? Can ZFS change a device from "normal" to "mirror" ?

share|improve this question
add comment

1 Answer 1

up vote 4 down vote accepted

You would create a single disk device, not a mirror. Then attach a second disk to the first disk; ZFS will automatically know it has to create a Mirror VDEV for you.

zpool create -m /data data /dev/sdb
tar cf - /old/path | tar xfC - /new/path
zpool attach data /dev/sdb /dev/sdc

insert standard warning about only having a single disk with valid data during this process and intentionally stressing the disks by copy massive amounts of data - backup, backup, backups

Side note: never, never, never use the -f argument unless some ZFS Demigod Guru instructs you to do so. I guarantee 99% of the time you don't want to force it and the other 1% of the time you'll end up destroying something.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.