0

i am running out of space on the partition mounted as /. So i want to cut the partition sda4 into a smaller one and enlarge the sda2 partition.

But i can not unmount or resize sda4, because it is mounted in /home... so how can i fix that? See screenshot please.

gparted_screenshot

Thanks.

5

2 Answers 2

1

Make sure that you have a good backup of your important Ubuntu files, as this procedure can corrupt or lose data.

Keep these things in mind:

  • always start the entire procedure with issuing a swapoff on any mounted swap partitions, and end the entire procedure with issuing a swapon on that same swap partition

  • a move is done by pointing the mouse pointer at the center of a partition and dragging it left/right with the hand cursor

  • a resize is done by dragging the left/right side of a partition to the left/right with the directional arrow cursor

  • if any partition can't be moved/resized graphically, you may have to manually enter the specific required numeric data (don't do this unless I instruct you to)

  • you begin any move/resize by right-clicking on the partition in the lower pane of the main window, and selecting the desired action from the popup menu, then finishing that action in the new move/resize window

Do the following...

Note: if the procedure doesn't work exactly as I outline, STOP immediately and DO NOT continue.

  • boot to a Ubuntu Live DVD/USB
  • start gparted
  • resize the right side of /dev/sda4 by the amount you wish to add to /dev/sda2
  • move /dev/sda4 partition all the way right
  • move /dev/sda3 partition all the way right
  • resize the right side of /dev/sda2 all the way right
  • click the Apply icon

Update #1:

I just noticed that /dev/sda2 is a ext2 partition. Very unusual. To do this properly will require a data backup, and a Ubuntu reinstall. Don't multi-partition a 250G HDD when installing Ubuntu.

  • backup your data
  • boot to a Ubuntu Live DVD/USB
  • start gparted
  • swapoff on /dev/sda3
  • delete /dev/sda2/3/4 partitions
  • install Ubuntu without manual partitioning
  • restore your data
1
  • Did exactly that. Worked perfectly.
    – jules
    Feb 29, 2020 at 18:20
1

You cannot resize partitions while they are in use, i.e., mounted. The easiest way to repartition is to run an Ubuntu session from the live USB or DVD and do the partitioning from there. In a live session, none of your internal hard drives are mounted by default, and gparted is directly available from a live session.

Still, repartitioning is not trivial. If partitions need to be moved, it can become a lengthy process and things may go wrong. It would be much easier and faster to 1) ensure that your backup is up to date and 2) reinstall the operating system, ensuring that this time your foresee some more space for the root partition. Reinstalling Ubuntu takes between 15 minutes and an hour depending on how recent your system is. Then, there is the time you need to put your data back. Moving a large partition, in contrast, can take several hours. If that does not finish successfully, you are facing a reinstall anyway.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .