Skip to content

Instantly share code, notes, and snippets.

@domluna
Created August 24, 2014 20:45
Show Gist options
  • Save domluna/4ace15bfd994989a525b to your computer and use it in GitHub Desktop.
Save domluna/4ace15bfd994989a525b to your computer and use it in GitHub Desktop.
How to resize linux partitions without cd/usb
Resize Linux partition without any disks/cds/usb things!
Works on Ubuntu 14.04, probably fine on others
1.
sudo losetup /dev/loop0
2. /path/to/file is found with 1., xxx is the number of MiBs to allocate, note: 1MiB ~ 1MB
sudo dd if=/dev/zero bs=1MiB of=/path/to/file conv=notrunc oflag=append count=xxx
3.
sudo losetup -c /dev/loop0
4.
sudo resize2fs /dev/loop0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment