fix: changed documentation language to english
This commit is contained in:
parent
e5eb7fde9f
commit
008b03f979
127
docs/doc-clone-and-restore-coreos.md
Normal file
127
docs/doc-clone-and-restore-coreos.md
Normal file
@ -0,0 +1,127 @@
|
||||
## Working procedure to clone and restore CoreOS disk from OKD Cluster
|
||||
|
||||
### **Step 1 - take a backup**
|
||||
```
|
||||
sudo dd if=/dev/old of=/dev/backup status=progress
|
||||
```
|
||||
|
||||
### **Step 2 - clone beginning of old disk to new**
|
||||
```
|
||||
sudo dd if=/dev/old of=/dev/backup status=progress count=1000Mib
|
||||
```
|
||||
|
||||
### **Step 3 - verify and modify disk partitions**
|
||||
list disk partitions
|
||||
```
|
||||
sgdisk -p /dev/new
|
||||
```
|
||||
if new disk is smaller than old disk and there is space on the xfs partition of the old disk, modify partitions of new disk
|
||||
```
|
||||
gdisk /dev/new
|
||||
```
|
||||
inside of gdisk commands
|
||||
```
|
||||
-v -> verify table
|
||||
-p -> print table
|
||||
-d -> select partition to delete partition
|
||||
-n -> recreate partition with same partition number as deleted partition
|
||||
```
|
||||
For end sector, either specify the new end or just press Enter for maximum available
|
||||
When asked about partition type, enter the same type code (it will show the old one)
|
||||
```
|
||||
p - >to verify
|
||||
w -> to write
|
||||
```
|
||||
make xfs file system for new partition <new4>
|
||||
```
|
||||
sudo mkfs.xfs -f /dev/new4
|
||||
```
|
||||
|
||||
### **Step 4 - copy old PARTUUID **
|
||||
|
||||
**careful here**
|
||||
get old patuuid:
|
||||
```
|
||||
sgdisk -i <partition_number> /dev/old_disk # Note the "Partition unique GUID"
|
||||
```
|
||||
get labels
|
||||
```
|
||||
sgdisk -p /dev/old_disk # Shows partition names in the table
|
||||
|
||||
blkid /dev/old_disk* # Shows PARTUUIDs and labels for all partitions
|
||||
```
|
||||
set it on new disk
|
||||
```
|
||||
sgdisk -u <partition_number>:<old_partuuid> /dev/sdc
|
||||
```
|
||||
partition name:
|
||||
```
|
||||
sgdisk -c <partition_number>:"<old_name>" /dev/sdc
|
||||
```
|
||||
verify all:
|
||||
```
|
||||
lsblk -o NAME,SIZE,PARTUUID,PARTLABEL /dev/old_disk
|
||||
```
|
||||
|
||||
### **Step 5 - Mount disks and copy files from old to new disk**
|
||||
|
||||
mount files before copy:
|
||||
|
||||
```
|
||||
mkdir -p /mnt/new
|
||||
mkdir -p /mnt/old
|
||||
mount /dev/old4 /mnt/old
|
||||
mount /dev/new4 /mnt/new
|
||||
```
|
||||
copy:
|
||||
```
|
||||
rsync -aAXHv --numeric-ids /source/ /destination/
|
||||
```
|
||||
|
||||
### **Step 6 - Set correct UUID for new partition 4**
|
||||
to set correct uuid for partition 4
|
||||
```
|
||||
blkid /dev/old4
|
||||
```
|
||||
```
|
||||
xfs_admin -U <old_uuid> /dev/new_partition
|
||||
```
|
||||
to set labels
|
||||
get it
|
||||
```
|
||||
sgdisk -i 4 /dev/sda | grep "Partition name"
|
||||
```
|
||||
set it
|
||||
```
|
||||
sgdisk -c 4:"<label_name>" /dev/sdc
|
||||
|
||||
or
|
||||
|
||||
(check existing with xfs_admin -l /dev/old_partition)
|
||||
Use xfs_admin -L <label> /dev/new_partition
|
||||
```
|
||||
|
||||
### **Step 7 - Verify**
|
||||
|
||||
verify everything:
|
||||
```
|
||||
sgdisk -p /dev/sda # Old disk
|
||||
sgdisk -p /dev/sdc # New disk
|
||||
```
|
||||
```
|
||||
lsblk -o NAME,SIZE,PARTUUID,PARTLABEL /dev/sda
|
||||
lsblk -o NAME,SIZE,PARTUUID,PARTLABEL /dev/sdc
|
||||
```
|
||||
```
|
||||
blkid /dev/sda* | grep UUID=
|
||||
blkid /dev/sdc* | grep UUID=
|
||||
```
|
||||
|
||||
## **Step 8 - Unmount devices and Finalize job**
|
||||
unmount old devices
|
||||
```
|
||||
umount /mnt/new
|
||||
umount /mnt/old
|
||||
```
|
||||
|
||||
shutdown swap disk and verify it worked
|
||||
@ -1,117 +0,0 @@
|
||||
1. ### **Procédure de clonage et de restauration d’un disque CoreOS / Fedora OKD**
|
||||
Ce processus décrit les étapes pour copier un disque système défectueux sur un nouveau disque d’entreprise, en conservant les **GUID**, **labels**, et **UUID** d’origine pour assurer la compatibilité avec le système CoreOS/OKD.
|
||||
|
||||
1. ### **Étape 1 — Sauvegarde initiale**
|
||||
Avant toute manipulation, **sauvegardez vos données**.\
|
||||
Ensuite, clonez le disque d’origine vers le nouveau :
|
||||
|
||||
sudo dd if=/dev/old of=/dev/new bs=64K status=progress count=1000Mib
|
||||
|
||||
1. ### **Étape 2 — Vérification et modification des partitions**
|
||||
Afficher la table des partitions du nouveau disque :
|
||||
|
||||
sgdisk -p /dev/new
|
||||
|
||||
Modifier les partitions (si nécessaire) :
|
||||
|
||||
gdisk /dev/new
|
||||
|
||||
Dans gdisk, utiliser :
|
||||
|
||||
- v → vérifier la table
|
||||
- p → afficher la table
|
||||
- d → supprimer une partition
|
||||
- n → recréer la partition (même numéro et type)
|
||||
- Pour le **secteur de fin**, appuyer sur **Entrée** pour utiliser l’espace maximal.
|
||||
- w → écrire les changements
|
||||
|
||||
Créer le système de fichiers XFS sur la nouvelle partition (ex. partition 4) :
|
||||
|
||||
sudo mkfs.xfs -f /dev/new4
|
||||
|
||||
1. ### **Étape 3 — Récupération des identifiants de l’ancien disque**
|
||||
Obtenir le **GUID de partition** d’origine :
|
||||
|
||||
sgdisk -i <numéro\_partition> /dev/old\_disk
|
||||
|
||||
Lister les labels et les PARTUUIDs :
|
||||
|
||||
sgdisk -p /dev/old\_disk
|
||||
|
||||
blkid /dev/old\_disk\*
|
||||
|
||||
1. ### **Étape 4 — Appliquer les anciens identifiants sur le nouveau disque**
|
||||
Définir le même **PARTUUID** :
|
||||
|
||||
sgdisk -u <numéro\_partition>:<old\_partuuid> /dev/new
|
||||
|
||||
Définir le même **nom de partition** :
|
||||
|
||||
sgdisk -c <numéro\_partition>:"<old\_label>" /dev/new
|
||||
|
||||
Vérifier :
|
||||
|
||||
lsblk -o NAME,SIZE,PARTUUID,PARTLABEL /dev/old\_disk
|
||||
|
||||
lsblk -o NAME,SIZE,PARTUUID,PARTLABEL /dev/new
|
||||
|
||||
1. ### **Étape 5 — Copier les données**
|
||||
Monter les partitions avant la copie :
|
||||
|
||||
mkdir -p /mnt/old /mnt/new
|
||||
|
||||
mount /dev/old4 /mnt/old
|
||||
|
||||
mount /dev/new4 /mnt/new
|
||||
|
||||
Copier les données :
|
||||
|
||||
rsync -aAXHv --numeric-ids /mnt/old/ /mnt/new/
|
||||
|
||||
1. ### **Étape 6 — Restaurer UUID et labels**
|
||||
Obtenir l’ancien UUID :
|
||||
|
||||
blkid /dev/old4
|
||||
|
||||
Le définir sur la nouvelle partition :
|
||||
|
||||
sudo xfs\_admin -U <old\_uuid> /dev/new4
|
||||
|
||||
Vérifier et copier le **label** :
|
||||
|
||||
sgdisk -i 4 /dev/old\_disk | grep "Partition name"
|
||||
|
||||
sudo xfs\_admin -L <label\_name> /dev/new4
|
||||
|
||||
1. ### **Étape 7 — Validation**
|
||||
Comparer les deux disques :
|
||||
|
||||
sgdisk -p /dev/old\_disk
|
||||
|
||||
sgdisk -p /dev/new
|
||||
|
||||
lsblk -o NAME,SIZE,PARTUUID,PARTLABEL /dev/old\_disk
|
||||
|
||||
lsblk -o NAME,SIZE,PARTUUID,PARTLABEL /dev/new
|
||||
|
||||
blkid /dev/old\_disk\* | grep UUID=
|
||||
|
||||
blkid /dev/new\* | grep UUID=
|
||||
|
||||
1. ### **Étape 8 — Finalisation**
|
||||
Démonter les partitions :
|
||||
|
||||
umount /mnt/new
|
||||
|
||||
umount /mnt/old
|
||||
|
||||
Éteindre, **échanger les disques**, et vérifier le démarrage :
|
||||
|
||||
1. Éteindre la machine.
|
||||
1. Retirer le disque défectueux.
|
||||
1. Définir le nouveau disque comme disque de démarrage principal dans le BIOS.
|
||||
1. Redémarrer et confirmer que le système démarre correctement.
|
||||
|
||||
**Résultat attendu :**\
|
||||
Le nouveau disque est une copie fonctionnelle de l’ancien, avec partitions, labels, et UUID identiques. Aucun réajustement GRUB ni réinstallation n’est nécessaire pour Fedora CoreOS/OKD.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user