System Management

A disk backing the volume group vg_data is reporting errors. The administrator has installed a new disk, /dev/sdc1, which is not yet initialized for LVM, and must replace the failing PV /dev/sdb1 without unmounting any logical volumes. Which sequence of commands completes the replacement correctly?

Show the answer

Correct answerD. pvcreate /dev/sdc1; vgextend vg_data /dev/sdc1; pvmove /dev/sdb1; vgreduce vg_data /dev/sdb1; pvremove /dev/sdb1

The new PV must join vg_data first so pvmove has free extents to receive the data, and only then can the emptied old PV be removed from the group and wiped. Running vgreduce before pvmove fails because the old PV still holds allocated extents.