Additional Steps for Correcting Misalignment of Linux Data Disks Using LVM
Below are the steps to correct misalignment on Linux VMs that utilize LVM for the data disks. Note: The examples assume sdc to be the existing disk with a misaligned guest OS partition and sdd to be the new disk. Your configuration may vary.
- Create NetApp Snapshot of the datastore volume
- Add new VMDK to VM
- FDISK to create new aligned partition
- fdisk /dev/sdd
- u
- n
- p
- 1
- 64
- <enter>
- w
- Create a new PV
- pvcreate /dev/sdd1
- Extend VG
- vgextend lm /dev/sdd1
- PVMOVE
- pvmove /dev/sdc1 /dev/sdd1
- Reduce VG
- vgreduce lm /dev/sdc1
- Destroy old PV
- pvremove /dev/sdc1
- Remove old disk from VM
- Destroy NetApp Snapshot of the datastore volume after verifying that the VM is operating correctly
Backout Plan
- Create FlexClone from NetApp Snapshot taken prior to alignment
- Mount FlexClone as a datastore
- Power off VM
- Rename VM directory
- Copy VM directory from FlexClone datastore to original datastore
- Power on VM
- Verify VM operation is normal
- Dismount FlexClone datastore
- Destroy FlexClone
- Destroy NetApp Snapshot taken prior to alignment
Additional Steps for Correcting Misalignment of Linux Boot Disks Using LVM
Below are the steps to correct misalignment on Linux VMs that utilize LVM for the Boot disks. Note: The examples assume sdc to be the existing disk with a misaligned guest OS partition on sdc5 and sdd to be the temp disk. Your configuration may vary.
Create NetApp Snapshot of the datastore volume
Add new VMDK (temp disk) to VM (if the new disk is not automatically detected, execute ls /sys/class/scsi_host/ then echo - - - >/sys/class/scsi_host/Host#/scan where Host# is the output of the previous command)
- Create a new PV
- Extend VG
- PVMOVE
- pvmove /dev/sdc5 /dev/sdd
- Reduce VG
- Destroy old PV
- FDISK to create new aligned partition
- fdisk /dev/sdc
- u
- n
- l
- <any number evenly divisible by 8>
- <enter>
- w
- Probe to update partition table
- Create a new PV
- Extend VG
- PVMOVE
- pvmove /dev/sdd /dev/sdc5
- Reduce VG
- Destroy old PV
- Remove temp disk from VM
- Destroy NetApp Snapshot of the datastore volume after verifying that the VM is operating correctly