LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Limited Disk Space, Strip executables? (https://www.linuxquestions.org/questions/linux-general-1/limited-disk-space-strip-executables-331232/)

pentalive 06-07-2005 10:09 AM

Limited Disk Space, Strip executables?
 
I am running Redhat 7.3 on an IBM thinkpad 385CD, Blackbox WM (x) for C programming development of console applications....

df -h says I only have about 382M left free (well that's not bad, but it could be better)

I only have gnome installed and would like to squeeze more of KDE in.

I'ts a laptop, replacing the hard drive is **hard** (It's not even behind an external door
I would probably have to disassemble this puppy to change it)

anyway. I seem to have a lot of executables that have not been stripped. Does anyone see any
problem stripping all of them? Do you think it will be worthwhile to do so?

Thanks!
ron.

trickykid 06-07-2005 10:57 AM

df -h output please..

And stripping of all executables? You do realize that the majority that reside in /usr are ones that are probably necessary for your system to even function..

Kdr Kane 06-07-2005 11:37 AM

He means to strip out the debug information. I think.

I don't see any reason not to do that. Of course, I might not know a good reason to keep the debug information in the files.

pentalive 06-07-2005 01:45 PM

yup, strip removes the debugging information. I don't see myself debugging the 'ls' command.

Filesystem size Used Avail Mounted
/dev/hda3 1.8g 1.4g 382m 79% /
/dev/hda1 41m 32m 9.4m 78% /dos
none 22m 0 22m 0% /dev/shm

trickykid 06-07-2005 01:57 PM

Quote:

Originally posted by pentalive
yup, strip removes the debugging information. I don't see myself debugging the 'ls' command.

Filesystem size Used Avail Mounted
/dev/hda3 1.8g 1.4g 382m 79% /
/dev/hda1 41m 32m 9.4m 78% /dos
none 22m 0 22m 0% /dev/shm

Before removing any executables, have you poked around in /var and /tmp for any log and temp files to possibly remove first to save some space?

pentalive 06-07-2005 02:44 PM

Quote:

Originally posted by trickykid
Before removing any executables, have you poked around in /var and /tmp for any log and temp files to possibly remove first to save some space?
trickykid... Strip only removes the debugging information from the executables. After stripping they still run the same way they always had. After Stripping there is just no debugging information (the names of the variables, subroutines addresses. so the debugger can show you things by name. (I don't know is the source code referenced in there so the debugger can say your on line 30 of foo.c? )

anyway deleting that sort of information from each executable leaves it running but somewhat smaller. My question is, Red Hat did not strip these before I got them, Is there any reason I can't? Is there something I am not thinking about?

Thanks for the idea of checking my /var directory and other log files.

SciYro 06-07-2005 05:04 PM

you said it want make a difference, so do it, gentoo does, and i don't see any side effects

but i don't think you'll see a big space gain

pentalive 06-07-2005 05:58 PM

ls -lhS emacs emacs is 4.1 mb

strip emacs
ls -lhS emacs emacs is 3.9 mb

hmmm .2 mb per file?

Emacs still runs ok.

file * | grep "not stripped" | wc

492 8371 74325

492 lines... x .2mb each... = 98mb hmmm

to strip or not to strip.... that is the question.
I think I would do it if I could figgure out a single command
line that would do it

file * | grep "notstripped" | {get the filename} | strip

argh! strip won't take filenames from standard input.. Stumped here.
too much work otherwise.

trickykid 06-07-2005 08:12 PM

Quote:

Originally posted by pentalive
ls -lhS emacs emacs is 4.1 mb

strip emacs
ls -lhS emacs emacs is 3.9 mb

hmmm .2 mb per file?

Emacs still runs ok.

file * | grep "not stripped" | wc

492 8371 74325

492 lines... x .2mb each... = 98mb hmmm

to strip or not to strip.... that is the question.
I think I would do it if I could figgure out a single command
line that would do it

file * | grep "notstripped" | {get the filename} | strip

argh! strip won't take filenames from standard input.. Stumped here.
too much work otherwise.

And that is only emacs.. some might be more or less..

Like I said before.. check /var and /log since you have one big / partition.. logs can grow.. especially if this is a laptop with lots of booting being done..

And if that's not the case, get a smaller distro if you don't want to get a bigger hard drive.. or buy an external usb drive.. or usb flash card.. they got those things with more space than your actual hard drive these days.. ;)

pentalive 06-07-2005 08:46 PM

Hmmm this laptop is so old it don't have USB...

/var/log du -h 2.2M

trickykid 06-07-2005 08:51 PM

Quote:

Originally posted by pentalive
Hmmm this laptop is so old it don't have USB...

/var/log du -h 2.2M

Seems to me then you might need a new drive if you need more space or maybe need a smaller distribution.. ;)

I've gotten Slackware down to like 400MB before.. but that was without X.. with X and a few apps, maybe add 100MB or so more..

pentalive 06-08-2005 01:36 AM

Quote:

Originally posted by trickykid
Seems to me then you might need a new drive if you need more space or maybe need a smaller distribution.. ;)

I've gotten Slackware down to like 400MB before.. but that was without X.. with X and a few apps, maybe add 100MB or so more..


It won't be easy to replace the hard drive...

I am running Red Hat 7.3 with the Blackbox wm, and some bits of gnome and kde installed (actually most of gnome and kdebase and kdegames

trickykid 06-08-2005 07:57 AM

Quote:

Originally posted by pentalive
It won't be easy to replace the hard drive...

I am running Red Hat 7.3 with the Blackbox wm, and some bits of gnome and kde installed (actually most of gnome and kdebase and kdegames

Oh well, what would you like us to do then? Either suffer with limited space or get working on replacing the drive so you can actually save documents and files to it.. ;)

Kdr Kane 06-08-2005 08:00 AM

Take a look at the Linux from Scratch Book in section 5.36 page 95 and 6.60 on page 234. It's a free book.

For instance, it says do not use the "--strip-unneeded" on libraries as that will break static libraries.

If I recall correctly, stripping removed about 700 MB for me at one point.

trickykid 06-08-2005 09:03 AM

Quote:

Originally posted by pentalive
file * | grep "notstripped" | {get the filename} | strip
Dude, seriously, it isn't that hard.. use xargs..

find * | grep <whatever> | xargs strip

Your {get the filename} means nothing when your using grep.. that's what grep is for.. :rolleyes:

And you should really run the strip command with the --strip-debug so your not removing symbols that might be necessary or helpful.


All times are GMT -5. The time now is 11:00 PM.