Creo un raid 5 con 3 dischi da 512M e ci credo sopra un filesystem ext4.
Poi spengo la macchina e la faccio ripartire senza un disco.
Riesco a rimuovere il disco "fallito" con successo.
(Questo per simulare un guasto hardware ad un disco).
Spengo nuovamente la macchina e aggiungo un nuovo disco di pari dimensioni.
Lo aggiungo nel volume group...ma noto che il disco virtuale non aumenta e che quindi non sta sincronizzando i dati.
Quello che non riesco a trovare è:
- Un comando che mi faccia capire se un volume logico è ridondato o meno
(da lvdisplay non vedo questa informazione) - Un comando per far partire la sincronizzazione
(lvchange --raidsyncaction check|repair non sembra avere effetto) - Un comando per monitorare la sincronizzazione
(lvs mostra sempre 100%)
Codice: Seleziona tutto
(lato guest)
pvcreate /dev/vd[bcd]
vgcreate vg00 /dev/vd[bcd]
lvcreate -n test --type raid5 --stripes 2 -l 100%FREE vg00
mkfs.ext4 /dev/vg00/test
mount /dev/vg00/test /mnt/test
dd if=/dev/zero of=/mnt/test/c bs=1M count=100
(Lato host)
ls -lh jessie_lvm*
-rw-r--r-- 1 root root 67M ott 17 19:27 jessie_lvm1.qcow2
-rw-r--r-- 1 root root 67M ott 17 18:57 jessie_lvm2.qcow2
-rw-r--r-- 1 root root 67M ott 17 19:27 jessie_lvm3.qcow2
-rw-r--r-- 1 valerio valerio 4,0G ott 17 19:30 jessie_lvm.raw
(lato guest)
lvdisplay
--- Logical volume ---
LV Path /dev/vg00/test
LV Name test
VG Name vg00
LV UUID d0hWRd-Ovif-i0lq-alei-HsIF-1ytn-N8pirW
LV Write Access read/write
LV Creation host, time debian, 2016-10-17 18:49:23 +0200
LV Status available
# open 0
LV Size 1008,00 MiB
Current LE 252
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 768
Block device 253:8
(lato host)
faccio partire la vm senza il secondo disco
(lato guest)
pvscan
Couldn't find device with uuid UOvuJv-VlhL-1jdb-Jv19-cMpc-13M3-AqMU7w.
PV /dev/vdb VG vg00 lvm2 [508,00 MiB / 0 free]
PV unknown device VG vg00 lvm2 [508,00 MiB / 0 free]
PV /dev/vdc VG vg00 lvm2 [508,00 MiB / 0 free]
Total: 3 [1,49 GiB] / in use: 3 [1,49 GiB] / in no VG: 0 [0 ]
lvs
Couldn't find device with uuid UOvuJv-VlhL-1jdb-Jv19-cMpc-13M3-AqMU7w.
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
test vg00 rwi-a-r-p- 1008,00m 100,00
vgreduce --removemissing vg00 --force
(lato host)
creo un nuovo disco virtuale jessie_lvm4.qcow2 e lo aggiungo alla vm
(lato guest)
pvcreate /dev/vdd
Physical volume "/dev/vdd" successfully created
vgextend vg00 /dev/vdd
Volume group "vg00" successfully extended
pvscan
PV /dev/vdb VG vg00 lvm2 [508,00 MiB / 0 free]
PV /dev/vdc VG vg00 lvm2 [508,00 MiB / 0 free]
PV /dev/vdd VG vg00 lvm2 [508,00 MiB / 508,00 MiB free]
Total: 3 [1,49 GiB] / in use: 3 [1,49 GiB] / in no VG: 0 [0 ]
(Lato host)
ls -lh jessie_lvm*
-rw-r--r-- 1 root root 67M ott 17 19:27 jessie_lvm1.qcow2
-rw-r--r-- 1 root root 67M ott 17 18:57 jessie_lvm2.qcow2
-rw-r--r-- 1 root root 67M ott 17 19:27 jessie_lvm3.qcow2
-rw-r--r-- 1 root root 384K ott 17 19:15 jessie_lvm4.qcow2
-rw-r--r-- 1 valerio valerio 4,0G ott 17 19:30 jessie_lvm.raw
