PDA

View Full Version : Bloated installation ... how to reduce size ?



massai
01-23-2004, 03:03 AM
Hello,

Right now when I look at the "storage devices" (under info center in KDE) I see that my installation is a lean-mean, tiny-piny, microscopic, compact 3.7GB !!
(This is a 4 GB hard drive)

I would like to remove the fat and leave only the absolute essentials without breaking dependencies or removing important system files.

Where should I start ??

nmcphillips
01-23-2004, 04:07 AM
I found this article that might interest you. http://gnubox.dyndns.org:8080/~sunil/knoppixtweak.php

massai
01-23-2004, 04:22 AM
Thank You !!


.........
I also see some remove scripts in Kano's script page:
http://kano.mipooh.net/

massai
01-23-2004, 05:51 PM
Shoot, after using the "kicklist from Thomas Thonikuzhiyil and the "kano" scripts I was able to trim away 1GB. Now my instalation is down to 2.5GB ..... still too BIG.

I would like to get it down to less than 1 GB actually 800Mb should be sweet.

Is this realistic ? Is it possible to be 800Mb and still functional ?


.......
Shoot, one more thing. Now every time I try to say "apt-get dist-upgrade" it wants to put back on the 1GB that I just took off...

.....
oops, I shouldn't have removed the xawtv, because I do have a TVcard.

Stephen
01-23-2004, 07:12 PM
Shoot, after using the "kicklist from Thomas Thonikuzhiyil and the "kano" scripts I was able to trim away 1GB. Now my instalation is down to 2.5GB ..... still too BIG.

I would like to get it down to less than 1 GB actually 800Mb should be sweet.

Is this realistic ? Is it possible to be 800Mb and still functional ?


.......
Shoot, one more thing. Now every time I try to say "apt-get dist-upgrade" it wants to put back on the 1GB that I just took off...

.....
oops, I shouldn't have removed the xawtv, because I do have a TVcard.

It's definitely possible to get it around that size:


>$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hdb2 4.7G 2.7G 2.0G 58% /
/dev/hda3 9.4G 2.6G 6.8G 28% /home
/dev/hda5 47G 23G 24G 49% /music
[01:55 PM Fri Jan 23: stephen @ ~]
>$ du -h /var/cache/apt/archives/
512 /var/cache/apt/archives/partial
1.2G /var/cache/apt/archives
[01:55 PM Fri Jan 23: stephen @ ~]
>$ du -h /usr/src
665M /usr/src



As you can see if I wanted to get rid the .debs in my cache and eliminate the 2 source trees for the 2.4.24 & 2.6.1 for the kernels I have installed I would only be using about 1gb and I have most of KDE, mplayer and all kinds of other software installed. What is it trying to install when you do the dist-upgrade there's no way you should be getting a gb reinstalled you should try just upgrade to upgrade the programs that you have installed and not let it install the new packages that dist-upgrade does by design.

massai
01-23-2004, 09:31 PM
hmm, so here it is where I learn to use the "du" command for the first time...
...now I have to open up the O'Reily book to make sure I do it right:

so here we go ....
du --max-depth=1 -m / |sort -nr > /home/massai/tmp/folderSize1.text

(output in Megabytes)


3162 /
1855 /usr
705 /proc
236 /opt
137 /var
70 /home
55 /lib
45 /root
36 /etc
9 /sbin
7 /Desktop
4 /boot
4 /bin
2 /.mozilla
1 /tmp
1 /share
1 /none
1 /mnt
1 /lost+found
1 /initrd
1 /floppy
1 /dvd
1 /dev
1 /cdrom1
1 /cdrom
1 /cdaudio
1 /.qt
1 /.mcop


It looks like the "/proc" and "usr" directories are the main culprits

There is pobably nothing I can do about the "/proc" since it relates to the modules I included while compiling the kernel. (I included more modules than needed because I anticipate building a new AMD machine when platform 939 comes out sometime this quarter. So I build-in some future functionality to the kernel so as to plug in this HD on the new machine and play with Linux without having to recompile....We will see if this will work as planned... if at all)

now in regards to the /usr directory:

du --max-depth=1 -m /usr |sort -nr > /home/massai/tmp/folderSize2.text


1855 /usr
679 /usr/share
551 /usr/lib
305 /usr/src
155 /usr/bin
122 /usr/X11R6
24 /usr/include
15 /usr/sbin
6 /usr/games
1 /usr/man
1 /usr/local
1 /usr/kde
1 /usr/etc
1 /usr/doc


Shoot, the kernel source for 2.6.1 is 222Mb (yeesh that too big, what was I thinking?) and the source for 2.4.22 is 29Mb (obviously Mr Knopper knows better than this feeble newbie).

So (hypotheticaly speaking) if the /usr and /proc directories were reduced to zero(0) the rest of the system is 602Mb.

The question is:
Is it possible to have a /usr and /proc fit within 200-250Mb space ? (and still have some build-in hardware flexibility/expandability in the kernel)

Stephen
01-24-2004, 01:41 AM
It looks like the "/proc" and "usr" directories are the main culprits


The /proc is not the problem size wise that is just the system mounted and running.



HappyTux:/home/stephen# du -h /proc
[snip...]
9.0K /proc/5693/task/5693
9.0K /proc/5693/task
7.0K /proc/5693/fd
16K /proc/5693
770M /proc
HappyTux:/home/stephen# mount /dev/hda2 /misc
HappyTux:/home/stephen# du -h /misc/proc
512 /misc/proc
HappyTux:/home/stephen# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hdb2 4.7G 2.7G 2.0G 58% /
/dev/hda3 9.4G 2.6G 6.8G 28% /home
/dev/hda5 47G 23G 24G 49% /music
/dev/hda2 4.7G 2.5G 2.3G 53% /misc


As you can see /dev/hda2 which is my main partition (the /dev/hdb2 I am using for / is a clone of it except for an apt-get upgrade and 2.6.1 source tree & kernel) has about the same space that is in use on my running system so the programs in the /usr are using the space. To get rid of the excess packages that you want to do you should get a list of the packages by dpkg --get-selections > selections.txt then use the list with apt-cache show package_name to check to see what it does if you think you do not need it then remove it don't forget the --purge option to get rid of the configuration files and make sure you run the orphaner program that is in the Knoppix menus somewhere to get rid of the ophaned files as well.







There is pobably nothing I can do about the "/proc" since it relates to the modules I included while compiling the kernel. (I included more modules than needed because I anticipate building a new AMD machine when platform 939 comes out sometime this quarter. So I build-in some future functionality to the kernel so as to plug in this HD on the new machine and play with Linux without having to recompile....We will see if this will work as planned... if at all)


You should be able to boot with the old knoppix kernel in the 32bit mode with the chip but I'm not positive about that one. If it will boot with the old kernel then you should recompile the kernel for the chipset on the motherboard and any other hardware changes and change the kernel type for the processor(s) and install it. I did this last year when I went from a Celeron to an AthlonXP it is a fairly painless process. There's a amd64 mailing list on the Debian site you should be able to find some more useful information from there.




Shoot, the kernel source for 2.6.1 is 222Mb (yeesh that too big, what was I thinking?) and the source for 2.4.22 is 29Mb (obviously Mr Knopper knows better than this feeble newbie).

Those are the kernel headers not the actual kernel source you can compile them (with the kernel_headers option) and install the .deb and then you in theory do not need the kernel source installed to be able to compile modules like the nvidia driver although the 2.6.1 seems to need the kernel tree there to compile I thought I had it tracked down where it failed in the nvidia script but I could not get it to work.


So (hypotheticaly speaking) if the /usr and /proc directories were reduced to zero(0) the rest of the system is 602Mb.

The question is:
Is it possible to have a /usr and /proc fit within 200-250Mb space ? (and still have some build-in hardware flexibility/expandability in the kernel)

It is certainly possible to get the system that small it depends on what programs you want installed but that really has nothing to do with the hardware support in the kernel other than the amount of space the modules being built and installed take up on the drive in other words the hardware support depends on the kernel support not the size of the system that is installed along with the kernel.