How to replace pools? copy data or replace disks?

Martini2

Member
Jan 28, 2022
18
0
6
Hello
i need to replace a 'single disk' pool containing two hdds with another one, but with bigger drives. Due to ram shortage i need to remove the hdds of the old pool from the system.
Is it better to make a new 'single disk' pool of the bigger drives, recreate the structure of the old pool and copy everything over or replace a smaller disk with a bigger one in the old pool and have zfs recreate the data? Would this go like degrade and replace a disk in a raid, one at a time? Is there a way to see how the data is distributed among the disks?
 
If your pool has a single disk, you have no choice - you need to copy the data. You should be able to zfs send/zfs receive to transfer the data

If your pool has two drives and they are striped (raid-0) then you will need to copy the data

If your pool is a mirror, you will be able to swap drives and rebuild pool, once both drives have been swapped, the pool will resize
 
If your pool has a single disk, you have no choice - you need to copy the data.
It is possible to attach a new/additional drive to a single drive vdev - creating a mirror on the fly. When it is finished (watch zpool status) the old drive can get offlined+detached to remove it.

@Martini : this probably works on the CLI only...


Please see man zpool-attach
Code:
zpool  attach  yourpool  /dev/disk/by-id/id-of-the-existing-single-drive   /dev/disk/by-id/your-new-drive-id


Best regards
 
Last edited:
  • Like
Reactions: bobmc
my pool has two 8TB drives, no mirror. It's just a bunch of disks. I need to replace them with bigger ones.
Code:
  pool: zpool3
 state: ONLINE
  scan: scrub repaired 0B in 1 days 00:14:28 with 0 errors on Mon Jan 10 00:38:32 2022
config:

        NAME                                 STATE     READ WRITE CKSUM
        zpool3                               ONLINE       0     0     0
          ata-WDC_WD80EFZX-78VU6M1_Q7FMJHBE  ONLINE       0     0     0
          ata-WDC_WD80EFZX-78VU6M1_Q7C1ZBAB  ONLINE       0     0     0

errors: No known data errors
Would it be possible to add a 18TB drive as mirror1, let zfs resilver it, remove the two smaller ones, convert the mirror1 to a single disk and then add a second drive to have the same configuration as at the begining?
 
my pool has two 8TB drives, no mirror. It's just a bunch of disks. I need to replace them with bigger ones.
Well..., that is what I wanted to describe with my post above.

You add temporarily a third drive, duplicating/mirroring one of the "old" ones. Then remove that first old one. Repeat for the second old drive.

At the end you have your two new drives without redundancy as you have now.


Best regards

Btw: I do absolutely NOT recommend to abstain from redundancy. This is one of main positive features of ZFS after all...
 
@UdoB Sorry, i missunderstand your 'single drive vdev' statement. I will try this.

Redundancy would be great but i would need at last two additional 18TB drives and the system is allready at max with its 32GB ram. Arc uses 15,6GB of 15,6GB, and the hit ratio is at 76%. I don't think it can handle more drives.
 
It looks like you have a striped pool - data will be distributed across the drives.

Install the 18TB drive, create a new single disk pool, zfs send/receive old_pool to new_pool, remove the original 8tb drives, if you need redundancy, install a new 18tb and attach to the new pool as a mirror and let zfs resilver data to the new drive.
 
@Dunuin ;) i just have read that. But why is this better than rsync?
Rsync will only work on file level so it can only copy files and folder inside a dataset, but it can't copy datasets themself, nor any zvols or ZFS configs. And you will loose all your snapshots. ZFS send/receive will do all that. If you use zfs send/recv you can get an exact copy of your entire pool.
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!