Proxmox migrate ZFS Pool to new drives

by RamWise
687 views

ZFS is one of the best file systems available in almost all of the Linux distributions. Proxmox VE is built on Debian Linux and it supports ZFS backend for VM and container storage. This tutorial will help you migrate your existing ZFS pool to a new set of hard drives. Recently I cam across this use case in my home system to upgrade my drives to higher capacity. 

If you would like to start by creating  ZFS pool in Proxmox VE instead go to my post here. You can continue back here to migrate that a ZFS pool after that.

1. Let’s say for example I am using a zpool named tank in my Proxmox server for VM storage.

2. Install the new hard drives and create a new temporary ZFS pool for copying. I am creating one named temp_tank (this will be renamed to tank later). Now you will have two ZFS pools on your server.

3. To prepare for copying to the temp pool first create a snapshot of the tank. The below command creates new snapshot named to_copy in the tank zpool.

zfs snapshot tank@to_copy 

4. Using the zfs send command send the snapshot to our new temp_tank pool.

zfs send -R tank@to_copy | zfs receive -F temp_tank 

5. Once the above completes, unmout the tank pool using zpool export command and remove the drives from your server. (Store the old drives safely so that you can use it to restore in case anything goes wrong)

zpool export tank 

Now you will see only the temp_tank pool in the system

6. Now we just need to rename this temp_tank pool to tank, to complete the migration. To rename a pool we again have to use zfs export, then zfs import it with a new name.

zpool export temp_tank 

and then,

zpool import temp_tank tank 

   To verify go to the web UI, under Disks -> ZFS . The migrated pool tank is ONLINE and healthy.

That is it, you have successfully upgraded the hard drives.

Leave a Comment

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More