3

I am trying to somehow extend the unallocated partition (below sda1) into the sda2 partition to increase its total size. If it is relevant the sda1 is a Windows 10 parition and I'm dual-booting with Antergos (Arch Linux variant). Below is a screenshot from GParted.enter image description here

1028
  • 95
  • 7

1 Answers1

4

Mounted file systems can't be resized. In the screenshot of gparted, there's a key symbol between /dev/sda2 and ext4; that key symbol indicates /dev/sda2 is mounted. It can't be unmounted while the Arch Linux system on sda2 is running.

To fix:

  1. Reboot from a liveCD, (or USB equivalent), and run gparted from that, right click on /dev/sda2 and click 'Resize/Move', etc. Now /dev/sda2 won't be mounted, so it can be resized.

  2. Usually after moving the root directory, grub should be updated, or it won't be able to find the system, and Arch wouldn't boot. So after the resize, (and still using the liveCD), open a terminal, do the appropriate chroot login to /dev/sda2, and run update-grub.

  3. Reboot, remove liveCD. The system should now boot from the newly resized 120GB /dev/sda2 Arch Linux partition.

agc
  • 7,223
  • +1. as long as the partition number doesn't get changed (or the partition's UUID if using them wih grub), there's no need to run update-grub. – cas Jul 27 '16 at 02:10
  • @cas, no, the part # and UUID wouldn't be changed. But if the hard drive is such that grub can only be installed using blocklists, a partition resize can break that, and a chroot et al will be needed. (I've bumped into this annoyance several times now...) – agc Jul 27 '16 at 04:05
  • OK. I don't think I've ever encountered that. I can't even remember the last time i had any need to install grub to a partition rather than the MBR, and I always create the first partition at, e.g. 2MB, so that the partitions are properly aligned for all common and foreseeable sector sizes...so there's always more than enough room for grub to embed into the space between the MBR and the first sector. – cas Jul 27 '16 at 04:13