Page 1 of 1

MX 23.6: Root Partition full: how to reover space?

Posted: Thu Jul 31, 2025 4:18 am
by LateJunction
The root partition for my MX 23.6 PC is 96GB , of which 24MB is free. Currently boot doesn't complete: it ends at a black screen when choosing init in Grub or I get a message saying unable to load Light DM if I choose to boot with systemd. Last time I looked (before today) root partition was about 25% full. I have no idea why the root partition has filled in this way (and that's a problem for later); for now I am assuming that the root partition being full is the main reason why the system won't complete the boot process. I would be grateful for advice on what I can delete and how I can do that - bearing in mind the system won't bootfrom the installed MX. I assume I will have to boot from a live DVD or USB, but how will I then get permission to delete stuff, and what should I delete?

Quick system info follows, via the cunning trick of copying it from another recent post to this forum, since I am creating this post on a non-MX linux PC

Code: Select all

System:
  Kernel: 6.9.12-2-liquorix-amd64 [6.9-12~mx23ahs] arch: x86_64 bits: 64 compiler: gcc v: 12.2.0 parameters: audit=0
    intel_pstate=disable BOOT_IMAGE=/boot/vmlinuz-6.9.12-2-liquorix-amd64 root=UUID=<filter> ro
    quiet iommu=off splash init=/lib/systemd/systemd
  Desktop: Xfce v: 4.20.0 tk: Gtk v: 3.24.38 info: xfce4-panel wm: xfwm v: 4.20.0 vt: 7
    dm: LightDM v: 1.32.0 Distro: MX-23.6_x64 Libretto October 15  2023 base: Debian GNU/Linux 12
    (bookworm)
Machine:
  Type: Desktop System: Gigabyte product: H81M-S2H v: N/A serial: <superuser required> Chassis:
    type: 3 serial: <superuser required>
  Mobo: Gigabyte model: H81M-S2H v: x.x serial: <superuser required> UEFI: American Megatrends
    v: F2 date: 08/11/2015
Battery:
  Device-1: hidpp_battery_0 model: Logitech Wireless Keyboard PID:0062 serial: N/A
    charge: 70% (should be ignored) rechargeable: yes status: discharging
  Device-2: hidpp_battery_1 model: Logitech Wireless Mouse PID:0081 serial: N/A
    charge: 70% (should be ignored) rechargeable: yes status: discharging
CPU:
  Info: model: Intel Core i7-4790 bits: 64 type: MT MCP arch: Haswell gen: core 4 level: v3
    note: check built: 2013-15 process: Intel 22nm family: 6 model-id: 0x3C (60) stepping: 3
    microcode: 0x28
  Topology: cpus: 1x cores: 4 tpc: 2 threads: 8 smt: enabled cache: L1: 256 KiB
    desc: d-4x32 KiB; i-4x32 KiB L2: 1024 KiB desc: 4x256 KiB L3: 8 MiB desc: 1x8 MiB
  Speed (MHz): avg: 1023 high: 1200 min/max: 800/3601 boost: enabled scaling:
    driver: acpi-cpufreq governor: ondemand cores: 1: 1197 2: 1200 3: 1197 4: 1197 5: 1000 6: 800
    7: 800 8: 800 bogomips: 57471
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
  Vulnerabilities:
  Type: gather_data_sampling status: Not affected
  Type: itlb_multihit status: KVM: VMX disabled
  Type: l1tf mitigation: PTE Inversion; VMX: conditional cache flushes, SMT vulnerable
  Type: mds mitigation: Clear CPU buffers; SMT vulnerable
  Type: meltdown mitigation: PTI
  Type: mmio_stale_data status: Unknown: No mitigations
  Type: reg_file_data_sampling status: Not affected
  Type: retbleed status: Not affected
  Type: spec_rstack_overflow status: Not affected
  Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via prctl
  Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization
  Type: spectre_v2 mitigation: Retpolines; IBPB: conditional; IBRS_FW; STIBP: conditional; RSB
    filling; PBRSB-eIBRS: Not affected; BHI: Not affected
  Type: srbds mitigation: Microcode
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: NVIDIA GP107 [GeForce GTX 1050] vendor: ZOTAC driver: nvidia v: 535.247.01
    non-free: 530.xx+ status: current (as of 2023-03) arch: Pascal code: GP10x process: TSMC 16nm
    built: 2016-21 pcie: gen: 2 speed: 5 GT/s lanes: 16 bus-ID: 01:00.0 chip-ID: 10de:1c81
    class-ID: 0300
  Display: x11 server: X.Org v: 1.21.1.7 compositor: xfwm v: 4.20.0 driver: X: loaded: nvidia
    gpu: nvidia display-ID: :0.0 screens: 1
  Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 509x286mm (20.04x11.26") s-diag: 584mm (22.99")
  Monitor-1: HDMI-0 res: 1920x1080 hz: 60 dpi: 26 size: 1872x1053mm (73.7x41.46")
    diag: 2148mm (84.56") modes: N/A
  API: OpenGL v: 4.6.0 NVIDIA 535.247.01 renderer: NVIDIA GeForce GTX 1050/PCIe/SSE2
    direct-render: Yes
Audio:
  Device-1: Intel 8 Series/C220 Series High Definition Audio vendor: Gigabyte 8
    driver: snd_hda_intel v: kernel bus-ID: 00:1b.0 chip-ID: 8086:8c20 class-ID: 0403
  Device-2: NVIDIA GP107GL High Definition Audio vendor: ZOTAC driver: snd_hda_intel v: kernel
    pcie: gen: 2 speed: 5 GT/s lanes: 16 bus-ID: 01:00.1 chip-ID: 10de:0fb9 class-ID: 0403
  API: ALSA v: k6.9.12-2-liquorix-amd64 status: kernel-api tools: alsamixer,amixer
  Server-1: PipeWire v: 1.0.0 status: active with: 1: pipewire-pulse status: active
    2: wireplumber status: active 3: pipewire-alsa type: plugin 4: pw-jack type: plugin
    tools: pactl,pw-cat,pw-cli,wpctl
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: Gigabyte driver: r8169
    v: kernel pcie: gen: 1 speed: 2.5 GT/s lanes: 1 port: d000 bus-ID: 03:00.0 chip-ID: 10ec:8168
    class-ID: 0200
  IF: eth0 state: up speed: 1000 Mbps duplex: full mac: <filter>
Drives:
  Local Storage: total: 1.47 TiB used: 507.83 GiB (33.7%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/sda maj-min: 8:0 vendor: Western Digital model: WD10EZEX-75ZF5A0 size: 931.51 GiB
    block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s type: N/A serial: <filter> rev: 0A80
    scheme: MBR
  ID-2: /dev/sdb maj-min: 8:16 vendor: Seagate model: ST3500312CS size: 465.76 GiB block-size:
    physical: 512 B logical: 512 B speed: 1.5 Gb/s type: HDD rpm: 5900 serial: <filter> rev: SC13
    scheme: MBR
  ID-3: /dev/sdc maj-min: 8:32 vendor: SanDisk model: SDSSDA120G size: 111.79 GiB block-size:
    physical: 512 B logical: 512 B speed: 3.0 Gb/s type: SSD serial: <filter> rev: 00RL scheme: GPT
Partition:
  ID-1: / raw-size: 83.66 GiB size: 81.79 GiB (97.77%) used: 51.38 GiB (62.8%) fs: ext4
    dev: /dev/sdc3 maj-min: 8:35
  ID-2: /boot/efi raw-size: 7.62 GiB size: 7.6 GiB (99.80%) used: 288 KiB (0.0%) fs: vfat
    dev: /dev/sdc1 maj-min: 8:33
  ID-3: /home raw-size: 465.76 GiB size: 457.38 GiB (98.20%) used: 223.45 GiB (48.9%) fs: ext4
    dev: /dev/sdb1 maj-min: 8:17
Swap:
  Kernel: swappiness: 15 (default 60) cache-pressure: 100 (default)
  ID-1: swap-1 type: file size: 16.68 GiB used: 0 KiB (0.0%) priority: -2 file: /swap/swap
  ID-2: swap-2 type: partition size: 20.51 GiB used: 0 KiB (0.0%) priority: -3 dev: /dev/sdc2
    maj-min: 8:34
Sensors:
  System Temperatures: cpu: 38.0 C mobo: N/A gpu: nvidia temp: 33 C
  Fan Speeds (RPM): N/A gpu: nvidia fan: 46%
Repos:
  Packages: 3491 pm: dpkg pkgs: 3452 libs: 1996 tools: apt,apt-get,aptitude,nala,synaptic pm: rpm
    pkgs: 0 pm: flatpak pkgs: 39
  No active apt repos in: /etc/apt/sources.list
  Active apt repos in: /etc/apt/sources.list.d/brave-browser-release.list
    1: deb [arch=amd64 signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg] https://brave-browser-apt-release.s3.brave.com/ stable main
  Active apt repos in: /etc/apt/sources.list.d/debian-stable-updates.list
    1: deb http://deb.debian.org/debian/ bookworm-updates main contrib non-free non-free-firmware
  Active apt repos in: /etc/apt/sources.list.d/debian.list
    1: deb http://deb.debian.org/debian/ bookworm main contrib non-free non-free-firmware
    2: deb http://security.debian.org/debian-security/ bookworm-security main contrib non-free non-free-firmware
  No active apt repos in: /etc/apt/sources.list.d/graphics:darktable.list
  No active apt repos in: /etc/apt/sources.list.d/graphics:darktable:master.list
  Active apt repos in: /etc/apt/sources.list.d/mx.list
    1: deb https://mirrors.ukfast.co.uk/sites/MX_antiX_packages/mx/repo/ bookworm main non-free
  Active apt repos in: /etc/apt/sources.list.d/qgis.sources
    1: deb deb-src [arch=amd64] https://qgis.org/debian bookworm main
  Active apt repos in: /etc/apt/sources.list.d/winehq-bookworm.sources
    1: deb [arch=amd64 i386] https://dl.winehq.org/wine-builds/debian bookworm main
Info:
  Processes: 343 Uptime: 34m wakeups: 4 Memory: 15.65 GiB used: 2.02 GiB (12.9%) Init: systemd
  v: 252 target: graphical (5) default: graphical tool: systemctl Compilers: gcc: 12.2.0 alt: 12
  Client: shell wrapper v: 5.2.15-release inxi: 3.3.26
Boot Mode: UEFI

Re: MX 23.6: Root Partition full: how to reover space?

Posted: Thu Jul 31, 2025 4:20 am
by Eadwine Rose
Can you at least encase it in code tags, thanks.

Re: MX 23.6: Root Partition full: how to reover space?

Posted: Thu Jul 31, 2025 4:47 am
by LateJunction
Beg pardon; that's currently beyond my understanding; how do I do that?

Re: MX 23.6: Root Partition full: how to reover space?

Posted: Thu Jul 31, 2025 4:59 am
by Eadwine Rose
Edit the post and select the text, then press the </> button.

Or like so [code]code output here[/code]

Re: MX 23.6: Root Partition full: how to reover space?

Posted: Thu Jul 31, 2025 5:01 am
by LateJunction
Thanks; I updated the post; is that adequate?

Re: MX 23.6: Root Partition full: how to reover space?

Posted: Thu Jul 31, 2025 5:11 am
by Eadwine Rose
Nope. I will adjust it for you, you can see what was meant.

Re: MX 23.6: Root Partition full: how to reover space?

Posted: Thu Jul 31, 2025 6:04 am
by LateJunction
Yes, I can see that your adjustment gives the desired result - but I can't see how you did it!

Re: MX 23.6: Root Partition full: how to reover space?

Posted: Thu Jul 31, 2025 6:20 am
by Eadwine Rose
You had [CODE SELECT ALL:] in there.

That doesn't look like
[code]code output here[/code]

Re: MX 23.6: Root Partition full: how to reover space?

Posted: Thu Jul 31, 2025 8:10 am
by j2mcgreg
Your Western Digital HDD is eleven years old, so it has to be suspect. What does your bios say about it's status?

Re: MX 23.6: Root Partition full: how to reover space?

Posted: Thu Jul 31, 2025 8:31 am
by b3ta
j2mcgreg's point is valid, so check the drive's status anyway, even though your immediate problem is that it is full.

This should help to get information. All of this requires you to boot off a live USB, so that you can mount your drive's root to, say, "/media/mydrive" and then check things out from a properly running OS.

To see what's taking up space

Use the "du" (disk usage) command. It has a host of options, so I wrote a script that I've ended up using more than I probably should, which I call "DU". Here it is in all its g(l)ory:

Code: Select all

#!/bin/bash

if [ $# -eq 0 ]; then
  ls -Ab --quoting-style=literal |\
   tr \\n \\0 |\
   du -scmx --files0-from=- --exclude='proc/*' |\
   sort -n
  exit $?
fi

cat <<EOH
`basename $0` returns a list of ALL files (and directories) in the current directory, sorted numerically with sizes reported in MiB, plus a total. It uses the output from "ls -Ab --quoting-style=literal" in a way which makes sense to me.

I didn't change du's default regarding links, which is:
  Symbolic links are reported as size 0
  Hard links are not reported on at all

See the source and man pages if you're interested, as this comment is already FAR longer than the one-liner the core of the script is.
EOH
Do yourself a favour and use copy & paste, as the exact characters are critical in many parts of the above.

Running this DU script while in the "/media/mydrive" directory will give you a good idea of where to look for what you can delete.

Checking drive health

In the live system, run "GSmartControl" (if it's not there, just install it) on your troubled drive. Note that it will require the then-current user's password. The default live USB's user name and password are the same: "demo" (or "Demo", I can't remember). Sadly, the interpretation of the SMART values is a bit of a black art because the manufacturers seldom disclose what the values should be, but it will give you a good idea. At least running both the short and the long self tests will report issues they find.

Re: MX 23.6: Root Partition full: how to reover space?

Posted: Thu Jul 31, 2025 10:00 am
by LateJunction
j2mcgreg wrote: Thu Jul 31, 2025 8:10 am Your Western Digital HDD is eleven years old, so it has to be suspect. What does your bios say about it's status?
BIOS says its OK (or words to that effect). I'm having no problems with it - it holds my /Home directory. Disks says it is OK with no defective sectors; as I type this I'm performing a self-check on it. But you make a good point -I should be replacing it on the basis of age.

The disk that is giving me pain is the 120 GB SSD, which must also be at least that old and of which Disks says it has one bad sector (which it has had for at least 5 years).

Re: MX 23.6: Root Partition full: how to reover space?

Posted: Thu Jul 31, 2025 10:36 am
by j2mcgreg
Frankly, I'd replace them both. In the interim you should immediately make back ups of both (if you haven't already). A 128 GB ssd should cost you about 15 pounds and a 1 TB HDD should cost about 50 pounds/

Re: MX 23.6: Root Partition full: how to reover space?

Posted: Sat Aug 02, 2025 10:43 am
by LateJunction
j2mcgreg wrote: Thu Jul 31, 2025 10:36 am Frankly, I'd replace them both. In the interim you should immediately make back ups of both (if you haven't already). A 128 GB ssd should cost you about 15 pounds and a 1 TB HDD should cost about 50 pounds/
Yes, that's good advice. I spent some hours on a survey of the market for small SSD and 1TB HDD in UK; could not find anything as small as 128GB - smallest now seems to be 240 or 250GB at around £27 incl VAT and P&P; cheapest new 1 TB drive I could find was still £65. Where were you looking?

Re: MX 23.6: Root Partition full: how to reover space?  [Solved]

Posted: Sat Aug 02, 2025 10:57 am
by LateJunction
b3ta wrote: Thu Jul 31, 2025 8:31 am j2mcgreg's point is valid, so check the drive's status anyway, even though your immediate problem is that it is full.

This should help to get information. All of this requires you to boot off a live USB, so that you can mount your drive's root to, say, "/media/mydrive" and then check things out from a properly running OS.

To see what's taking up space

Use the "du" (disk usage) command. It has a host of options, so I wrote a script that I've ended up using more than I probably should, which I call "DU". Here it is in all its g(l)ory:

Code: Select all

#!/bin/bash

if [ $# -eq 0 ]; then
  ls -Ab --quoting-style=literal |\
   tr \\n \\0 |\
   du -scmx --files0-from=- --exclude='proc/*' |\
   sort -n
  exit $?
fi

cat <<EOH
`basename $0` returns a list of ALL files (and directories) in the current directory, sorted numerically with sizes reported in MiB, plus a total. It uses the output from "ls -Ab --quoting-style=literal" in a way which makes sense to me.

I didn't change du's default regarding links, which is:
  Symbolic links are reported as size 0
  Hard links are not reported on at all

See the source and man pages if you're interested, as this comment is already FAR longer than the one-liner the core of the script is.
EOH
Do yourself a favour and use copy & paste, as the exact characters are critical in many parts of the above.

Running this DU script while in the "/media/mydrive" directory will give you a good idea of where to look for what you can delete.

Checking drive health

In the live system, run "GSmartControl" (if it's not there, just install it) on your troubled drive. Note that it will require the then-current user's password. The default live USB's user name and password are the same: "demo" (or "Demo", I can't remember). Sadly, the interpretation of the SMART values is a bit of a black art because the manufacturers seldom disclose what the values should be, but it will give you a good idea. At least running both the short and the long self tests will report issues they find.
This is a tremendously helpful post - very much appreciated. After a long time trying to use your script (caused by failing to precisely read your directions) I got some results which greatly confuse me :
The largest directory/folder which DU found in my root partition is named /swap - at about 20GB. I have a separate partition on the same SSD which is named SWAP (according to Gnome disks). Is this the same as /swap - a folder in my root directory? Surely not? But why does this /swap file exist and why so much room used when I have 16 GB of RAM and I'm not running large applications?

The second largest directory that DU found was /var at about 18GB. Compare that to my main Linux PC - which has a huge amount of applications installed -probably 10x more than on this MX Linux PC, including flatpaks - which is 25GB. The size of /var on the MX PC surprises me; there are very few flatpaks there. What is cauisng it to be so large?.

Re: MX 23.6: Root Partition full: how to reover space?

Posted: Sat Aug 02, 2025 11:02 am
by j2mcgreg
@LateJunction wrote:
Yes, that's good advice. I spent some hours on a survey of the market for small SSD and 1TB HDD in UK; could not find anything as small as 128GB - smallest now seems to be 240 or 250GB at around £27 incl VAT and P&P; cheapest new 1 TB drive I could find was still £65. Where were you looking?
Canadian prices converted to Pound Sterling. But the prices are in line since your 250 GB SSD is about twice the capacity of the 128 GB model I cited for about twice the price.

Re: MX 23.6: Root Partition full: how to reover space?

Posted: Sat Aug 02, 2025 11:03 am
by oops
... You can also use a GUI to check the sizes: baobab (or in sudo: ncdu -x / --exclude home )

Re: MX 23.6: Root Partition full: how to reover space?

Posted: Sat Aug 02, 2025 11:08 am
by CharlesV
Your qsi shows that you have TWO swap pieces: 1 partition (20gb) and 1 swap file (16gb) And no, you probably do not need both.

Code: Select all

Swap:
  Kernel: swappiness: 15 (default 60) cache-pressure: 100 (default)
  ID-1: swap-1 type: file size: 16.68 GiB used: 0 KiB (0.0%) priority: -2 file: /swap/swap
  ID-2: swap-2 type: partition size: 20.51 GiB used: 0 KiB (0.0%) priority: -3 dev: /dev/sdc2
    maj-min: 8:34
The /var folder can hold a lot of things that can take up space. cache, log, and tmp folders all can get large. It is not uncommon to have 10 to 20gb sitting in there.

You can use MX Cleanup to clear out some of these, but going into /var and doing that du command will show you where things are.

Re: MX 23.6: Root Partition full: how to reover space?

Posted: Sun Aug 03, 2025 11:36 am
by LateJunction
Thanks for your continued support. The swap file situation mystifies me: I know I created a separate partition for swap when I last rebuilt this PC - it's something I always do - but I have no idea how this swap directory in the root partition came into being, nor why it is being used in preference to the swap partition. Can I just delete the swap folder and assume that MX will just pick-up the swap partition instead?

Re: MX 23.6: Root Partition full: how to reover space?

Posted: Sun Aug 03, 2025 12:13 pm
by CharlesV
Assuming is dangerous :-) ...

Check what is in use first:

Code: Select all

free -m 

and

Code: Select all

swapon -s

The correct steps for removing a swap file are:
- turn swap off
- back up your /etc/fstab file
- remove the swap file line from your fstab
- verify that your swap partition is in fstab!
- remove the swap file
- turn swap back on

a nice page showing how to is here : https://fostips.com/create-remove-swap-file-debian/

and personally, I would to a imeshift before you do any of this!

Re: MX 23.6: Root Partition full: how to reover space?

Posted: Sun Aug 03, 2025 12:16 pm
by CharlesV
One more thing... if you do this, please double check afterwards to verify you have the swap partition in use again. (ie make sure swap is on again! )

Re: MX 23.6: Root Partition full: how to reover space?

Posted: Sun Aug 03, 2025 6:48 pm
by b3ta
CharlesV's recipe for getting rid of that swap file is a good idea, including the backup!

20G for /var seems like a lot to me. I just looked at three machines (our media server (MX), a Proxmox server in my study, and a Raspberry Pi in my office at work), and the biggest /var was 3.8G.

Using the DU script should help. Just cd to /var and run it there, then do the same in the top five or so directory trees

I find it easiest to have two terminal windows open: one on the left with DU's output and the one to its right (overlapping but so that I can still see the output in the other) which I use to investigate the top few directory trees. Those investigations are usually much faster than the initial DU run because the kernel caches quite a bit, making for less actual disc access.

One word of warning when copying & pasting scripts, especially ones you run as root: read the man pages of the commands they run, so that you understand what's going on. I once renamed a production machine to "-f" because I forgot that in its variant of UNIX, running "hostname -f" did not return the fully qualified domain name.

Re: MX 23.6: Root Partition full: how to reover space?

Posted: Mon Aug 04, 2025 1:49 pm
by LateJunction
CharlesV wrote: Sun Aug 03, 2025 12:16 pm One more thing... if you do this, please double check afterwards to verify you have the swap partition in use again. (ie make sure swap is on again! )
System operating correctly now (for a given value of 'correctly' within my skill level...).

Your support was the key factor. Thank you.

Re: MX 23.6: Root Partition full: how to reover space?

Posted: Mon Aug 04, 2025 1:54 pm
by CharlesV
LateJunction wrote: Mon Aug 04, 2025 1:49 pm
CharlesV wrote: Sun Aug 03, 2025 12:16 pm One more thing... if you do this, please double check afterwards to verify you have the swap partition in use again. (ie make sure swap is on again! )
System operating correctly now (for a given value of 'correctly' within my skill level...).

Your support was the key factor. Thank you.
Excellent! your very welcome and glad it is resolved.

Please mark as solved using the check mark on the top right of the post that resolved it.