« Remplacement d'un disque système ZFS sous Proxmox » : différence entre les versions

De www.yakakliker.org
Aucun résumé des modifications
Ligne 11 : Ligne 11 :
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
sgdisk /dev/sdb -R /dev/sda
sgdisk /dev/sdb -R /dev/sda
</syntaxhighlight>''# sgdisk -G <new device>''<blockquote>sgdisk -G /dev/sda</blockquote>
</syntaxhighlight>


* Identification du disque :
   ls /dev/disk/by-id


''# sgdisk -G <new device>''<syntaxhighlight lang="bash">
sgdisk -G /dev/sda
</syntaxhighlight>
* Identification du disque
<syntaxhighlight lang="bash">
ls /dev/disk/by-id
</syntaxhighlight>
* Remplacement de l'ancien disque dans le pool ZFS
* Remplacement de l'ancien disque dans le pool ZFS


''# zpool replace -f <pool> <old zfs partition> <new zfs partition>''<blockquote>zpool replace -f rpool "oldpartition" /dev/sda3</blockquote>ou<blockquote>zpool replace -f rpool "oldpartition" /dev/disk/by-id/"ID du Disque" </blockquote>
''# zpool replace -f <pool> <old zfs partition> <new zfs partition>''<syntaxhighlight lang="bash">
 
zpool replace -f rpool "oldpartition" /dev/sda3
</syntaxhighlight>ou<syntaxhighlight lang="bash">
zpool replace -f rpool "oldpartition" /dev/disk/by-id/"ID du Disque"
</syntaxhighlight>
* Etat du pool ZFS
* Etat du pool ZFS
 
<syntaxhighlight lang="bash">
<blockquote>zpool status</blockquote>
zpool status
 
</syntaxhighlight>
* Vérification des partitions sur le nouveau disque
* Vérification des partitions sur le nouveau disque
<syntaxhighlight lang="bash">
fdisk /dev/sda >> p
</syntaxhighlight>


<blockquote>fdisk /dev/sda >> p</blockquote>


* Création de la zone d'amorce sur le nouveau disque
* Création de la zone d'amorce sur le nouveau disque


''# proxmox-boot-tool format <new disk's ESP>''<blockquote>proxmox-boot-tool format /dev/sda2</blockquote>ou <blockquote>proxmox-boot-tool format /dev/disk/by-id/"ID du Disque" </blockquote>
''# proxmox-boot-tool format <new disk's ESP>''<syntaxhighlight lang="bash">
 
proxmox-boot-tool format /dev/sda2
</syntaxhighlight>ou <syntaxhighlight lang="bash">
proxmox-boot-tool format /dev/disk/by-id/"ID du Disque"
</syntaxhighlight>


''# proxmox-boot-tool init <new disk's ESP>''<blockquote>proxmox-boot-tool init /dev/sda2</blockquote>ou <blockquote>proxmox-boot-tool init /dev/disk/by-id/"ID du Disque"</blockquote>
''# proxmox-boot-tool init <new disk's ESP>''<syntaxhighlight lang="bash">
proxmox-boot-tool init /dev/sda2
</syntaxhighlight>ou <syntaxhighlight lang="bash">
proxmox-boot-tool init /dev/disk/by-id/"ID du Disque"
</syntaxhighlight>

Version du 9 mars 2024 à 16:29

Exemple : le disque /dev/sda est HS

  • Etat du pool ZFS
zpool status
  • Préparation des partitions ZFS sur le nouveau disque

# sgdisk <healthy bootable device> -R <new device>

sgdisk /dev/sdb -R /dev/sda


# sgdisk -G <new device>

sgdisk -G /dev/sda
  • Identification du disque
ls /dev/disk/by-id
  • Remplacement de l'ancien disque dans le pool ZFS

# zpool replace -f <pool> <old zfs partition> <new zfs partition>

zpool replace -f rpool "oldpartition" /dev/sda3

ou

zpool replace -f rpool "oldpartition" /dev/disk/by-id/"ID du Disque"
  • Etat du pool ZFS
zpool status
  • Vérification des partitions sur le nouveau disque
fdisk /dev/sda >> p


  • Création de la zone d'amorce sur le nouveau disque

# proxmox-boot-tool format <new disk's ESP>

proxmox-boot-tool format /dev/sda2

ou

proxmox-boot-tool format /dev/disk/by-id/"ID du Disque"

# proxmox-boot-tool init <new disk's ESP>

proxmox-boot-tool init /dev/sda2

ou

proxmox-boot-tool init /dev/disk/by-id/"ID du Disque"