Need to resize root

My root partition is 20 GB which what was recommended when I installed manjaro. However lately it became full. I installed lot of snaps. Every time I install something using pacman it fails to commit transaction due to no enough free space. My home partition has a lot of free space, can reassign some to root. How to do so and what is a good root partition size ?

Note I tried clearing pacman cache.

1 Like

You could check if some of your snaps could be replaced by installs from normal repositories, this takes less space. To provide some re-partitioning advice please provide output of

sudo parted -l
lsblk -f
cat /etc/fstab
1 Like

You have a big problem.

  1. You cannot resize a mounted partition.
  2. Making a partition occupy more space requires available space to the right of the partition.
    • That implies you have empty space but you probably don't.
  3. To make spaca available you need to resize the partition to the right and move it to the right.

These actions makes a high probability of data loss somewhere - plus - you are in risk of inadvertently changing partition UUID which may render your system or systems unbootable.

It is next to impossible to advise - something is doomed to go wrong.

Backup your data to external disk or network - and reinstall.

Move the folder /var/lib/snap to another partition and symlink the new location as /var/lib/snap.

Model: SAMSUNG MZVLB512HBJQ-000L7 (nvme)
Disk /dev/nvme0n1: 512GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system     Name                          Flags
 1      1049kB  274MB   273MB   fat32           EFI system partition          boot, hidden, esp
 2      274MB   290MB   16.8MB                  Microsoft reserved partition  msftres
 3      290MB   96.9GB  96.6GB  ntfs            Basic data partition          msftdata
 6      96.9GB  102GB   5369MB  linux-swap(v1)                                swap
 5      102GB   124GB   21.5GB  ext4
 7      124GB   511GB   387GB   ext4
 4      511GB   512GB   1049MB  ntfs            Basic data partition          hidden, diag

NAME        FSTYPE   FSVER LABEL     UUID                                 FSAVAIL FSUSE% MOUNTPOINT
loop0       squashfs 4.0                                                        0   100% /var/lib/snapd/snap/datagrip/71
loop1       squashfs 4.0                                                        0   100% /var/lib/snapd/snap/intellij-idea-ultimate/198
loop2       squashfs 4.0                                                        0   100% /var/lib/snapd/snap/code/24
loop3       squashfs 4.0                                                        0   100% /var/lib/snapd/snap/postman/98
loop4       squashfs 4.0                                                        0   100% /var/lib/snapd/snap/code/25
loop5       squashfs 4.0                                                        0   100% /var/lib/snapd/snap/datagrip/70
loop6       squashfs 4.0                                                        0   100% /var/lib/snapd/snap/core/8592
loop7       squashfs 4.0                                                        0   100% /var/lib/snapd/snap/intellij-idea-ultimate/204
loop8       squashfs 4.0                                                        0   100% /var/lib/snapd/snap/clion/103
loop9       squashfs 4.0                                                        0   100% /var/lib/snapd/snap/core/8689
loop10      squashfs 4.0                                                        0   100% /var/lib/snapd/snap/postman/97
loop11      squashfs 4.0                                                        0   100% /var/lib/snapd/snap/clion/100
├─nvme0n1p1 vfat     FAT32 SYSTEM    1AA6-48DA                             227.2M    11% /boot/efi
├─nvme0n1p3 ntfs           Windows   46BCA897BCA882D3                                    
├─nvme0n1p4 ntfs           WinRE_DRV 6CE0A8E5E0A8B72C                                    
├─nvme0n1p5 ext4     1.0             01c7b10d-1aa2-4a32-b33d-18ca6ebcf010    1.5G    87% /
├─nvme0n1p6 swap     1               03b561dc-f276-4759-9f50-d77dd3aa9c2d                [SWAP]
└─nvme0n1p7 ext4     1.0             11725117-59de-4e0a-aa2d-b10aa0cc3c57  268.7G    19% /home

# /etc/fstab: static file system information.
# Use 'blkid' to print the universally unique identifier for a device; this may
# be used with UUID= as a more robust way to name devices that works even if
# disks are added and removed. See fstab(5).
# <file system>             <mount point>  <type>  <options>  <dump>  <pass>
UUID=1AA6-48DA                            /boot/efi      vfat    umask=0077 0 2
UUID=03b561dc-f276-4759-9f50-d77dd3aa9c2d swap           swap    defaults,noatime 0 2
UUID=01c7b10d-1aa2-4a32-b33d-18ca6ebcf010 /              ext4    defaults,noatime 0 1
UUID=11725117-59de-4e0a-aa2d-b10aa0cc3c57 /home          ext4    defaults,noatime 0 2

Will try to do the symlink. What is the recommended size of root partition ? also can I copy the content of home to an external drive then delete partition and assign the space to root ?

There is no recommendations as such.

Manjaro itself are not that disk hungry - the problem rise when your var folder grows uncontrolled - which it will if you install snaps. This goes for any root folder - var is probably the one which can grow uncontrolled - it is used for databases, snaps .... and a lot more applications data than I can think of.

The var folder is one of the folders some experienced users recommend to be on a separate partitiion - so you can solve the issue by resizing any other partition - create a new partition - move the var folder to the new partition and finally symlink the var folder on the new partition to /var

1 Like

I agree with @linux-aarhus that it would be risky to change your partitions but not impossible. First of all you have to decide if you have good reasons to do this instead of a new installation which is certainly much safer. In case you want to proceed then first back-up all valuable data. You could also install timeshift to backup major Manjaro system files. Backup also whatever needed from Windows partition. Make sure to have live media for system repair for both OS.

The procedure I can think of would be:

  1. Booting from firmware into a Manjaro live system (containg gparted)

  2. Mount the /home partition and copy ALL files (incl. hidden) of your /home partition to a backup disk, then unmount the /home partition again

  3. Delete the /home partition, making the area to unallocated space

  4. Increasing the size of your / partition to the targeted larger size (change 'to the right') using gparted - Here I see a little risk: The UUID MUST stay the same, if you have another UUID afterwards more work is needed to fix this or you need to change the UUID back to the previous value

  5. Making a new /home partition in the smaller remaining unallocated area

  6. Format it to ext4

  7. Mount the new /home partition and copy back your the whole backed-up content of the original /home partition to the new /home partition

  8. Mount the / partition and change the UUID entry in /etc/fstab for the /home entry to correspond with the new UUID of the new /home partition

1 Like

I am pretty sure that resizing a partition, particularly to the right with gparted won't change the UUID. But it is good to double-check.

1 Like

You could always just create a new partition to hold your snaps and mount it in on /var/lib/snap

1 Like

@Wollie @Marte

I agree it is not impossible - but to me the #newbies section does not involve high risc changes to the filesystem.

1 Like

You are right, yours and @dalto's suggestions are probably the safest and by far the easiest way to do it.

@linux-aarhus @dalto @Marte @Wollie

what is the better option for the future

resizing home and creating a partition for var or reinstalling manjaro.

1st option steps:

  1. boot into manjaro live cd
  2. resize home -> free say 30 GB
  3. create new partition for var

I need some clarifications please:

  1. If I go with 1st option after I create the new var partition I should copy the content of var in root partition to the new partition and then create a symlink is that right?

  2. If I chose to reinstall after backing up my needed files. I should open windows and delete root, home, swap partitions of manjaro and then boot into live cd and choose install alongside windows this will install manjaro and both root and home will be on the same partition right ?

The first time I installed manjaro I chose the partition sizes myself and saw a recommendation to separate home from root partition. Should I also do so and add a partition for var and mount it at /var or should I leave it as is ?

You do copy the data but you don't need to symlink anything. Just mount the new partition on /var/lib/snap. The way you would do this is to mount the new partition somewhere else first, let's say we use /mnt/snap Then use rsync to copy the data, sudo rsync -avhW /var/lib/snap/ /mnt/snap. After that you can delete the data in /var/lib/snap and then add an fstab entry for the new partition.

You don't have to boot into windows, you can modify the partitions from the live installer use gparted or kde partition manager depending which ISO you have.

That is entirely up to you. If it was me, and you were going the reinstall route, I would just make a bigger / partition. The more you carve it up, the more complicated space management gets. Adding the extra partition was more about finding a way to make it work without having to touch your existing partition.

This is a question of personal preferences. I have no separate /home partition to avoid getting in the type of trouble you have. On the other hand a separate /home partition could be helpful for backing up and to keep your configs in case a fresh install of Manjaro is desired.

Partitioning is best done upfront with gparted, then you only need to assign the partitions during the installation with Calamares.

When you are new to Manjaro and Linux as a general - use the simplest layout possible.

Recommendations are suggestions and you generally need to understand what the recommendations imply and what consequences a given choice infer.

Separating root and home is always a good idea and most often a size of 20-32G root will work flawless - but adding in variables like snaps will very quickly make a system run out of space on the root partition.

That depends on your usage - just remember disk space is cheap.

The - by far safest solution is to reinstall your system and take into account the possible growth of /var due to application data, snaps etc - if you are the least in doubt add another 10G to your root.

Only if you are up for the challenge

  • boot a live ISO
  • shrink your /home with a reasonable size
  • create a new partition using the aquiredfree space
  • mount partition on a temporary mount
  • move the content of /var to the temporary mount
  • modifiy the system to mount the new partition as /var

My advice, take it for what it's worth: reinstall. It is probably going to end up being easier and faster. Unless, of course, you want a challenge and a great learning experience, then try to resize root.

But whatever you do, make sure all your important files (including config files) are backed up, preferably to an external hard drive, which is unplugged when you do any of the things suggested in this thread.

I have read that snaps keeps multiple backup copies of snap and limiting it might save some space.

P.S. : really not sure if its disabled in manjaro by default

Use timeshift to take a snapshot of your root, manually backup your /home, and reinstall, then restore the snapshot and /home. You may need to amend your fstab or restore boot if your UUIDs change.

Probably the easiest way to do what you want to do. Reinstalling sounds like a lot of work but you can reinstall and restore a backup in 20 minutes on a good day.

It should go without saying but have a full backup in place before trying anything.

1 Like

Personally I always backup on an external drive, resize in accordance with my needs, then restore from the backup, but creating symlinks or separate /var also sounds reasonable, although I am not a fan of complicated layouts.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

Forum kindly sponsored by