Professional Documents
Culture Documents
# cat /proc/mdstat
Personalities : [raid1]
4. Shutdown machine.
5. Replace /dev/sda and bring the machine back up.
6. Copy partitioning structure from /dev/sdb to /dev/sda:
The partitions started to mirror. /dev/md0 mirrored OK but /dev/md1 did not. So we embark
on the partition resizing…
8. Check how much you need to reduce the size of the partitions by with fdisk -l:
# fdisk -l /dev/sd?
9. We check that there is free space in the PV with pvdisplay:
# pvdisplay
PV Name /dev/md1
VG Name rootvg
PV Size
Allocatable yes
PE Size (KByte)
Total PE
Free PE
Allocated PE
PV UUID
VG Size
PE Size
Alloc PE / Size
Free PE / Size
10. There is free space so we can start by resizing the LVM PV (/dev/md1 in this case).:
12. The next step is to reduce the size of the underlying RAID1 mirror. First, we Check the size:
Array Size :
. Despitethe fact we are shrinking the device, we still use the --grow switch:
Array Size :
# fdisk /dev/sda
.
Syncing disks.
19.
20.
# cat /proc/mdstat
Personalities : [raid1]
# pvcreate /dev/md1
# pvmove -v /dev/sdb2
# pvdisplay
PV Name /dev/sdb2
VG Name rootvg
PV Size
Allocatable yes
PE Size (KByte)
Total PE
Free PE
Allocated PE
PV UUID
--- Physical volume ---
PV Name /dev/md1
VG Name rootvg
PV Size
Allocatable
PE Size (KByte)
Total PE
Free PE
Allocated PE
PV UUID
27. They have, so now we can remove and delete the PV /dev/sda3:
# cat /proc/mdstat
Personalities : [raid1]
[2/2] [UU]
md1 : active raid1 sda3[2] sda2[0]
# grub