15 06 2016
Useful tools & commands for resizing/growing LVM based disks/filesystems …
gparted … https://www.gnu.org/software/parted/ https://gparted.org/download.php
first boot into gparted, rightlick on the locked LVM areas and click “disable”. the lock disappears. then resize them to maximum, then open terminal:
useful sample commands: (WARNING: DO *NOT* USE THESE COMMANDS UNLESS YOU KNOW EXACTLY WHAT YOU ARE DOING! They are *NOT* thought to be copy/pasted, it’s just a collection of commands in random order!)
pvs -v --segments /dev/sdc5
lvdisplay
pvmove --alloc anywhere /dev/sdc5:7680-8445 /dev/sdc5:XXXX-YYYY
lvresize -l +100%FREE /dev/asterisk-vg/root
e2fsck /dev/asterisk-vg/root
#lvextend -l /dev/asterisk-vg/root
#vgscan
#vgchange -ay
#vgchange -an
resize2fs /dev/asterisk-vg/root
swapoff
Moving the system onto a bigger harddisk:
Step 1: dd the whole volume
Step 2: Getting “swap” out of the way (moving towards the end) after growing the disk, i.e. physically moving it towards the end of the bigger disk:
After this, you can resize the root LV …
Lets see if the disk size really has been adjusted:
Looks OK. – GParted also looks okay:
Different scenario: Moving a bigger LVM system onto a SMALLER harddisk:
yes, it works. did this yesterday. but it’s PITA. Basically works the same as above, but moving swap towards the front after shrinking the LVM volume. Then dd’ing the bigger disk to the smaller.
btrfs compression LINDY IP Power Switch Classic 8 – SNMP cheat sheet (ipower, remote power)
Comments are currently closed.