this post was submitted on 30 Sep 2024
25 points (93.1% liked)

Linux

48044 readers
787 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

when I installed debian 12.7 I created a separated /var directory, along other 2 separated directories (names forgotten).

I also use flatpak and this program is installed in this directory. Executing 'flatpack update' I discovered this directory is 95% full, meaning I cannot update anything, because /var is 95% full (only 400 MiB free)

Ideas to solve this?

top 13 comments
sorted by: hot top controversial new old
[–] [email protected] 14 points 1 month ago* (last edited 1 month ago)

(I assume you meant "I created a separated /var partition")

You can move/resize partitions from basically any live usb (via cli or gparted for gnome and kde partition manager for kde).

Shall you want to, you can also merge the var partition with (say) your root partition:

  1. mount both partitions in two directories (just create empty ones and mount on them, say ~/root and ~/var)
  2. inside ~/root create the new var/ directory
  3. copy the data over
  4. edit ~/root/etc/fstab (remove the line for the old var partition)
  5. use whatever partitioning tool to get rid of the actual partition and expand the previous/next one

Be aware that you can very easily lose your data ;)

PS: just in case, try running flatpak uninstall --unused

[–] [email protected] 5 points 1 month ago

If you end up with resizing /var as the only solution, please post your partition layout first and ask, don't rush into it. A screenshot from an app like Disk Manager or Gparted should do it, and we'll explain the steps and the risks.

When you're ready to resize, you MUST use a bootable stick, not resize from inside the running system. You have to make a stick using something like Ventoy, and drop the ISO for the live version of GParted on the stick, then boot with it and pick the Gparted live. You'll have to write down the instructions and be careful what you do, and also hope that there's no power outage during.

[–] [email protected] 5 points 1 month ago* (last edited 1 month ago)

Is there a reason you gave /var it's own partition? Or is the problem that your entire root file system is full?

As others have said if you have a /var partition, resizing should fix the problem but the other solution would be to migrate the contents back to your main file system partition. Presumably at present there is a symbolic link folder pointing to your /var partition? Copy the /var partition contents into a new folder then boot in to recovery mode and delete the symbolic link and rename the new folder to /var. However presumably you have a good reason for splitting /var out.

If you don't have a separate partition then the issue may be your root system itself is full and that partition needs resizing if possible or cleaning our to make space.

Finally, Flatpak does also use the /var directories in the home users folders (it uses this for single user installs of software vs system wide installs). It's possible it's axtually the home folder/partition that is full and that needs resizing or cleaning out to make space .

[–] [email protected] 4 points 1 month ago

Is there a reason to install one(1) singular OS across multiple partitions? Is it just because that's how our ancestors did things?

Partitions are crude buckets that tell Operating Systems that "this lump is a filesystem that you know how to read" or "you don't know how to read this, leave it alone". Partitions tell UEFI that it should only use this special FAT32 chunk. A partition is not a good mechanism to set quotas, as you can see from how difficult it is to expand. A bunch of partitions that are all mounted together does little to isolate against failures.

If you want to run an OS across two filesystems that provide different characteristics (one provides atomic snapshots, the other provides ??), that would have to live on different partitions. Would you be better served by putting it all on the more modern FS? Is the older filesystem only kept around because it straddles "what my OS knows" and "what my bootloader knows"? If it's just for the bootloader's sake, that's why we have /boot.

[–] [email protected] 4 points 1 month ago (1 children)

The safest method, if your /home has enough space, is to use it instead of /var for (some) Flatpak installs. You can force any Flatpak install to go to /home by adding --user to the command.

If you look at the output of flatpak list it will tell you which package is installed in user home dir and which in system (/var). You can also show the size of each package with flatpak list --columns=name,application,version,size,installation.

I don't think you can move installed apps directly between system/user like Steam can (Flatpak is REALLY overdue for a good package manager) but you can uninstall apps from system, then run flatpak remove --unused, then install them again with --user.

Please note that apps installed with --user are only seen by the user that installed them. Also you'll have to cleanup separately for system and user(s) in the future (flatpak remove --unused for system, then flatpak remove --unused --user for each user).

[–] [email protected] 2 points 1 month ago (1 children)

First you have to make a new --user remote. Then you can list your current stuff and install it on the --user side one package at a time, (with --no-pull so it sucks the existing install). Then, you delete the --system copy of packages.

[–] [email protected] 1 points 1 month ago

Great trick, I had no idea Flatpak can use an existing install as a repo!

[–] [email protected] 3 points 1 month ago

Assuming your /var is in a separate partition, you could resize it using a tool like gparted. But make a backup beforehand.

[–] [email protected] 2 points 1 month ago

I ran into this same problem a few months ago. Instead of taking the time to learn how to manage partitions and lvms, i just re-installed debian and put everything on the same partition because i had no reason to keep em separated.

[–] [email protected] 1 points 1 month ago* (last edited 1 month ago)

If /var is on an LVM backed partition you can add more space to the logical volume then grow the filesystem online if /var is on a filesystem that supports it. Ext4 and xfs both support it.

Btrfs and zfs should also support online resizing if you are using these. You can figure out what you have using the lsblk command.

Edit: you will need to add an additional disk to the system or have unallocated free space. If it's a vm in something like proxmox or VMware you can add an additional disk to the VM then use LVM/btrfs/zfs to add a physical volume/add more space to a pool. If it's a bare metal physical machine you'll have to plug in a new disk through a mechanism that supports hot swapping.

[–] [email protected] 1 points 1 month ago

Sounds like you created a seperate partition for /var. Only way to change that is to redo your partitions or bind mount an external disk as /var.

[–] [email protected] 1 points 1 month ago

you could move the flatpak stuff onto another partition with same permissions and bind mount it to the original location, then persist it with a line in fstab

[–] [email protected] 1 points 1 month ago

In the future, you should look into using LVMs for your partitions. I ran into a similar problem recently where my /var needed to be increased - I was able to run a simple lvextend -L+4G /dev/myvg/var --resizefs to grow my /var by 4 gigabytes.

Before I was using LVMs though I used a gparted live disk a lot