- stop your vm & backup your disk
cp hdd.img hdd-backup.img
- resize the disk image
hdiutil resize -size [size]g hdd.img
- boot into linux and run
sudo parted /dev/[disk]
- if your swap partition is in the way (located immediately following your primary parition), delete & recreate it
rm [disk id of swap partition]
mkpartfs primary linux-swap
- start should be 1 gb away from end of disk
- end should be end of disk
- save and quit, reboot
- verify that the new swap is active
swapon -s
-- if not thenmkswap /dev/[disk][partition id]
- you might need to change
/etc/fstab
to point to the new UUID for the parition.mkswap
will return a uuid - replace the current uuid for the swap partition in/etc/fstab
with that id - reboot
- run
sudo parted /dev/[disk]
resizepart [partition id]
- keep the same start
- end at some number of MB before the swap starts
- write to disk
- run
resize2fs /dev/[disk][parition id]
- rejoice
Created
January 11, 2016 23:35
-
-
Save toddself/370ce9297ea0e64b6088 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment