Binnen LVM kan je bestaande logische volumes verplaatsen naar een ander fysiek volume. Met pvmove doen we dit per PV ineens.
root@evenstar { ~ }$ pvmove /dev/sdc1 /dev/sde1
/dev/sdc1: Moved: 0.0%
/dev/sdc1: Moved: 2.5%
/dev/sdc1: Moved: 3.2%
/dev/sdc1: Moved: 7.3%
/dev/sdc1: Moved: 11.0%
/dev/sdc1: Moved: 13.8%
/dev/sdc1: Moved: 17.5%
/dev/sdc1: Moved: 21.4%
/dev/sdc1: Moved: 25.4%
/dev/sdc1: Moved: 29.0%
/dev/sdc1: Moved: 32.5%
/dev/sdc1: Moved: 36.2%
/dev/sdc1: Moved: 37.3%
/dev/sdc1: Moved: 41.5%
/dev/sdc1: Moved: 45.5%
/dev/sdc1: Moved: 49.5%
/dev/sdc1: Moved: 53.9%
/dev/sdc1: Moved: 57.9%
/dev/sdc1: Moved: 62.0%
/dev/sdc1: Moved: 66.1%
/dev/sdc1: Moved: 70.1%
/dev/sdc1: Moved: 74.0%
/dev/sdc1: Moved: 74.6%
/dev/sdc1: Moved: 78.3%
/dev/sdc1: Moved: 82.0%
/dev/sdc1: Moved: 86.0%
/dev/sdc1: Moved: 89.9%
/dev/sdc1: Moved: 93.8%
/dev/sdc1: Moved: 95.3%
/dev/sdc1: Moved: 96.6%
/dev/sdc1: Moved: 100.0%
root@evenstar { ~ }$ pvs
PV VG Fmt Attr PSize PFree
/dev/md1 storage lvm2 a-- 2.73t 0
/dev/sdc1 debian lvm2 a-- 37.27g 37.27g
/dev/sdd1 debian lvm2 a-- 111.79g 57.56g
/dev/sde1 debian lvm2 a-- 74.53g 11.82g
root@evenstar { ~ }$ vgreduce debian /dev/sdc1
Removed "/dev/sdc1" from volume group "debian"
root@evenstar { ~ }$ pvs
PV VG Fmt Attr PSize PFree
/dev/md1 storage lvm2 a-- 2.73t 0
/dev/sdc1 lvm2 --- 37.27g 37.27g
/dev/sdd1 debian lvm2 a-- 111.79g 57.56g
/dev/sde1 debian lvm2 a-- 74.53g 11.82g
root@evenstar { ~ }$ pvremove /dev/sdc1
Labels on physical volume "/dev/sdc1" successfully wiped
root@evenstar { ~ }$ pvs
PV VG Fmt Attr PSize PFree
/dev/md1 storage lvm2 a-- 2.73t 0
/dev/sdd1 debian lvm2 a-- 111.79g 57.56g
/dev/sde1 debian lvm2 a-- 74.53g 11.82g
root@evenstar { /boot }$ grub-install /dev/sde
Installing for i386-pc platform.
Installation finished. No error reported.
root@evenstar { /boot }$ update-grub
Generating grub configuration file …
Found linux image: /boot/vmlinuz-3.16.0-10-amd64
Found initrd image: /boot/initrd.img-3.16.0-10-amd64
Found memtest86 image: /boot/memtest86.bin
Found memtest86+ image: /boot/memtest86+.bin
Found memtest86+ multiboot image: /boot/memtest86+_multiboot.bin
rmdir: failed to remove ‘/var/lib/os-prober/mount’: Device or resource busy
rmdir: failed to remove ‘/var/lib/os-prober/mount’: Device or resource busy
rmdir: failed to remove ‘/var/lib/os-prober/mount’: Device or resource busy
rmdir: failed to remove ‘/var/lib/os-prober/mount’: Device or resource busy
rmdir: failed to remove ‘/var/lib/os-prober/mount’: Device or resource busy
/usr/sbin/grub-probe: error: unknown filesystem.
Found Debian GNU/Linux (8.11) on /dev/mapper/debian-root_snapshot--2020--01--07
/usr/sbin/grub-probe: error: unknown filesystem.
/usr/sbin/grub-probe: error: unknown filesystem.
Found Debian GNU/Linux (8.11) on /dev/mapper/debian-root_snapshot--2020--01--08
/usr/sbin/grub-probe: error: unknown filesystem.
done
root@evenstar { /boot }$ poweroff
root@evenstar { /boot }$ pvs
PV VG Fmt Attr PSize PFree
/dev/md1 storage lvm2 a-- 2.73t 0
/dev/sdd1 debian lvm2 a-- 111.79g 57.56g
/dev/sde1 debian lvm2 a-- 74.53g 11.82g
root@evenstar { ~ }$ pvs
PV VG Fmt Attr PSize PFree
/dev/md1 storage lvm2 a-- 2.73t 0
/dev/sda1 debian lvm2 a-- 74.53g 11.82g
/dev/sdb1 debian lvm2 a-- 111.79g 57.56g