Linux LVM Replacing 2x146GB with 2x300GB

This instruction is for replacing 2 SAS 15K 146GB disks with 2 SAS 15K 300GB disks.

The server is a Dell PowerEdge R710 running Redhat Enterprise Linux 7.2 (Maipo).

The two 2.5” disks is installed locally on the server.

A external 3.5” USB attached disk with a WD 1TB SATA disk was used as temporary storage.

NOTE The instruction has been tested but leaves no guaranties.


Phase #1 Removing the old 2 146Gb disks

Connect a new USB disk with enough space to hold the data from the 2x146GB disks

In this case a WD 1TB 3.5” disk was used.


Check for the name of the new disk attached with USB

$fdisk -l


Create a temporary new physical volyme on the new disk
NOTE ALL DATA WILL BE LOST ON THE NEW DISK!!

$pvcreate /dev/sdd1


Extend the Volume Group where the old disks are with the new temporary physical volume created on the new disk

$vgextend rhel /dev/sdd1


Verify the the new temporary physical volume group is part of the VG
$pvs


Move all data from the old disks to the new temporary physical volume

This will take a lot of time since the new disk is attached on USB 2.0 :(

$pvmove /dev/sdb /dev/sdd1


Verify that the old disk is empty

$pvs


Remove old disk from VG
$vgreduce rhel /dev/sdb


Verify that the old disk is no longer part of the VG
$pvs


Wipe the label from the old disk

pvremove /dev/sd<x>


Phase #2 Adding the new 2 x 300Gb disks


Power off/on the server

Replace the 2 old 146GB disks with the new 300GB disks

Power On

Enter RAID setup and create a new “virtual device” with the 2 new 300 GB disks

Boot up the server


Rename the existing VG if needed

$vgrename vg_2_300gb vg600GB_56


Check for the new raid 0 virtual device name

$fdisk -l

Create a new physical volume on the new disks

$pvcreate /dev/sdb


Verify the the new physical volume group is part of the VG
$pvs


Extend the Volume Group with the new physical volume created on the new disk

$vgextend rhel /dev/sdb


Move all data from temporary disk to the new physical volume

$pvmove /dev/sdd1 /dev/sdb


Verify that the temporary disk is empty

$pvs


Remove old disk from VG
$vgreduce rhel /dev/sdd1


Verify that the temporary disk is no longer part of the VG
$pvs


Wipe the label from the temporary disk

$pvremove /dev/sdd1


Resize the LVM Logical size to use the extra space added by the new disks

$lvresize -l +100%FREE /dev/rhel/home


Finnaly extend the File System on the disks

$xfs_growfs /dev/mapper/rhel-home


Now you should be able to see the new disk space with df


Removing disks from PV,LV and VG


First remove the LV

$lvremove /dev/vg600GB_56/lv_300GB_disks


Then deactivate the VG

$vgchange -a n vg600GB_56


Finally remove the VG

$vgremove vg600GB_56


Adding new disks to a VG


Create a temporary new physical volyme on the new disk
NOTE ALL DATA WILL BE LOST ON THE NEW DISK!!

$pvcreate /dev/sdd1


Extend the Volume Group where the old disks are with the new temporary physical volume created on the new disk

$vgextend rhel /dev/sdd1


Verify the the new temporary physical volume group is part of the VG
$pvs


Extend the LV with the new extra space in the VG

$lvresize -l +100%FREE /dev/rhel/home


Finnaly extend the File System on the disks

$xfs_growfs /dev/mapper/rhel-home