Author Topic: Free Up Flash Space With Strip *?  (Read 3727 times)

daniel3000

  • Hero Member
  • *****
  • Posts: 1003
    • View Profile
    • http://
Free Up Flash Space With Strip *?
« on: November 29, 2006, 05:17:51 am »
Hi,

is there any danger in running a "strip *" on all binaries and libs in all directories in order to free up some space (hopefully)?

daniel
SL-C3200 with weeXpc, based on pdaXrom 1.1.0beta3
HP 200LX with MS-DOS 5.0

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
Free Up Flash Space With Strip *?
« Reply #1 on: November 29, 2006, 06:48:35 am »
Should be fine. They should all have been stripped already when 'make install 'was run.


Si
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

daniel3000

  • Hero Member
  • *****
  • Posts: 1003
    • View Profile
    • http://
Free Up Flash Space With Strip *?
« Reply #2 on: November 29, 2006, 08:39:56 am »
was brave - tested that.
Went into the various bin and lib directories and did

Code: [Select]
find -type f -exec strip '{}' \; -print
The results are partially remarkable:


/usr/bin: 23.4 -> 22.2 MB (-1.2MB)
/usr/local/bin: 6.8 -> 6.3 MB (-0.5MB)
/bin: 1.6 -> 1.6MB (0)
/sbin: 1.8 -> 1.8MB (0)
/usr/sbin: 2.9 -> 2.9MB (0)
/lib: 7.7 ->
/usr/lib: 105.5 -> 97.7MB (-7.8MB)


...here I stopped:
The decreased directory size is good, but OTOH df -h now shows only 2MB free on / instead of 6MB as before that process.
During stripping, it even showed ZERO free space on root.
Any idea what the reason could be?
Does strip create data somewhere which is doesn't delete again?

This is not the final result I wanted to see...    

Thanks for any hint!
daniel
SL-C3200 with weeXpc, based on pdaXrom 1.1.0beta3
HP 200LX with MS-DOS 5.0

Chero

  • Hero Member
  • *****
  • Posts: 1140
    • View Profile
    • http://users.telenet.be/zaurususer/Chero
Free Up Flash Space With Strip *?
« Reply #3 on: November 29, 2006, 09:31:03 am »
Quote
was brave - tested that.
Went into the various bin and lib directories and did

Code: [Select]
find -type f -exec strip '{}' \; -print
The results are partially remarkable:


/usr/bin: 23.4 -> 22.2 MB (-1.2MB)
/usr/local/bin: 6.8 -> 6.3 MB (-0.5MB)
/bin: 1.6 -> 1.6MB (0)
/sbin: 1.8 -> 1.8MB (0)
/usr/sbin: 2.9 -> 2.9MB (0)
/lib: 7.7 ->
/usr/lib: 105.5 -> 97.7MB (-7.8MB)


...here I stopped:
The decreased directory size is good, but OTOH df -h now shows only 2MB free on / instead of 6MB as before that process.
During stripping, it even showed ZERO free space on root.
Any idea what the reason could be?
Does strip create data somewhere which is doesn't delete again?

This is not the final result I wanted to see...   

Thanks for any hint!
daniel
[div align=\"right\"][a href=\"index.php?act=findpost&pid=147496\"][{POST_SNAPBACK}][/a][/div]

check tmp
HP-95LX -> HP Jornada 680 -> SL-C860 -> SL-C3100 -> Fuji u810 -> SL-C1000 -> HTC uni -> SL-C860 -> SL-C760.
March 12 2009 : Back because the Zaurus is one of a kind.
SL-C760 : pdaXrom
Pandora pre-ordered -> received and tested : great device but not my cup of tea -> sold.

Meanie

  • Hero Member
  • *****
  • Posts: 2803
    • View Profile
    • http://www.users.on.net/~hluc/myZaurus/
Free Up Flash Space With Strip *?
« Reply #4 on: November 29, 2006, 09:38:57 am »
Quote
was brave - tested that.
Went into the various bin and lib directories and did

Code: [Select]
find -type f -exec strip '{}' \; -print
The results are partially remarkable:


/usr/bin: 23.4 -> 22.2 MB (-1.2MB)
/usr/local/bin: 6.8 -> 6.3 MB (-0.5MB)
/bin: 1.6 -> 1.6MB (0)
/sbin: 1.8 -> 1.8MB (0)
/usr/sbin: 2.9 -> 2.9MB (0)
/lib: 7.7 ->
/usr/lib: 105.5 -> 97.7MB (-7.8MB)


...here I stopped:
The decreased directory size is good, but OTOH df -h now shows only 2MB free on / instead of 6MB as before that process.
During stripping, it even showed ZERO free space on root.
Any idea what the reason could be?
Does strip create data somewhere which is doesn't delete again?

This is not the final result I wanted to see...   

Thanks for any hint!
daniel
[div align=\"right\"][a href=\"index.php?act=findpost&pid=147496\"][{POST_SNAPBACK}][/a][/div]

that's expected. jffs2 is a compressed filesystem. the amount of free space is calculated from the ratio of compression with available blocks. since you stripped all the binaries, the compressability  of the files have reduced and hence the ratio of compression also changed, so the result you see is correct. compression files on a jffs2 fs is counterproductive.
SL-C3000 - pdaXii13 build5.4.9 (based on pdaXrom beta3) / SL-C3100 - Sharp ROM 1.02 JP (heavily customised)
Netgear MA701 CF, SanDisk ConnectPlus CF, Socket Bluetooth CF, 4GB Kingston CF,  4GB pqi SD, 4GB ChoiceOnly SD, 2GB SanDisk SD USB Plus, 1GB SanDisk USB Plus, 1GB Transcend SD, 2GB SanDisk MicroSD with SD adaptor, Piel Frama Leather Case, GoldX 5-in-1 USB cable, USB hub, USB mouse, USB keyboard, USB ethernet, USB HDD, many other USB accessories...
(Zaurus SL-C3000 owner since March 14. 2005, Zaurus SL-C3100 owner since September 21. 2005)
http://members.iinet.net.au/~wyso/myZaurus - zBook3K

daniel3000

  • Hero Member
  • *****
  • Posts: 1003
    • View Profile
    • http://
Free Up Flash Space With Strip *?
« Reply #5 on: November 29, 2006, 10:10:07 am »
Hi Chero,

/tmp is not on the root fs, but /dev/shm/tmp (12MB).
However, there is nothing left from strip.

Hi Meanie,

I thought strip strips unneeded stuff, but doesn't compress the remaining dat?
So the compression ratio should not be affected significantly, to my understanding.

Also, doesn't jffs consider ALL the data on the drive for calculatoin of free space from compression ratio? Since I only got 10 MB from a 121MB drive, this is less than 10%. How can jffs reduce the amount of free calculated memory from about 15MB (as it should be after the stripping) to only 2MB, and especially: why should jffs calculate 0MB free DURING the stripping?
Also: After I strip data, I have more space. Even if compression is not that effective afterwards, shouldn't jffs report also MORE free space, but just not as much more as I deleted/stripped?
That's not clear to me.

I restored the backup of last night with the unstripped binaries, just to be sure there is no crap data.


And while we are at it:

I have installed the newer freetype library (see epdfview/poppler thread).
I wondered why this is so much larger than the old freetype.
Ran a "strip" on /usr/lib/libfreetype.a and /usr/lib/libfreetype.so.6.3.8 and guess what?
Together they shrank from about 3MB to 600kB. :-)
df -h reported 6.1MB before, now it reports 7.3MB free space.

So, to take this as a result for above discussion:
strip deleted 2.4MB of data,
df -h reports 1.2MB more free space (factor 0.5).

...will post about that on the epdfview thread, too, so people can reduce the size of the installation of freetype.

daniel
SL-C3200 with weeXpc, based on pdaXrom 1.1.0beta3
HP 200LX with MS-DOS 5.0

pelrun

  • Sr. Member
  • ****
  • Posts: 366
    • View Profile
    • http://
Free Up Flash Space With Strip *?
« Reply #6 on: November 29, 2006, 10:41:07 am »
That cannot be it - no matter how highly compressible the data removed is, the resultant smaller file can't be larger after compression than the original. Yes, the ratio would be different, but that number is meaningless without the uncompressed sizes of the files being identical (which they obviously cannot be.)

Perhaps he's just caused the jffs2 journal to balloon in size with all the writes that stripping operation incurred.
SL-C3100 with usb power mod running debian eabi
pdaXii13 still on the NAND for dualbooting
16GB SDHC! (a new one, after I sat on the old one and it went kaput)
D-Link 660 wifi, Socket Bluetooth rev H
External 9800mAh LiIon battery and slimline dvd drive
Homebrew microphone and remote

desertrat

  • Hero Member
  • *****
  • Posts: 743
    • View Profile
    • http://
Free Up Flash Space With Strip *?
« Reply #7 on: November 29, 2006, 02:55:19 pm »
On a "regular" filesystem, if a file that is being used is changed/deleted/replaced the system will keep a copy of the original hanging around so that any processes running which needs that file will not be shafted. When all processes requiring that file is terminated the copy of the original is removed. This mechanism is probably why Linux only requires a reboot when changing kernels, whereas in windoze "your mouse has moved you need to restart windows for the changes to take effect".

So basically rebooting your machine should (hopefully ) get your free space back.
SL-C3100 / Ambicon WL1100C-CF / pdaXrom 1.1.0beta3 / IceWM

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
Free Up Flash Space With Strip *?
« Reply #8 on: November 29, 2006, 02:57:45 pm »
Quote
Perhaps he's just caused the jffs2 journal to balloon in size with all the writes that stripping operation incurred.

That would be my guess.

Try a couple of reboots and see if jffs2 will reclaim the space that was used by the old files.


Si
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

pelrun

  • Sr. Member
  • ****
  • Posts: 366
    • View Profile
    • http://
Free Up Flash Space With Strip *?
« Reply #9 on: November 29, 2006, 04:30:20 pm »
If it is the journal then reboots won't make any difference, as it's stored in the flash as well.

But desertrat raises a good point, under linux open file handles increment the reference count on files, preventing the space from being reclaimed even if you've deleted all the hard links on the drive for that file. A reboot will sort all of those files out.
SL-C3100 with usb power mod running debian eabi
pdaXii13 still on the NAND for dualbooting
16GB SDHC! (a new one, after I sat on the old one and it went kaput)
D-Link 660 wifi, Socket Bluetooth rev H
External 9800mAh LiIon battery and slimline dvd drive
Homebrew microphone and remote

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
Free Up Flash Space With Strip *?
« Reply #10 on: November 30, 2006, 06:54:22 am »
It needn't be the journal itself though, it could simply be that the jffs2 garbage collector hasn't got around to running and reclaiming the space.

My understanding is that a reboot tends to get this to run (though I'm a little foggy on the details, if anyone knows better please let me know)


Si
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva