Low disk space on filesystem root -

Hello, I get this warning and know that I am low on memory for the root /home partition. How can I add space to this partition?

My newly installed email client (Thunderbird) keeps crashing - which is probably linked with this issue. It is becoming incredibly annoying as I fully rely on Fedora for work. I used to have Windows (dual boot) but cannot access that anymore since a long time. So the space for that old Windows partition can be used to increase the root folder if needed. Is there any way to achieve this?

I am on Fedora Linux 40 (Workstation Edition) and have very limited experience with these things. I know editing partitions is high risk. Any help is appreciated.

Here is the output of fdisk -l

Disk /dev/nvme0n1: 953,87 GiB, 1024209543168 bytes, 2000409264 sectors
Disk model: SKHynix_HFS001TEJ4X112N                 
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: FE2A4B96-5A63-427A-9B4E-9CF0BBB615BA

Device              Start        End    Sectors   Size Type
/dev/nvme0n1p1       2048     534527     532480   260M EFI System
/dev/nvme0n1p2     534528     567295      32768    16M Microsoft reserved
/dev/nvme0n1p3     567296  157853695  157286400    75G Microsoft basic data
/dev/nvme0n1p4  157853696 1958463487 1800609792 858,6G Microsoft basic data
/dev/nvme0n1p5 1958463488 1960560639    2097152     1G Linux filesystem
/dev/nvme0n1p6 1960560640 2000408575   39847936    19G Linux filesystem


Disk /dev/zram0: 8 GiB, 8589934592 bytes, 2097152 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/loop0: 4 KiB, 4096 bytes, 8 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop2: 74,24 MiB, 77844480 bytes, 152040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop1: 55,36 MiB, 58052608 bytes, 113384 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop3: 164,82 MiB, 172830720 bytes, 337560 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop4: 505,09 MiB, 529625088 bytes, 1034424 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop5: 91,69 MiB, 96141312 bytes, 187776 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop6: 82,07 MiB, 86061056 bytes, 168088 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop7: 38,83 MiB, 40714240 bytes, 79520 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

And adding a screenshot of Gparted:

To make the windows space available you can use gparted to remove partitions p2, p3, & p4.

/boot/efi seems to reside in p1, and since the default size for the efi partition on a new installation is about 600MB you might first consider expanding that partition to allow the additional recommended space. This is probably not required, but would be worth considering since you are making major changes anyway.

Since /boot resides in p5 and immediately follows the windows data, it would be relocated to the beginning of the now empty space.

Once p5 has been relocated then p6, which appears to be your main linux partition, could be expanded to fill the entire space following p5.

All this can be done using gparted with minimal risk to your system, but it is always recommended that you have a good and verified backup before making changes of this type.

The last step to remove the lingering traces of windows would be to remove the /boot/efi/EFI/Microsoft directory and contents from the efi partition.

For security and simplicity complete each step before starting the next.

I’ve seen @chrismurphy recommend against relocating partitions with gparted.

Excerpted from Cannot move partitions to create free space - #9 by chrismurphy

… If you have a bunch of free space at lower LBA’s (i.e. before the Btrfs partition rather than after it), then you just make that free space its own partition, and then use btrfs device add to add that partition to the existing Btrfs file system. …

It’s easier to discuss specifics interactively on matrix or IRC. We now have https://matrix.to/#/#btrfs:fedora.im for Btrfs specific discussion. Paste the URL for this discussion so folks have the proper background.

The two basic choices to make first are:

  1. Keep Windows. Shrink the main Windows volume (probably designated as C:) while running Windows. This creates a new empty partition from free space, and it looks like there’s tons so you could actually keep Windows and give Fedora a ton of space.
  2. Wipe Windows.

It’s really straightforward to add an empty partition to Btrfs.

First, always backup. If you make a mistake, it will be inconvenient, but at least your data is safe.

Next:
btrfs device add $NEWDEV $MOUNTPOINT

$NEWDEV is the path to an empty partition, e.g. /dev/nvme0n1p8, and $MOUNTPOINT is any path to the Fedora btrfs, e.g. /

Make sure you are absolutely certain about $NEWDEV because anything on it will be wiped when added. You can add multiple partitions in this single command, e.g. btrfs device add /dev/nvme0n1p8 /dev/nvme0n1p9 /

The command might detect the existing filesystems on these partitions and refuse to add them. You can use -f to tell the command to proceed. In this case, the command looks like btrfs device add -f

The command is nearly instant. There’s nothing else to do. That single command will TRIM the partition thereby wiping it of all data, “format” the partition, add the partition to the existing Btrfs, and resize the file system.

2 Likes

Thank you. You’re assuming that P4 is windows data. However these are data files used in my Linux (as well). I needed a separate partition in order to share those with windows.

I also tried to increase the size of /boot/efi on p1, but Gparted does not show the option “Resize/move” to merge with the 340 Mb I have available.

I’m not sure that worked well. See the result here.

I guess p3 and p6 should have merged?