i run some checks for you on the proxmox ve server, Version 9.0.6.
create some file based drives
Code:#!/bin/bash # drivea for n in 0 1 2 3 4 5; do fallocate --length 1GB drivea$n done # driveb for n in 0 1 2 3 4 5; do fallocate --length 1GB driveb$n done
Create a new zfs pool datapool:
Code:zpool create -o ashift=12 datapool raidz2 /rpool/test/drivea0 /rpool/test/drivea1 /rpool/test/drivea2 /rpool/test/drivea3 /rpool/test/drivea4 /rpool/test/drivea5
check the pool datapool:
Code:$ zpool status datapool # report pool: datapool state: ONLINE config: NAME STATE READ WRITE CKSUM datapool ONLINE 0 0 0 raidz2-0 ONLINE 0 0 0 /rpool/test/drivea0 ONLINE 0 0 0 /rpool/test/drivea1 ONLINE 0 0 0 /rpool/test/drivea2 ONLINE 0 0 0 /rpool/test/drivea3 ONLINE 0 0 0 /rpool/test/drivea4 ONLINE 0 0 0 /rpool/test/drivea5 ONLINE 0 0 0 # $ zpool list datapool -v # report NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT datapool 5.50G 1.30M 5.50G - - 0% 0% 1.00x ONLINE - raidz2-0 5.50G 1.30M 5.50G - - 0% 0.02% - ONLINE /rpool/test/drivea0 954M - - - - - - - ONLINE /rpool/test/drivea1 954M - - - - - - - ONLINE /rpool/test/drivea2 954M - - - - - - - ONLINE /rpool/test/drivea3 954M - - - - - - - ONLINE /rpool/test/drivea4 954M - - - - - - - ONLINE /rpool/test/drivea5 954M - - - - - - - ONLINE
Expand the pool datapool:
Code:# add a new vdev zfs raidz2 with 6 drives zpool add datapool raidz2 /rpool/test/driveb0 /rpool/test/driveb1 /rpool/test/driveb2 /rpool/test/driveb3 /rpool/test/driveb4 /rpool/test/driveb5
Code:$ zpool status datapool # report pool: datapool state: ONLINE config: NAME STATE READ WRITE CKSUM datapool ONLINE 0 0 0 raidz2-0 ONLINE 0 0 0 /rpool/test/drivea0 ONLINE 0 0 0 /rpool/test/drivea1 ONLINE 0 0 0 /rpool/test/drivea2 ONLINE 0 0 0 /rpool/test/drivea3 ONLINE 0 0 0 /rpool/test/drivea4 ONLINE 0 0 0 /rpool/test/drivea5 ONLINE 0 0 0 raidz2-1 ONLINE 0 0 0 /rpool/test/driveb0 ONLINE 0 0 0 /rpool/test/driveb1 ONLINE 0 0 0 /rpool/test/driveb2 ONLINE 0 0 0 /rpool/test/driveb3 ONLINE 0 0 0 /rpool/test/driveb4 ONLINE 0 0 0 /rpool/test/driveb5 ONLINE 0 0 0 # $ zpool list datapool -v # report NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT datapool 11G 1.79M 11.0G - - 0% 0% 1.00x ONLINE - raidz2-0 5.50G 1.64M 5.50G - - 0% 0.02% - ONLINE /rpool/test/drivea0 954M - - - - - - - ONLINE /rpool/test/drivea1 954M - - - - - - - ONLINE /rpool/test/drivea2 954M - - - - - - - ONLINE /rpool/test/drivea3 954M - - - - - - - ONLINE /rpool/test/drivea4 954M - - - - - - - ONLINE /rpool/test/drivea5 954M - - - - - - - ONLINE raidz2-1 5.50G 156K 5.50G - - 0% 0.00% - ONLINE /rpool/test/driveb0 954M - - - - - - - ONLINE /rpool/test/driveb1 954M - - - - - - - ONLINE /rpool/test/driveb2 954M - - - - - - - ONLINE /rpool/test/driveb3 954M - - - - - - - ONLINE /rpool/test/driveb4 954M - - - - - - - ONLINE /rpool/test/driveb5 954M - - - - - - - ONLINE
Done, it works like i wrote.
> This is main server of company where I work. I have to be sure of what I do
MAKE SURE YOU HAVE BACKUPS.
I'm not sure if you can add +2 drives to an existing RAIDZ2 even with ZFS 2.3, but as @news posted, adding on another RAIDZ2 vdev with the same number of drives (can be same size as existing vdev or larger) has been supported for years.
If you only have +2 drives and not 6, you could create a separate pool and mirror them.
yes, you're right, maybe if I can't understand the various steps perfectly I should destroy the pool and recreate a new one in raid2 with all the disks, including the new onesAnd you example is not right, we touch in the last instance your real file system and if we do some bad things, they can not be reversed. you must have Backups, for all data you must have Backup.
Yes, I know, I just need to understand which commands I need to use in my case.Please read the manual on OpenZFS. I show you some test without any problems to your real System. files will be used to simulate real drives and the Artikel will work with this example commands, at some point you must change some commands for add to discs to zfs raidz2 vdev. These are also only files, each one Gigabyte size.
you add another 6 drives but is it possible to add only 2 as in my case to a raidz2 pool made of 6 drives? For a total of 8# add a new vdev zfs raidz2 with 6 drives zpool add datapool raidz2 /rpool/test/driveb0 /rpool/test/driveb1 /rpool/test/driveb2 /rpool/test/driveb3 /rpool/test/driveb4 /rpool/test/driveb5
IF you read the manual you'll find that it is possible to add a drive (or two, one after another) to an existing RaidZ2 vdev. The search-term is RaidZ-Expansion.Unfortunately, I don't have time to read the manual right now.
man zpool-attach
and there: https://openzfs.org/w/images/5/5e/RAIDZ_Expansion_2023.pdfIF you read the manual you'll find that it is possible to add a drive (or two, one after another) to an existing RaidZ2 vdev. The search-term is RaidZ-Expansion.
This is possible since ZFS version 2.3 and as already mentioned that's the version used in current Proxmox systems.
I won't show the relevant command here - you need to read "the manual" to know what you are doing!
Start here:man zpool-attach
and there: https://openzfs.org/w/images/5/5e/RAIDZ_Expansion_2023.pdf
@dominusdj did you ever run these zfs commands?
zpool trim DataZFS
andzpool scrub DataZFS
What will they do?
I gave you advice in some code for testing the things with zfs, without any possible damage on your system!
So let some do the job, how want to learn some thing more.
Speak to some one how know the system and zfs.
See my post #4 above.
Well, it is exhaustive. And yes, there is more details than you need to know. You may prefer to read @news link in #4.Wow... this PDF is very clear!
How can I add the first dive if my output is this?
man zpool-attach
shows the required command in a very compact way. ls -Al /dev/disk/by-id/
. You'll recognize your "ata-KINGSTON..." and also the new drives.This is no problem, the name convertion can later easy replaced.
please show the full output ofzpool status <pool>
andzpool list -v <pool>
With calllsblk -o+FSTYPE,MODEL
andls -lA /dev/disk/by-id/
you can see there are more names for one real device.
https://github.com/kneutron/ansitest/blob/master/drivemap.shI followed what you told me, but the server keeps saying "pool is busy." I probably need to stop other services manually.
If having a different name for that disk doesn't affect its current and/or future operation, perhaps it's best to avoid the risk and keep it as is.
Do you have any ideas for the abnormal space consumption on the RAIDZ2 pool?
We use essential cookies to make this site work, and optional cookies to enhance your experience.