[SOLVED] Making rpool mirrored if it was not already

KAMALA

Member
Jan 15, 2021
37
2
13
39
Hello everyone,

I am wondering how to make "rpool" mirrored of a PVE which is not mirrored ? the hypervisor has been installed / prepared on RAID 0 now I want to mirror it.

Is it possbile to mirror it? if yes could you please help me know how that can be done?

Thanks
Yaseen
 
Last edited:
Hello everyone,

I am wondering how to make "rpool" mirrored of a PVE which is not mirrored ? the hypervisor has been installed / prepared on RAID 0 now I want to mirror it.

Is it possbile to mirror it? if yes could you please help me know how that can be done?

Thanks
Yaseen
Is this possible or not? Could you please help me with that ?

Thank you so much in advance for your help
 
Last edited:
It's almost the same as replacing a second drive in a mirror (and there are already many threads about this). Open the manual ( https://pve.proxmox.com/pve-docs/pve-admin-guide.html#chapter_zfs ) and go to section "Changing a failed bootable device".


My "rpool" is already got 2 1Tb disks and it's not mirroring (accedently I made a mistake :( and I do not want re-install it from zero) I just want to create the mirror!

1728588149358.png

How creating a mirror can be the same as replacing a failed disk?

I do not have anything to replace!

Thanks for your help and patince :)
 
  • Like
Reactions: KAMALA
Recent ZFS versions can remove one of the vdevs: https://openzfs.github.io/openzfs-docs/man/master/8/zpool-remove.8.html . And then attach the same /dev/disk/by-id/ata-....-part3 as a mirror: https://openzfs.github.io/openzfs-docs/man/master/8/zpool-attach.8.html .

That is great I am try to test withina VM:

I have to a VM with 2 disk

rpool - RAID0:
sda
sdb

removed "sdb" by executing "
Code:
zpool remove rpool sdb
"

now I only have 1 disk in the VM and still working fine and formated "sdb"

1728683635733.png

when I try to attach the disk to the rpool it's not working and when I mirror to the command I got that error message

1728683810789.png
too many arguments

1728683868738.png


Could you please help me to know what is the command I should use to attach the disk to the pool again as mirror or the steps please.


Thank you so much for your help
 
when I try to attach the disk to the rpool it's not working and when I mirror to the command I got that error message

View attachment 76117
too many arguments

View attachment 76118


Could you please help me to know what is the command I should use to attach the disk to the pool again as mirror or the steps please.
zpool attach rpool /dev/sda3 /dev/sdb but it's better to use /dev/disk/by-id/... instead. Also, since it is the rpool but should partition the drive and use the steps in Changing a failed bootable device in the Proxmox manual: https://pve.proxmox.com/pve-docs/pve-admin-guide.html#sysadmin_zfs_change_failed_dev
 
  • Like
Reactions: KAMALA
Within your testvm you have first to cp the partion table before zpool attach rpool /dev/sda3 /dev/sdb3 !!
 
zpool attach rpool /dev/sda3 /dev/sdb but it's better to use /dev/disk/by-id/... instead. Also, since it is the rpool but should partition the drive and use the steps in Changing a failed bootable device in the Proxmox manual: https://pve.proxmox.com/pve-docs/pve-admin-guide.html#sysadmin_zfs_change_failed_dev
Copied the partion table for sda into sdb

1728723001322.png

then I tried the attach command but iI reallt did not work :(

1728722929614.png

I really appreciate your help, any idea why? or what to do?

Thanks agin for your great help
 
Try without ashift as it's already set with creation and cannot set again.
zpool attach -f rpool /dev/sda3 /dev/sdb3
 
Last edited:
  • Like
Reactions: KAMALA
sdb shows path /dev/sda.
.../by-id doesn't show the 2 disks also, maybe due to your virtual testing.
zpool status ?
 

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!