welcome:proxmox:replace_disks
Replacing disks on Proxmox
Difficulté

Très facile
- Locate the failing disk / the disk you want to replace:
# zpool status -v
. In this exemple, we want to replace disk “sdb”
- Detach the disk from the pool:
# zpool detach rpool sdb2
, shutdown the Proxmox, replace physically the disk and start the machine
If there is a problem “no such device in pool”, we must find the ID of the disk:
- stop all VMs using the_pool (if needed stop NFS too)
- export the pool
# zpool export the_pool
- reimport the pool by taking the disks by their ID
# zpool import -d /dev/disk/by-id/ the_pool
# zpool status -v
should show the ID of the disks instead of sdX
- Create the partitions - depending if you replace the failing disk through a disk with the same size or through a “bigger” one:
- For a similar disk: copy the partition table from /dev/sda to /dev/sdb:
# sgdisk --replicate=/dev/sdb /dev/sda
- For a “bigger” disk: delete its partition table and create a new one:
# sgdisk -Z /dev/sdb # sgdisk -a1 -n1:34:2047 -t1:EF02 -n9:-8M:0 -t9:BF07 -n2:2048:0 -t2:BF01 -c 2:zfs /dev/sdb
- Ensure the GUIDs are randomized:
# sgdisk --randomize-guids /dev/sdb The operation has completed successfully.
- Install the Grub on the new disk:
grub-install /dev/sdb
- Attach the nex disk to the pool:
# zpool attach -f rpool sda2 /dev/sdb2
- Let the resilvering function run:
# zpool status -v
welcome/proxmox/replace_disks.txt · Dernière modification : de 127.0.0.1