0

Some months ago I have installed Ubuntu 18.04.5 LTS on my new laptop, but while allocating space to the drivers, I unknowingly put 20 GB for the root filesystem partition 3 Ext4 (which now I think it's a disk where everything is going to be installed). So my question is, is there any way to increase its size without formatting it again using 70-80 GB of home ext4 space.

You can see the picture of GParted and free-h which I have attached within this question for a better understanding of my problem.

enter image description here

enter image description here

DMC-416
  • 25

1 Answers1

0

From the comments... here's an outline of one way to resize your root file system, by deleting your swap partition, resizing /, and using a /swapfile, instead of a swap partition...

  • temporarily disable swap

    • sudo swapoff -a
  • comment out the swap line in /etc/fstab

    • #UUID=xxxx-xxxx-xxxx-xxxx-xxxx none swap sw 0 0
  • boot to a Ubuntu Live DVD/USB

    • delete your excessive p6 swap partition using gparted

    • resize p3 using gparted

  • boot back into Ubuntu

  • create a 4G /swapfile

Note: Incorrect use of the dd command can cause data loss. Suggest copy/paste.

In the terminal...

sudo swapoff -a # turn off swap

sudo rm -i /swapfile # remove old /swapfile

sudo dd if=/dev/zero of=/swapfile bs=1M count=4096

sudo chmod 600 /swapfile # set proper file protections sudo mkswap /swapfile # init /swapfile sudo swapon /swapfile # turn on swap free -h # confirm xG RAM and 4G swap

Confirm this /swapfile line at the end of /etc/fstab... and confirm no other “swap” lines...

To edit, use sudo -H gedit /etc/fstab or sudo pico /etc/fstab

/swapfile  none  swap  sw  0  0

reboot                    # reboot and verify operation
heynnema
  • 73,649