Skip to content

Instantly share code, notes, and snippets.

@TobleMiner
Last active September 17, 2016 18:22
Show Gist options
  • Save TobleMiner/c7a8282e88acba901d0b99efe941f3ea to your computer and use it in GitHub Desktop.
Save TobleMiner/c7a8282e88acba901d0b99efe941f3ea to your computer and use it in GitHub Desktop.
Resize and prepare vserver volumes
kpartx -a
blkid - record partition uuids
fdisk
p - grab partition information (Ids > 4 are logical volumes inside extended volumes)
d - delete all partitions
n - create partitions with correct offsets
kpartx -d
kpartx -a - get new partitions and their sizes
resize2fs - resize partitions to new block device size
tune2fs -U - adjust partition uuids to match previosly recorded ones
mkswap - create swap volumes with correct ids
egrep -o "[a-z0-9]{8}-([a-z0-9]{4}-){3}[a-z0-9]{8}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment