Page 1 of 1

HowTo fix "no space left on device" with Opera

Posted: Thu 29 May 2008, 08:34
by MU
Errors like this were reported several times, but I'm too busy, to search the messages.
This is, how I could solve it (hopefully)

If you run Opera for some weeks, your Puppy might react very strange.
Programs don't start, and in the console you get errors like
"no space left on device", though the freememapplet shows a lot of free space.

The problem is:
Opera creates and deletes many files, that remain as .wh files in /initrd.
On the system here, it were more than 3600 of them.
This seems to break unionfs, or ext2 (?).

Solution:
add this line to
/root/.xinitrc
after the line "#!/bin/sh":

Code: Select all

find /initrd/pup_rw/$HOME/.opera -type f -name '.wh.[^dir][a-z]*[A-Z]*[0-9]*' -exec rm -f {} ';'
That seems to fix it.
If you are so far, that you cannot even boot with your savefile:
run Puppy from CD with the option
puppy pfix=ram

Click on your savefile in ROX to mount it.
Delete all .wh. files in
/mnt/MOUNTEDFOLDER/initrd/pup_rw/root/.opera/
Instead of MOUNTEDFOLDER use the name used on your system.
Click on the "eye" symbol, to see hidden files, that begin with a ".".
Then click on your savefile again, to unmount it.
Then type in a console:
e2fsck /mnt/hda1/pup_save.2fs

Instead of hda1 and pup_save.2fs use the names used on your system.

We might have to search for other apps, that create many of these files, and add a clean-up routine.
I think, some former versions already had such a routine in initrd.gz already?

Now away for work, see you...
Mark

Posted: Thu 29 May 2008, 13:52
by MU
instead of "rm -rf" I now use:

Code: Select all

find /initrd/pup_rw/$HOME/.opera -type f -name '.wh.[^dir][a-z]*[A-Z]*[0-9]*' -exec rm -f {} ';'
This will avoid to remove .wh.directory entries.

I also ran this to search for other .wh files in the home-folder:

Code: Select all

find /initrd/pup_rw/$HOME/ -type f -name '.wh.[^opr][a-z]*[A-Z]*[0-9]*'
This shows all except the ones from Opera.
Only very few were found on my system, so I will ignore these, and not search for them.
If you find applications, that show huge results here, please post them.

Mark

Posted: Thu 29 May 2008, 20:42
by Dingo
Now I have looked into my pup_save file. I have seen that also gftp writes many .wh files (I have found about 3.000) in its hidden directory

Posted: Thu 29 May 2008, 23:19
by MU
Ah yes, you're right, thanks.
I remember this from my own system, just forgot about that on the testsystem.

I now use these two lines:

Code: Select all

find /initrd/pup_rw/$HOME/.opera -type f -name '.wh.[^dir][a-z]*[A-Z]*[0-9]*' -exec rm -f {} ';'
find /initrd/pup_rw/$HOME/.gftp -type f -name '.wh.[^dir][a-z]*[A-Z]*[0-9]*' -exec rm -f {} ';'
I added them in the beginning of
/usr/sbin/browsercache (see: http://www.murga-linux.com/puppy/viewtopic.php?t=28420 )
and
/etc/rc.d/rc.shutdown

We will have to observe, how good it works :)
Mark

Posted: Fri 30 May 2008, 08:38
by Dingo
So I put these lines in /etc/rc.d/rc.shutdown and not in /root/.xinitrc ? I saw that, at least the first time, putting these lines in /root/.xinitrc, the server x started after a big delay

Posted: Fri 30 May 2008, 10:25
by MU
You can put them in /root/.xinitrc AND /etc/rc.d/rc.shutdown.

In general, it is not good, to modify something in /initrd.
But to avoid trouble, we must do it.
The best is, to delete the files at shutdown, then when Puppy restarts, it has nothing more to delete.
So usually the instructions in /root/.xinitrc then will delete nothing, only if you did not shut down properly.

The delay you encountered should appear only the first time, as then 3000 files or so are searched and deleted, the junk that remained from the last weeks.
After this initial cleanup, the following ones next time should be much faster.

On my own system, I encounter no further delays, after it ran the first time.

Mark

Posted: Sat 31 May 2008, 05:02
by floborg
Wouldn't work for me. I used this instead:

Code: Select all

find /initrd/pup_rw/root/.opera -type f -name '.wh.[^dir]*' -exec rm -f {} ';'
I put that in a script I've been using for a while:

Code: Select all

#!/bin/sh
echo "Cleaning up Opera"
cd /root/.opera/cache4
rm *.flv
rm *.swf
rm *.mpg
rm *.mpeg
rm *.avi
rm *.jpg
rm *.jpeg
rm *.png
echo "Cleaning up fake files"
find /initrd/pup_rw/root/.opera -type f -name '.wh.[^dir]*' -exec rm -f {} ';'

Posted: Wed 04 Jun 2008, 11:36
by panzerpuppy
Before I create a script and delete all this junk from my installation,I have a few important questions for you:

- Is it safe to remove everything,for example:

Code: Select all

find /initrd/pup_rw -type f -name '.wh.*' -exec rm -rf {} ';'
as a 'full system cleanup' that is to be done only once and then use the normal cleaning script for opera/gftp/etc.?

- Why is it important to leave the .wh.directory entries?

- What are all those .wh.__dir_opaque files used for? Are they safe to remove as well?

- Is it safe to also do this during a running session (not just at startup or shutdown)?

Note: I did everything listed above on a test savefile and it looks like there are no issues so far,but I just want to be sure before I do the same with my main save file.

List of the worst junk-producing apps:
----------------------------------------------
- Opera (installed): [ /initrd/pup_rw/root/.opera ] 10,000 files !
- Opera (portable,after multiple updates): [ /initrd/pup_rw/root/opera ] ~6,000 files
- KDE sfs: [ /initrd/pup_rw/root/.kde/share/config ] ~2,200 files
- WINE [ /initrd/pup_rw/root/.wine ] ~1,000 files
- OSS4 compiled from source: [ /initrd/pup_rw/usr/lib/oss/build ] ~2,500 files

Posted: Wed 04 Jun 2008, 12:00
by MU
no, do NOT delete all .wh files!

They mark files, that were deleted in a merged filesystem.
Puppy is using layers.
The bottom layer is the write-protected pup_301.sfs.
You cannot delete files in it.
So the unionfs-driver adds a .wh file, to mark it as deleted.
The driver then ensures, that outside /initrd/, that file becomes "invisible", so it looks like, that it was deleted.

With Opera and Gftp, it is different.
The folders /root/.opera/ and /root/.gftp/ are not in pup_301.sfs.
So if .wh files appear here, they make no sense.
You do not need to mark "deleted" files in these folders, as they can be deleted physically.
So here it is safe to delete .wh files, but not in other folders, that might be merged with write-protected folders.

These also should be safe, to delete all .wh files:
/initrd/pup_rw/root/.kde/share/config
/initrd/pup_rw/root/opera

Here I am not sure:
/initrd/pup_rw/usr/lib/oss/build
Please search in
/initrd/pup_ro1
to:
/initrd/pup_ro5
if that folder exists there.
If it exists, it is merged, and you should not delete .wh files.
If it does not exist, it should be safe, just as with the others.

Concerning .wh.directory and others:
there are not many, so I leave them untouched.
We would not gain much by deleting them, but would risk, to confuse unionfs.
Every access to /initrd/ is critical, and should be reduced to the absolute necessary minimum.

Another thing:
it seems, that aufs is more reliable than unionfs, see this message:
http://murga-linux.com/puppy/viewtopic. ... 7&start=30

But I did not check yet, if with aufs, my solution here becomes obsolete.

Mark

Posted: Wed 04 Jun 2008, 23:51
by panzerpuppy
Thanks for the detailed info,Mark.

usr/lib/oss/build doesn't exist in any of the pup_ro dirs,so I added the dir to the cleanup script.

/root/.wine is another directory that can be added to the 'universal crap cleaning script' (~600 fake files found)

Posted: Wed 18 Jun 2008, 09:43
by Dingo
MU wrote:You can put them in /root/.xinitrc AND /etc/rc.d/rc.shutdown.
Mark
Very strange!

I have added these lines to /root/.xinitrc/

!/bin/sh
find /initrd/pup_rw/$HOME/.opera -type f -name '.wh.[^dir][a-z]*[A-Z]*[0-9]*' -exec rm -f {} ';'
find /initrd/pup_rw/$HOME/.gftp -type f -name '.wh.[^dir][a-z]*[A-Z]*[0-9]*' -exec rm -f {} ';'
find /initrd/pup_rw/$HOME/.wine -type f -name '.wh.[^dir][a-z]*[A-Z]*[0-9]*' -exec rm -f {} ';'
# $Xorg: xinitrc.cpp,v 1.3 2000/08/17 19:54:30 cpqbld Exp $

but, booting from Cd-Rom in RAM (puppy pfix=ram) and mounting the pup_save to see if other .wh files are into, I have found more than 23.000 .wh files in opera cache!

So, why the scripts are not working? my fault?

Temporary workaround

Posted: Wed 18 Jun 2008, 19:58
by mdisaster2
While the unionfs issue is sorted out it is possible to disable the disk cache of Opera in order to cut down the number of generated files.

This is not a big deal as it seems, because Opera still mantains a memory cache which is much faster and hopefully doesn't give fits to unionfs. Besides, most Opera users set up the disk cache to be deleted on exit, which sorta negates the advantages of a persistent cache anyway.

To disable the disk cache in Opera:
Tools->Preferences->Advanced->History, open the Disk Cache Size dropdown and select "Off".
Untick the "Empty on exit" checkbox, just in case.

Or else I suppose that file-happy programs could have their caches routed to a ram disk or a tmpfs of sorts ? In Opera the cache directories can be set by typing Opera:config in the address bar and typing directory in the search box, or by editing opers6.ini (while Opera is not running!), so assuming there is a ram based file system available the relevant directories (for Opera Cache4 and Temp Downloads) could be made point at it...

Re: HowTo fix "no space left on device" with Opera

Posted: Thu 19 Jun 2008, 01:37
by silverojo
MU wrote: The problem is:
Opera creates and deletes many files, that remain as .wh files in /initrd.
On the system here, it were more than 3600 of them.
This seems to break unionfs, or ext2 (?).

Solution:
add this line to
/root/.xinitrc
I'm using Puppy v.2.0, and I can't find that file. The only items I find in the /root folder are:

Image
Image

Where do I find this file that you're referring to? I always use Opera, and I don't want my Puppy to slow down....

Posted: Thu 19 Jun 2008, 01:42
by MU
.xinitrc is on the bottom picture.
"~" means "homefolder", what is /root in Puppy.

Mark

Posted: Fri 20 Jun 2008, 04:35
by silverojo
MU wrote:.xinitrc is on the bottom picture.
"~" means "homefolder", what is /root in Puppy.

Mark
Thanks...I thought it was a text file, which is why I overlooked the different icon. Oops....

I'll have to give this a try, but I first want to back up my pup_save file, just in case I mess anything up. :)

Posted: Sun 29 Jun 2008, 19:15
by erikson
If I understand the problem correctly, Opera cache is accumulating in pup_save.

I had a similar experience with firefox, as discussed in thread Cleaning up needless cache data in pup_save.

My ultimate solution was to tell firefox to put its cache in /tmp - recall that Puppy cleans /tmp at shutdown, and never saves /tmp data into pup_save.

If Opera can be told where to cache, the same method can be applied.