LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-20-2023, 11:49 AM   #1
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,319

Rep: Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328
Savage Space Saving


I needed to save space on an undersized / partition. I had had to move a (generous) swap file to /home. After backing up the full install, I
  • Deleted obsolete X fonts and video drivers.
  • Deleted /usr/doc/ (Saved 1.3G)
  • Deleted /usr/share/ (Saved 4.7G)
  • As I'm using XFCE, so I removed every kde package. (Saved 1.5G)

All estimates are approximate. I repeat, I have a full backup and this is an Arm box. Do any of you expect consequences from this surgery, and why? I have a vague nag in my head that some kde libs might actually be useful. . .
 
Old 10-20-2023, 12:06 PM   #2
tadgy
Member
 
Registered: May 2018
Location: UK
Distribution: Slackware (servers), Void (desktop/laptop)
Posts: 299

Rep: Reputation: 401Reputation: 401Reputation: 401Reputation: 401Reputation: 401
Quote:
Originally Posted by business_kid View Post
  • Deleted /usr/share/ (Saved 4.7G)
Deleting /usr/share was not very clever to be perfectly honest.

There is a lot of stuff placed in /usr/share that is required for the packages installed to operate correctly. One very simple example is /usr/share/terminfo or /usr/share/ca-certificates.

You are going to need your backup
 
4 members found this post helpful.
Old 10-20-2023, 12:08 PM   #3
henca
Member
 
Registered: Aug 2007
Location: Linköping, Sweden
Distribution: Slackware
Posts: 969

Rep: Reputation: 656Reputation: 656Reputation: 656Reputation: 656Reputation: 656Reputation: 656
I would have been careful to remove /usr/share, maybe it contains some icons or sound files that you want in XFCE.

Myself I prefer to have a rather small / partition and keep /usr on its own partition. For you this might be a good time to creata an own partition for /usr and get space on / by moving things there. If you don't want to move everything below /usr there are also other candidates of directories suitable for having partitions of their own like /tmp, /var, /home and /opt. (I understand that you already have /home on a partition of its own). If your /usr/local is big it might also be a candidate for a partition of its own.

I also prefer XFCE, but sometimes run KDE applications like k3b and kdiff3.

Instead of deleting files or directories, I would prefer to remove packages to have a system with installed files that match what my package manager thinks is installed.

regards Henriks
 
Old 10-20-2023, 01:06 PM   #4
Pithium
Member
 
Registered: Jul 2014
Location: Far side of the Oregon Trail
Distribution: Slackware64 15.0
Posts: 502

Rep: Reputation: 586Reputation: 586Reputation: 586Reputation: 586Reputation: 586Reputation: 586
/usr/share is used for non executable assets in for various packages. This includes default configuration files and icons.

In particular, it holds the application launchers used by xdg compliant desktops, such as XFCE. Don't close your web browser.. because you won't be able to open it back up.
 
Old 10-20-2023, 01:12 PM   #5
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,232

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
So you deleted /usr/share/applications and /usr/share/fonts? I want to see a screenshot.
 
1 members found this post helpful.
Old 10-20-2023, 02:00 PM   #6
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,319

Original Poster
Rep: Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328
Right. I completely forgot about /usr/share fonts. Bad day for me, obviously.

It's no big deal, I can drop in an sdcard and reboot. The sdcard has boot priority and the complete system. The fonts I clean forgot. I genuinely didn't know so much other stuff was used, because I suppose so much of what's there is unused.

I can rsync /usr/share back over to the HD from the SDCard. It's backed up on disk as well. Thanks guys.

Last edited by business_kid; 10-20-2023 at 02:04 PM.
 
Old 10-20-2023, 04:37 PM   #7
jayjwa
Member
 
Registered: Jul 2003
Location: NY
Distribution: Slackware, Termux
Posts: 780

Rep: Reputation: 248Reputation: 248Reputation: 248
Remove unused packages, compress stuff you don't use much, and strip binaries that might have debug info (be careful of some like ocaml binaries you shouldn't strip). If you're desperate, you usually can remove shared libraries that are similar version. For example, if you have libwhatever.so.a.b.c, where a-c are integers, you can delete those that differ in position 'c' but not 'a' nor 'b'. Ex: libwhatever.so.1.2.20 and libwhatever.so.1.2.21 you could delete libwhatever.so.1.2.20. Make sure the short name symlink of the library points to the latest version.
Code:
libsigsegv.so.2@
libsigsegv.so.2.0.6*
libsigsegv.so.2.0.7*
Remove old Linux kernel sources, check for unruly caches and image thumbnails. Remove man pages in languages you don't use, or sections you don't care about. That /usr/share is going to hurt...
 
Old 10-20-2023, 05:34 PM   #8
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,456
Blog Entries: 7

Rep: Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560
Instead of removing things, you can save over 1Gb by compressing the contents of /usr/doc and the kernel modules:
Code:
# for i in `find /usr/doc -type f`; do gzip $i; done
# for i in `find /lib/modules -type f -name '*.ko'`; do gzip $i; done
# depmod -a
 
3 members found this post helpful.
Old 10-20-2023, 05:44 PM   #9
0XBF
Member
 
Registered: Nov 2018
Distribution: Slackware
Posts: 769

Rep: Reputation: 867Reputation: 867Reputation: 867Reputation: 867Reputation: 867Reputation: 867Reputation: 867
Quote:
Originally Posted by rkelsen View Post
Instead of removing things, you can save over 1Gb by compressing the contents of /usr/doc and the kernel modules:
Code:
# for i in `find /usr/doc -type f`; do gzip $i; done
# for i in `find /lib/modules -type f -name '*.ko'`; do gzip $i; done
# depmod -a
Any downside to this other than some added decompressing time loading docs and modules at boot? Is the added time significant?

Just wondering why saving space like that isn't default.
 
Old 10-20-2023, 07:38 PM   #10
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,456
Blog Entries: 7

Rep: Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560
^ No noticeable time difference here.

Maybe it's not the default because it probably would be noticeable on low end hardware.
 
Old 10-21-2023, 07:32 AM   #11
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,319

Original Poster
Rep: Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328
Thank you all for the replies and for steering me out of my mess.

Well I have my backed up /usr/share restored. Of course, with the day that was in it, the sdcard chose that exact moment to act up But my hard disk backup did the trick. I am writing this on my RazPi.

I'm not going to search for similarly-named libraries with slightly lower versions, because it's not worth the effort. This RazPi is on current, which changes. Updating one package could break several programs. /usr/doc is gone, as I have it upstairs. kde was installed as part of the '-xfce-' image With a full backup and a ~Current mirror, I can reinstall quicker than archiving. Normally, there's no point for an OS to save disk space. Minimum disk sizes are ever-increasing.

With RPi OS, the install was ~6G, so 25G for / looked plenty. I needed space for media. Debian Buster proved obnoxious and arm support was non-existent. Then Slarm64 & Slackware Aarch64 came along, which were different propositions.

I had 3G on / and no room for a swapfile. Slarm64 has a repo with utilities, other WMs, and browsers. Box64 even allows x86_64 stuff to run.

EDIT: I couldn't fulfill the screenshot request. I deleted /usr/share via ssh, and the X had fallen on it's sword by the time I came down
 
Old 10-22-2023, 05:28 AM   #12
Petri Kaukasoina
Senior Member
 
Registered: Mar 2007
Posts: 1,795

Rep: Reputation: 1474Reputation: 1474Reputation: 1474Reputation: 1474Reputation: 1474Reputation: 1474Reputation: 1474Reputation: 1474Reputation: 1474Reputation: 1474
Quote:
Originally Posted by rkelsen View Post
Instead of removing things, you can save over 1Gb by compressing the contents of /usr/doc and the kernel modules:
Code:
# for i in `find /usr/doc -type f`; do gzip $i; done
# for i in `find /lib/modules -type f -name '*.ko'`; do gzip $i; done
# depmod -a
Quote:
Originally Posted by 0XBF View Post
Any downside to this other than some added decompressing time loading docs and modules at boot? Is the added time significant?

Just wondering why saving space like that isn't default.
I compress both modules and kernel-firmware files using xz. But I don't use initrd. mkinitrd does not copy compressed modules or firmware files to the initrd.
 
1 members found this post helpful.
Old 10-28-2023, 04:58 PM   #13
lazardo
Member
 
Registered: Feb 2010
Location: SD Bay Area
Posts: 270

Rep: Reputation: Disabled
Quote:
Originally Posted by business_kid View Post
I needed to save space on an undersized / partition. ...
Alternative approach:
a) use rsync '--exclude-from=' to download which eliminates well known items up front:
Code:
# example
- source/
- pasture/
- testing/
- kde/
- grub-*
- haveged-*
- hplip-*
- krb5-*
- krusader-*
- llvm-*
- netatalk-*
b) post-install, remove packages by weight:
Code:
$ pkgsize | sort -nr | head
  11534336K kernel-source-5.15.19-noarch-2
    916480K kernel-firmware-20230725_b6ea35f-noarch-1
    750592K libreoffice-7.4.2-x86_64-1alien
    402432K qt5-5.15.3_20220318_e507d3e5-x86_64-1_slack15.0
    397312K llvm-13.0.0-x86_64-2
    328704K kernel-modules-6.1.7-x86_64-1
    319488K mariadb-10.5.22-x86_64-1_slack15.0
    302080K kernel-modules-5.15.19-x86_64-2
    256000K mozilla-thunderbird-115.3.2-x86_64-1_slack15.0
    254976K mozilla-firefox-115.3.1esr-x86_64-1_slack15.0
Code:
#!/bin/bash
# pkgsize

while read a b c d; do
    case $a in
        PACKAGE) [ "$b" != "NAME:" ] && continue
            name=$c
            ;;
        UNCOMPRESSED) [ "$c" != "SIZE:" ] && continue
            size=${d:0:(-1)}
            size=$(( ${size/./} * 10 / 10 ))    # decimal

            case ${d:(-1)} in
                M) (( size *= 1024 )) ;;
                G) (( size *= ( 1024 * 1024 ) )) ;;
            esac

            printf "%10sK %s\n" $size $name
            ;;
    esac
done < <( cat /var/log/packages/* | grep '^[PU][AN]' )
 
Old 10-28-2023, 06:24 PM   #14
enine
Senior Member
 
Registered: Nov 2003
Distribution: Slackʍɐɹǝ
Posts: 1,486
Blog Entries: 4

Rep: Reputation: 282Reputation: 282Reputation: 282
I'm running the minirootfs on the beagelbone black 4G storage
 
Old 10-29-2023, 05:56 AM   #15
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,319

Original Poster
Rep: Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328
Good of you to be exercising your minds on this. I did settle on a fix.

I have removed some obvious crud: kde; /usr/doc; never installed HOWTOs or Emacs; As for programs - seamonkey & thunderbird; don't have libreoffice; Obsolete & foreign fonts; pci video drivers from the last millenium, are all gone. Reinstalled /usr/share.

After adding a few preferred programs, There's 5.6G on / with the swap file on /home. My swap file is 8G(!) because Zoom, and swap file usage on Zoom was ballooning on box64. I made that ultra-big for testing purposes. But PitSeb has added this 'SAVE_MEM' option which drastically cuts memory usage.

5.6GB is not great, but it will do. I have ≅115GB of videos on home currently. I can pull those off and repartition if needed. It just means 100G of copying.

Another thing is that Slarm64 images used provide a lean version of slackware, but it now comes with everything, so install size has increased.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Division of Logical Memory Space in to User Space and Kernel Space shreshtha Linux - Newbie 2 01-14-2010 09:59 AM
XFree86,Biostar M7VIG Motherboard, S3 Savage 4 video - problem Barty Linux - Hardware 5 09-20-2004 03:07 PM
Savage 4 nazir Linux - Hardware 3 09-20-2004 03:05 PM
XFree86/S3 Savage/IBM T20 swamitommi Linux - Hardware 4 12-19-2003 08:30 AM
saving and not saving sessions on desktop ergo_sum Linux - Newbie 2 09-26-2003 07:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration