Cleaning root partition properly

I have some installations (SLES 12 SP3 or SP5) done on tiny disk (4GB with 3GB for / ), it's something "historical", inherited since many years.
I installed only needed packages : at first installation, space is enough, consuming "only" 72% of /.
Monthly, I propose an update: the first time / consumption rises to 74%, one month later to 79% and so on, month after month.
For each update, I make a 'zypper clean' to delete downloaded packages and reboot the server. There is no snapshot in snapper directory, tmp directory is almost empty (48K in my last example).
Is there any way to clean and free more space after some installations ? Or disk is just beginning too small ?


  • malcolmlewismalcolmlewis Knowledge Partner
    edited November 2020

    @Frederic Hi,
    So these systems are using btrfs? If so, there are maintenance routines that should run? Likewise use the btrfs tools to see actual space used/free.
    Also check log locations, might need to tweak the journal rotation, zypper and it's history, etc?

    btrfs fi df /
    Data, single: total=9.01GiB, used=6.87GiB
    System, single: total=32.00MiB, used=16.00KiB
    Metadata, single: total=520.00MiB, used=194.89MiB
    GlobalReserve, single: total=18.42MiB, used=0.00B
     btrfs fi du -s /
         Total   Exclusive  Set shared  Filename
       6.84GiB     6.84GiB       0.00B  /
    btrfs filesystem show /
    Label: 'sles152'  uuid: 
        Total devices 1 FS bytes used 7.06GiB
        devid    1 size 40.00GiB used 9.55GiB path /dev/sda3
    btrfs fi du -s /var
         Total   Exclusive  Set shared  Filename
     271.77MiB   271.77MiB       0.00B  /var
    btrfs fi du -s /var/log
         Total   Exclusive  Set shared  Filename
      32.31MiB    32.31MiB       0.00B  /var/log
  • FredericFrederic New or Quiet Member

    These servers don't use the btrfs :(
    I made a server on my lab to reproduce the process quickly (but without a real ageing process with logs rotation), I can see after 3 updates, that the / size seems to stabilize. After update and before rebooting the server, / size rises to 85-86% and after reboot, comes back to 80% (after the old lib removal I think).
    No snapshot, zypper clean done, removal of older libs... if there is no other tips to gain some space, I think I will push the issue to my development team and their own code or maybe it's time to rise the disk size.

  • malcolmlewismalcolmlewis Knowledge Partner

    Then /var/logs and /tmp directory would be my first port of call and /var/cache as well with du -sh /some_dir.

  • FredericFrederic New or Quiet Member

    Yes, /var/logs and /tmp have been the first directories that I checked but they were almost empty (56K for /tmp...).
    I retrieved the binary from my development team and installed it : the free space is really tiny (94% of / is used). I assume that the free space is not always sufficient for updates.

    I was looking for any tips since the OS seems to be behaving correctly regarding disk space management, something I could have done in addition.
    I will simply recommend to increase the disk size.
    Thanks for the help @malcolmlewis

Sign In or Register to comment.