why resize a PV instead of adding a new PV?
Summary: From a purely technical standpoint, it doesn't make much difference, but resizing is better. Once you add in practical aspects, adding a new partition is a clear winner.
From a strictly technical standpoint, new PVs have a few downsides:
- You get another copy of the LVM metadata, this costs some disk space. If you frequently do LVM operations, this also causes write amplification (as the metadata is mirrored to all PVs)
- There may be empty space left for alignment
- Increases amount of LVM metadata (per copy), slightly, to store info about the new PV.
- If you create a LV that spans both PVs, it's not contiguous (due to the extra metadata and any holes left for alignment). So, e.g, if you were using that LV for big sequential reads/writes, there is now a seek in there.
From a practical standpoint, none of those matter for any reasonable number of PVs. The extra copies of the metadata matter first, but there is an LVM option to keep fewer copies (VG --metadatacopies
or PV --metadataignore
).
Further, continuing the practical standpoint, deleting and recreating a partition is much more likely to suffer from admin error (typo, etc.) than creating a new partition due to better tools for the latter. And any admin errors that occur are likely to be much more destructive for resizing (because your data is on the resized partition, but there is no data on a new partition). This is even worse when you have multiple layers; e.g., mdraid below LVM. Depending on your -e
option, the superblocks can be at the end of the array—fun when you resize a partition.
There is one exception that comes to mind: if for whatever reason you can't create a new partition. For example, maybe you're using DOS partition tables, and you already used all four primary partitions (without creating an extended partition). Then you don't have a choice.