Skip to content

Instantly share code, notes, and snippets.

@ctrlShiftBryan
Last active January 21, 2018 13:59
Show Gist options
  • Save ctrlShiftBryan/ec91c9a4e846012064fc39dcdc20a139 to your computer and use it in GitHub Desktop.
Save ctrlShiftBryan/ec91c9a4e846012064fc39dcdc20a139 to your computer and use it in GitHub Desktop.
resize .dmg

sudo dd if=/dev/sdb of=./sdb.raw VBoxManage convertdd sdb.raw sdb.vdi --format VDI

VBoxManage modifyhd --resize 30000 ~/Documents/VM/Windows10.vdi VBoxManage showhdinfo ~/path/to/vmdrive.vdi

Gparted right Click both sd2 and sd5 and chose "Deactivate". resize the extended (sda2) partition. resize the lvm (sda5) partition.

sudo lvextend --size +10G /dev/mapper/xserver--vg-root sudo lvdisplay /dev/mapper/xserver--vg-root sudo resize2fs /dev/mapper/xserver--vg-root

--covert back VBoxManage clonehd sdb.vdi sdb.raw --format RAW

or qemu-img convert -f vmdk sdb.vmdk -O raw sdb.raw

sudo dd if=./sdb.raw of=/dev/sdb

diskutil list

diskutil unmountDisk /dev/disk2

sudo dd bs=1m if=em.raw of=/dev/rdisk2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment