I just did this (and things appear to be working well) so I thought I would share. Feel free to provide critical feedback.
Also full disclosure I did get hints on this from Proxmox support but they couldn't provide assistance as I don't have that kind of license (but the hints they gave were invaluable). Just wanted to call out how awesome that was. Buy a license if you are able, it's worth supporting this project.
This is all provided informationally, so I encourage you to research the commands and what they do before executing them (aka, no warranty here ).
First of all for purposes of this we are assuming the following drives:
And that the new drive is
First we are going to copy the partition table from one of the drives currently in the Pool to the new drive.
Format:
Example:
Now we need to randomize the GUID of the new drive, this is important as if we don't do this both drives from the sgdisk command will have the same GUID. Also be very careful of the target for this command as if you overwrite the GUID of a drive currently in your RAID your results would be... poor.
Format:
Example:
Next we probably want to make the new disk bootable.
Format:
Example:
If you want to boot with UEFI sometime in the future, we need to do these steps, might as well:
Format:
Format:
Example:
Example:
Now we need to add the new drive to our Btrfs pool.
Format:
Example:
Now that our drive is added we need to rebalance the data. Read below before running this as if you want to balance your metadata differently there is another command you should use.
Format:
Example:
You can watch the status of the balance in a separate shell window via:
Format:
Example:
Now here is where we can get fancy assuming you have multiple drives and have your pool in RAID10. We can change the way metadata is spread across the drives. You can run this instead of the command directly above or run it after. For the example here we have 5 drives so I selected raid1c4 for the metadata.
Format:
Example:
Thats all I have, hope it helps someone. I am sure there are things that could be done better so feel free to call them out.
Also full disclosure I did get hints on this from Proxmox support but they couldn't provide assistance as I don't have that kind of license (but the hints they gave were invaluable). Just wanted to call out how awesome that was. Buy a license if you are able, it's worth supporting this project.
This is all provided informationally, so I encourage you to research the commands and what they do before executing them (aka, no warranty here ).
First of all for purposes of this we are assuming the following drives:
/dev/sda
/dev/sdb
/dev/sdc
/dev/sdd
And that the new drive is
/dev/sde
First we are going to copy the partition table from one of the drives currently in the Pool to the new drive.
Format:
sgdisk <source> -R <target>
Example:
sgdisk /dev/sda -R /dev/sde
Now we need to randomize the GUID of the new drive, this is important as if we don't do this both drives from the sgdisk command will have the same GUID. Also be very careful of the target for this command as if you overwrite the GUID of a drive currently in your RAID your results would be... poor.
Format:
sgcode -G <target>
Example:
sgcode -G /dev/sde
Next we probably want to make the new disk bootable.
Format:
grub-install <target>
Example:
grub-install /dev/sde
If you want to boot with UEFI sometime in the future, we need to do these steps, might as well:
Format:
proxmox-boot-tool format <new disk and partition>
This will always partition # 2Format:
proxmox-boot-tool init <new disk and partition>
This will always partition # 2Example:
proxmox-boot-tool format /dev/sde2
Example:
proxmox-boot-tool init /dev/sde2
Now we need to add the new drive to our Btrfs pool.
Format:
btrfs device add <new drive and partition> <pool mount point>
Remember because we copied the partition table our Btrfs partition will be # 3Example:
btrfs device add /dev/sde3 /
Now that our drive is added we need to rebalance the data. Read below before running this as if you want to balance your metadata differently there is another command you should use.
Format:
btrfs balance start --full-balance <pool mount point>
Example:
btrfs balance start --full-balance /
You can watch the status of the balance in a separate shell window via:
Format:
btrfs filesystem us -T <pool mount point>
Example:
btrfs filesystem us -T /
Now here is where we can get fancy assuming you have multiple drives and have your pool in RAID10. We can change the way metadata is spread across the drives. You can run this instead of the command directly above or run it after. For the example here we have 5 drives so I selected raid1c4 for the metadata.
Format:
btrfs balance start -mconvert=<raid type> --full-balance <target pool>
Example:
btrfs balance start -mconvert=raid1c4 --full-balance /
Thats all I have, hope it helps someone. I am sure there are things that could be done better so feel free to call them out.
Last edited: