0

I am using Ubuntu 22.04 LTS in a windows dual boot setup. This is the state of the partitions at the moment. (Windows Screenshot)

Partition Screenshot

On my Ubuntu, I have the following

df -H                                                                     
Filesystem      Size  Used Avail Use% Mounted on
tmpfs           3.4G  3.0M  3.4G   1% /run
efivarfs        263k  138k  120k  54% /sys/firmware/efi/efivars
/dev/nvme0n1p6   51G   42G  6.2G  88% /
tmpfs            17G  1.1M   17G   1% /dev/shm
tmpfs           5.3M  4.1k  5.3M   1% /run/lock
/dev/nvme0n1p7  160G   57G   96G  38% /home
/dev/nvme0n1p1  101M   35M   67M  34% /boot/efi
tmpfs           3.4G  177k  3.4G   1% /run/user/1000

Partition 6 (/) and partition 8 (/home) are the ones I am using for Ubuntu and want to expand them to un-allocated spaces.

How can I safely resize my partition 6 to take up available space on the left?

1 Answer 1

3

There are multiple things you need to understand:

  • a partition contains a file-system, usually but not necessarily with the same size as the partition
  • partitions can be expanded (or reduced) on their end only, because otherwise the file-system always has to start at the beginning of the partition. If you change the startpoint of the partition, the filesystem cannot be found anymore.
  • file-system can be expanded to a increased size of the partition very easy and on current filesystems even in live-mode
  • you must never decrease the size of a partition without decreasing the filesystem size before doing so, or you will loose data.

That being said, you can move your p6 (/) to the “left”, i.e. move not only the boundaries of the partition but also all it's data, including the filesystem. This means, the whole partition will be copied, no matter how many data it contains (This may be incorrect if you are using modern partitioning tools on SSDs, because SSDs have unlike harddrives another abstraction but the behaviour is the same, it's only faster).

After you moved your partition to the left, you can increase its size to the right. Depending on your partitioning tool, it will automatically increase the size of the file-system as well.

Long story short: If you want to increase a partition with a filesystem to the “left”, you have to move it so you can extend it to the “right” :-).

Because Windows can't handle Linux filesystems and you cannot move a filesystem used in a linux-system (only extend to the right), I recommend you to use an ubunut live-session and a tool like gnome disks or gparted.

6
  • A boot repair is necessary here if the / is resized.
    – GAD3R
    Feb 12 at 14:50
  • @GAD3R How do I do that ("boot repair")?
    – inquilabee
    Feb 12 at 14:59
  • @inquilabee see help.ubuntu.com/community/Boot-Repair and the external links.
    – GAD3R
    Feb 12 at 15:02
  • shouldn't be necessary because grub can find the partition by it's uuid. you can even move the EFI partition nowadays without trouble ;-)
    – blaimi
    Feb 12 at 15:05
  • A move should not change UUID, so it should boot. But you want good backups as any move with data, if interrupted, totally corrupts it as you have a half moved partition. And you want a live installer or repair/recovery drive for current version of every installed system. Just in case repairs are required.
    – oldfred
    Feb 12 at 16:55

You must log in to answer this question.

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