I’m not in the habit of talking to much so I’ll just go straight to it. This tutorial expects you are trying to expand a partition on a single hard drive using the ArchLinux Live CD.
Here are the instructions:
- Use gdisk. I’ve used both gdisk and parted and found gdisk to be slightly faster and easier to use. Plus you don’t have to make your partition bootable again.
- Run from a live CD, don’t do this on your running Linux. (even if you want, you can’t, so saying this is kind of redundant)
- Start gdisk against your disk:
- Enter expert menu with x and move the backup GPT headers to the end of the disk with e. (GPT disk have two partition tables located both at start and end of the drive) (recommended by Luminous thoughts)
- Write this first modification to the disk (it is still harmless) with w.
- After this has finished if it closed on finish, open gdisk again and show your disk info using p and note/remember your start and end sectors (starts, ends)
- Luminous thoughts also gives a good way you can backup your partition scheme with b. You can restore it with r and then I.
- Drop / delete the partition with d and the partition number (probably 1). This will not delete your filesystem.
- Recreate the partition, with n. The first sector must be the same as the destroyed partition !!! The ending sector can be the default if you choose to expand on the whole disk. Use the same partition type you had before (use Shift + PageUp to see what you printed with p earlier, if you forgot). I used 8300.
- Write the changes to disk with w and if it doesn’t close on finish exit gdisk with q.
The partition is now expanded but you still have to expand the filesystem.
- You may need to reload the partition table of the disk first:
blockdev –rereadpt /dev/sda
- Now we verify and clean the filesystem:
e2fsck -f /dev/sda1
- And we finally expand the filesystem:
resize2fs /dev/sda1This may take a while depending on the size of the added space.
After all this is finished you have to reinstall Syslinux, copy/symlink
*.c32 modules to
/boot/syslinux, set the boot flag and install the boot code in the MBR. Fourtanetly ArchLinux provides an easy way to do this:
- mount your partition:
mount /dev/sda1 /mnt
- chroot into it:
- now run
syslinux-install_update -i -a -m
- check your
/boot/syslinux/syslinux.cfgto make sure everything is ok. All done! Now you can reboot into your OS and use your larger partition. More info on installing the boot files can be found at