3

I need more space for my Ubuntu system in my disk. I have a swap memory partition between two spaces that I want to become one. I run Ubuntu on 50 GB (26 GB Free + 24 GB (Blue) Currently running system)

I have to make 50GB for the currently running system and start from the start of the partition.

screenshot of partition scheme

What is the easiest way to do it?

Zanna
  • 70,465

1 Answers1

1

It is a good idea to backup everything, that you cannot afford to lose before continuing, because the following operations are potentially risky.

This is a method, that will not tamper with the head end of the root partition (and the swap partition) to make a /home partition in the unallocated space. (If you tamper with the head end of the root partition, you must also modify grub, the bootloader.)

  • Create a partition with an ext4 file system.

  • Copy the content of the current /home directory into it for example with rsync (first 'dry run' to check, then remove the n and do the real copy),

    sudo rsync -Havn /home/ /mount-point-of-the-new-partition
    
  • Modify your /etc/fstab to make the system use the new partition as /home.

  • When you see that things are working, you can remove the /home directory from the root partition, but watch out (make sure that you are deleting the correct data, and not the 'new home'.


You may prefer to do these operations, when booted from another drive, for example a USB boot drive with Ubuntu. In that case the rsynccommand line will be different: Mount the internal drive's root partition and copy from it,

sudo rsync -Havn /mount-point-of-internal-drive-root/home/ /mount-point-of-the-new-partition
sudodus
  • 46,324
  • 5
  • 88
  • 152