• Problem with /var

    From Maureen Thomas@21:1/5 to All on Fri Mar 7 02:30:01 2025
    This is a multi-part message in MIME format.
    I am running Debian 12 fulled updated. I keep getting a message saying
    that my /var is almost full.  What can I safely delete to make more room
    for it.  It is an HP Desktop Mo1-F3xxx, 8gb ram, Realtec Audio, AMD
    Ryzen 5 5600G.  I also have a 2TB Seagate HD plugged in for backups.

    Any help will be greatly appreciated.

    Moe


    <!DOCTYPE html>
    <html data-lt-installed="true">
    <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    </head>
    <body style="padding-bottom: 1px;">
    <p>I am running Debian 12 fulled updated. I keep getting a message
    saying that my /var is almost full.  What can I safely delete to
    make more room for it.  It is an HP Desktop Mo1-F3xxx, 8gb ram,
    Realtec Audio, AMD Ryzen 5 5600G.  I also have a 2TB Seagate HD
    plugged in for backups.</p>
    <p>Any help will be greatly appreciated.</p>
    <p>Moe<br>
    </p>
    <p><br>
    </p>
    </body>
    <lt-container></lt-container>
    </html>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Eben King@21:1/5 to Maureen Thomas on Fri Mar 7 03:10:01 2025
    On 3/6/25 20:24, Maureen Thomas wrote:
    I am running Debian 12 fulled updated. I keep getting a message saying
    that my /var is almost full.  What can I safely delete to make more room
    for it.

    First, find out where the space is being used. Something like baobab
    might be useful. It might the apt cache directory, or some gigantic log
    file, or some file you placed there and forgot.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Greg Wooledge@21:1/5 to Maureen Thomas on Fri Mar 7 03:20:01 2025
    On Thu, Mar 06, 2025 at 20:24:36 -0500, Maureen Thomas wrote:
    I am running Debian 12 fulled updated. I keep getting a message saying that my /var is almost full.  What can I safely delete to make more room for it.  It is an HP Desktop Mo1-F3xxx, 8gb ram, Realtec Audio, AMD Ryzen 5 5600G.  I also have a 2TB Seagate HD plugged in for backups.

    Any help will be greatly appreciated.

    Start with "apt-get clean", unless you are intentionally saving .deb
    files.

    If that doesn't get the job done, then you should actually go into /var
    and *look* and see what's taking all the space.

    Sample starter commands:

    cd /var
    du -sh *
    find . -size +10M -ls

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From John Hasler@21:1/5 to Maureen Thomas on Fri Mar 7 03:40:01 2025
    Maureen Thomas writes:
    There are 15 files in Var and the biggest one is the cache file. Is
    it safe to get rid of the contents of the whole file. It takes up 57%
    of the drive.

    Run the command

    sudo apt-get clean

    That will remove the contents of that file.
    --
    John Hasler
    john@sugarbit.com
    Elmwood, WI USA

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andy Smith@21:1/5 to Maureen Thomas on Fri Mar 7 03:40:01 2025
    Hi,

    On Thu, Mar 06, 2025 at 09:24:20PM -0500, Maureen Thomas wrote:
    There are 15 files in Var and the biggest one is the cache file. Is it safe to get rid of the contents of the whole file.  It takes up  57% of the
    drive.

    Do not go deleting files in /var; you don't know enough about their
    purpose to do that safely. There are tools you can use to safely delete
    things.

    It is safe to clear apt-get's cache with:

    $ sudo apt-get clean

    If you still need to find space after that, show us where it's all gone.

    The command line tool "ncdu" can be helpful but if you don't have it
    then a combination of "du" and "sort" will be useful, e.g:

    $ sudo du -xh /var | sort -rh | head -25

    (top 25 largest directories in /var with human-readable units.)

    Thanks,
    Andy

    --
    https://bitfolk.com/ -- No-nonsense VPS hosting

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andy Smith@21:1/5 to Maureen Thomas on Fri Mar 7 03:50:01 2025
    Hi,

    On Thu, Mar 06, 2025 at 09:33:40PM -0500, Maureen Thomas wrote:
    This is what I got

    root@debian:/home/maureen# apt-get clean

    You didn't show us the "df" output before you did this so we don't know
    how much, if anything, it freed up.

    root@debian:/home/maureen# cd /var

    root@debian:/var# du -sh*

    du: invalid option -- '*'

    Missing space between 'h' and '*' so the '*' was treated as an option,
    which is invalid. The '*' is unnecessary anyway.

    root@debian:/var# du sh

    du: cannot access 'sh': No such file or directory

    Missing '-' before 'sh' so 'sh' was treated as a file and that didn't
    exist.

    root@debian:/var# du -sh

    3.7G .

    "df" output would help us to see how much is actually free now.

    There doesn't really look like that much you could delete. You could
    configure journald to keep less logs but it's kind of a minimal saving.
    If you don't use snaps then you could uninstall all of that and get some
    space back, but probably you had a reason fro installing that.

    Thanks,
    Andy

    --
    https://bitfolk.com/ -- No-nonsense VPS hosting

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Greg Wooledge@21:1/5 to Andy Smith on Fri Mar 7 03:50:01 2025
    On Fri, Mar 07, 2025 at 02:41:33 +0000, Andy Smith wrote:
    On Thu, Mar 06, 2025 at 09:33:40PM -0500, Maureen Thomas wrote:
    root@debian:/home/maureen# cd /var

    root@debian:/var# du -sh*

    du: invalid option -- '*'

    Missing space between 'h' and '*' so the '*' was treated as an option,
    which is invalid. The '*' is unnecessary anyway.

    It's totally necessary.

    root@hobbit:/var# du -sh
    2.1G .
    root@hobbit:/var# du -sh *
    4.0M backups
    124M cache
    40K games
    209M lib
    4.0K local
    0 lock
    1.8G log
    8.0K mail
    4.0K opt
    2.3M qmail
    0 run
    3.6M spool
    32K tmp

    In my case, most of the space is in the "log" subdirectory. So, if I
    felt a need to prune stuff on this system, I would cd into log next,
    and repeat the process, until I found something I felt it was safe to
    truncate or remove.

    (Removing log files is often ineffective, because they're kept open
    by whatever's writing to them; truncating them works, though.)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Christensen@21:1/5 to Maureen Thomas on Fri Mar 7 04:00:01 2025
    On 3/6/25 17:24, Maureen Thomas wrote:
    I am running Debian 12 fulled updated. I keep getting a message saying
    that my /var is almost full.  What can I safely delete to make more room
    for it.  It is an HP Desktop Mo1-F3xxx, 8gb ram, Realtec Audio, AMD
    Ryzen 5 5600G.  I also have a 2TB Seagate HD plugged in for backups.

    Any help will be greatly appreciated.

    Moe


    Short term solution:

    # apt-get autoremove

    # apt-get autoclean


    Long term solution:

    That sounds like the traditional problem of how to partition your disks
    -- no matter how you do it, one partition always fills up first.


    I have a SOHO network with various clients and a file server. I am the
    only user on my Debian machines, so that simplifies things.


    I put each Debian instance on a small, fast SSD. I use d-i to partition manually as follows:

    1 GB boot
    1 GB encrypted swap
    13 GB LUKS encrypted root


    I keep the Debian instance small so that it fits onto a single "16 GB"
    device -- HDD, SSD, USB flash drive, SD card, etc.. This expedites
    image creation, expedites image restoration, and reduces image storage requirements. Disaster recovery consists of restoring the last image,
    updating the OS, and restoring the last /home backup.


    I mount my file server personal directory at /samba/dpchrist and create symlinks from /home/dpchrist/* to /samba/dpchrist/* directories as
    desired. The idea is to keep terminals and Thunar responsive even if
    the network or file server go down.


    If you have a single computer, you could use a NAS, RAID, or HDD in
    place of a file server.


    David

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stefan Monnier@21:1/5 to All on Fri Mar 7 05:40:01 2025
    Maureen Thomas [2025-03-06 20:24:36] wrote:
    I am running Debian 12 fulled updated. I keep getting a message saying that my /var is almost full. What can I safely delete to make more room for it.

    Depends on all kinds of things. Questions that come to mind:

    - Why do you have a separate /var partition?
    - How big is it and how much space do you have elsewhere on the same disk?
    - What is that "it" that you want to make room for?

    David Christensen [2025-03-06 18:58:12] wrote:
    I prefer:
    [...]
    # du -d 2 -m /var | sort -rn | head

    Agreed. I personally use just `du | sort -n` (I can't see the benefit
    of the `-d2` and I rely on the terminal's scrolling to filter out the
    small fry instead of using `-r` and `head`).
    But indeed, the `-m` is a good idea, thanks (never bothered to look for
    such a thing).


    Stefan

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From The Wanderer@21:1/5 to Greg Wooledge on Fri Mar 7 05:30:02 2025
    This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
    On 2025-03-06 at 21:47, Greg Wooledge wrote:

    On Fri, Mar 07, 2025 at 02:41:33 +0000, Andy Smith wrote:

    On Thu, Mar 06, 2025 at 09:33:40PM -0500, Maureen Thomas wrote:

    root@debian:/home/maureen# cd /var

    root@debian:/var# du -sh*

    du: invalid option -- '*'

    Missing space between 'h' and '*' so the '*' was treated as an option,
    which is invalid. The '*' is unnecessary anyway.

    It's totally necessary.

    root@hobbit:/var# du -sh
    2.1G .
    root@hobbit:/var# du -sh *
    4.0M backups
    124M cache
    40K games
    209M lib
    4.0K local
    0 lock
    1.8G log
    8.0K mail
    4.0K opt
    2.3M qmail
    0 run
    3.6M spool
    32K tmp

    My reflex would be to use

    # du -h --max=1 /var/

    or

    root@host:/var# du -h --max=1

    which gives very similar results (albeit in a different order) without
    the use of the wildcard, but is of course extra typing.

    There might be other reasons why the use of the wildcard would be
    preferable; the one that springs to my mind is that I would expect it to
    skip dotfiles (and dot-directories) if any are present, but I also
    wouldn't expect there to be any in /var/.

    I use du's '--max=' option fairly frequently, compared to how often I
    use du at all. I find it useful, but your mileage may vary.

    --
    The Wanderer

    The reasonable man adapts himself to the world; the unreasonable one
    persists in trying to adapt the world to himself. Therefore all
    progress depends on the unreasonable man. -- George Bernard Shaw


    -----BEGIN PGP SIGNATURE-----

    iQIzBAEBCgAdFiEEJCOqsZEc2qVC44pUBKk1jTQoMmsFAmfKdAUACgkQBKk1jTQo MmtXYA/6AmNZJ35SAvyp6IlL68weJWKYuRo/VEYc382RYgG/vqkLkATLfW6KaJAw XxyujDiym/uLexqifYNNR+SXKP4yXs+ZJ3oO2G0D4uqMdV+zZI6PawnC7F3pw2+2 JKrK5WzrJ2fkUmc5+VYgDugRbRTc3DOK/Y2ZCwHchsbU4SuqvyUEjFxkAiJRX3hM pKEc0B+trbZPZOj94DULmkCF2xxwMyZSaLL0/sWkRNh9HELyTXtR56No3evzjpfg C49n/wXJW55vtQnPkK2VnHKRpQ1tcSxWTvSZDtDExlX1D6RzjpLJVTmCgbJrekdc Cr+ICpExTU5A4HvgKQpoVn43PR+9ABrV44yAZufxgl8LQVuJF5iyHcB7JlYIuig0 IjC0ZGUnQ6dTWGUw3LnCSY14OppMK8yDrDX9lOp/vh0SW74zEJ6DKU7D09o3A7lD peFNyTUbTaKZwTT+Ogf5IrfDtWnfPEAoVSm4CjHw7/eE3ZJ7KQvnaAxHIyMNcXEA iRIbHarpgdVvg0c9yPG0IZMv1rRAoBRWCfBthuqbBUNoWSQ3OSm+d353+OfMNZsJ NMr+cCnfNzDJY5UqAyaaMJyrScXlRH5DmUDwF3acU2nmayAXI6u1QhLTsuywkMTG IPpaM9hXkSLOiywLtMgzcDlMPuy9
  • From Felix Miata@21:1/5 to All on Fri Mar 7 06:40:01 2025
    Maureen Thomas composed on 2025-03-06 21:24 (UTC-0500):

    There are 15 files in Var and the biggest one is the cache file. Is it
    safe to get rid of the contents of the whole file.  It takes up  57% of
    the drive.

    The cache directory in /var/ normally grows with every update and upgrade, holding
    the downloaded packages from which those transactions sprout. In installations in
    which space is limited, the content of that directory needs at least to be monitored, while it's easier simply to empty it after updates and upgrades are successfully completed:

    sudo apt-get clean
    or
    sudo apt clean

    Monitoring disk space consumption is eminently easy and straight-forward by running the ncdu utility.
    --
    Evolution as taught in public schools is, like religion,
    based on faith, not based on science.

    Team OS/2 ** Reg. Linux User #211409 ** a11y rocks!

    Felix Miata

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Chris Green@21:1/5 to Eben King on Fri Mar 7 08:30:01 2025
    Eben King <eben@gmx.us> wrote:


    On 3/6/25 20:24, Maureen Thomas wrote:
    I am running Debian 12 fulled updated. I keep getting a message saying
    that my /var is almost full.  What can I safely delete to make more room for it.

    First, find out where the space is being used. Something like baobab
    might be useful. It might the apt cache directory, or some gigantic log file, or some file you placed there and forgot.

    One of the major users of space in /var is the systemd journal files.
    Here's the sizes of /var subdirectories on my laptop:-

    root@t470# du -sm *
    5 backups
    176 cache
    1 ipp-usb
    311 lib
    1 local
    0 lock
    2586 log
    1 mail
    4 opt
    0 run
    8 spool
    1 tmp
    7 www

    /var/log (which is where systemd puts its log files) is by far the
    biggest. If you then go and look in /var/log you will almost certainly
    find that nearly all the spoace sonsumed is in /var/log/journal, the
    systemd journal files.

    THe systemd journal file defaults for length of time they are kept and
    maximum size etc. are OK[ish] for systems with lots of disk space but
    are far too large for smaller systems.

    On systems I have with limited space I modify /etc/systemd/journald.conf
    to reduce disk usage, I set the SystemMaxUse and MaxRetentionSec
    parameters.

    --
    Chris Green
    ·

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Greg Wooledge@21:1/5 to Stefan Monnier on Fri Mar 7 13:20:01 2025
    On Thu, Mar 06, 2025 at 23:36:34 -0500, Stefan Monnier wrote:
    David Christensen [2025-03-06 18:58:12] wrote:
    I prefer:
    [...]
    # du -d 2 -m /var | sort -rn | head

    Agreed. I personally use just `du | sort -n` (I can't see the benefit
    of the `-d2` and I rely on the terminal's scrolling to filter out the
    small fry instead of using `-r` and `head`).
    But indeed, the `-m` is a good idea, thanks (never bothered to look for
    such a thing).

    Yeah, I didn't know about -m either. I know about -k because I come
    from a commercial Unix background, where we have:

    DU(1POSIX) POSIX Programmer's Manual DU(1POSIX)

    SYNOPSIS
    du [-a|-s] [-kx] [-H|-L] [file...]

    and that's it. In such an environment, I might use something like

    du -sk * | sort -n

    and just live with the much larger numbers that are printed.
    (I agree with the "let the terminal scroll the little ones away"
    approach, by the way. As long as you're not accessing the system
    over a slow connection.)

    However, when giving advice to Maureen, I wasn't trying to give her
    a complicated recipe. I was trying to give her *simple* commands
    that she could use to investigate her system and find where the
    space was being used. (Good thing I didn't go complicated, either,
    as it turned out she even messed up "du -sh *".)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Peter Hillier-Brook@21:1/5 to Maureen Thomas on Fri Mar 7 15:10:02 2025
    On 07/03/2025 01:24, Maureen Thomas wrote:
    I am running Debian 12 fulled updated. I keep getting a message saying
    that my /var is almost full.  What can I safely delete to make more room
    for it.  It is an HP Desktop Mo1-F3xxx, 8gb ram, Realtec Audio, AMD
    Ryzen 5 5600G.  I also have a 2TB Seagate HD plugged in for backups.

    Any help will be greatly appreciated.

    Moe


    Fully updated is probably the clue. If you run `sudo apt-get clean` it
    will empty the apt cache and you will probably find a much reduced /var
    usage. I did this recently for the same problem and regained several
    gigabytes.

    Peter HB

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)