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

Message
Author
LateJunction
Posts: 91
Joined: Fri Sep 16, 2022 4:54 am

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

#11 Post 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).

User avatar
j2mcgreg
Global Moderator
Posts: 7249
Joined: Tue Oct 23, 2007 12:04 pm

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

#12 Post 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/
HP 15; ryzen 3 5300U APU; 500 Gb SSD; 8GB ram
HP 17; ryzen 3 3200; 500 GB SSD; 12 GB ram
Idea Center 3; 12 gen i5; 256 GB ssd;

In Linux, newer isn't always better. The best solution is the one that works.

LateJunction
Posts: 91
Joined: Fri Sep 16, 2022 4:54 am

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

#13 Post 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?

LateJunction
Posts: 91
Joined: Fri Sep 16, 2022 4:54 am

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

#14 Post 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?.

User avatar
j2mcgreg
Global Moderator
Posts: 7249
Joined: Tue Oct 23, 2007 12:04 pm

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

#15 Post 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.
HP 15; ryzen 3 5300U APU; 500 Gb SSD; 8GB ram
HP 17; ryzen 3 3200; 500 GB SSD; 12 GB ram
Idea Center 3; 12 gen i5; 256 GB ssd;

In Linux, newer isn't always better. The best solution is the one that works.

User avatar
oops
Posts: 2035
Joined: Tue Apr 10, 2018 5:07 pm

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

#16 Post by oops »

... You can also use a GUI to check the sizes: baobab (or in sudo: ncdu -x / --exclude home )
Pour les nouveaux utilisateurs: Alt+F1 pour le manuel, ou FAQS, MX MANUEL, et Conseils MX Conseils Debian - Info. système “quick-system-info-mx” (QSI) ... Ici: System: MX-19-23_x64 & antiX23_x32 runit

User avatar
CharlesV
Administrator
Posts: 8130
Joined: Sun Jul 07, 2019 5:11 pm

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

#17 Post 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.
*QSI = Quick System Info from menu (Copy for Forum)
*MXPI = MX Package Installer
*Please check the solved checkbox on the post that solved it.
*Linux -This is the way!

LateJunction
Posts: 91
Joined: Fri Sep 16, 2022 4:54 am

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

#18 Post 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?

User avatar
CharlesV
Administrator
Posts: 8130
Joined: Sun Jul 07, 2019 5:11 pm

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

#19 Post 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!
*QSI = Quick System Info from menu (Copy for Forum)
*MXPI = MX Package Installer
*Please check the solved checkbox on the post that solved it.
*Linux -This is the way!

User avatar
CharlesV
Administrator
Posts: 8130
Joined: Sun Jul 07, 2019 5:11 pm

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

#20 Post 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! )
*QSI = Quick System Info from menu (Copy for Forum)
*MXPI = MX Package Installer
*Please check the solved checkbox on the post that solved it.
*Linux -This is the way!

Post Reply

Return to “Hardware /Configuration”