Jump to content

How do I clear /tmp?


lakelover
 Share

Recommended Posts

This is weird and I really need help. After using Mandriva 2006 for sometime, one day I couldn't boot it. I found the ext3 partition was full. So, I resized the xp partition to give Linux more but in the process I lost the boot loader. Got that fixed (paid a guy too much), and he found that my backups were going on the linux partition and filling it. I have an external drive where I thought the backups were going. No so. He cleared all the backups to give me 9.9 g free space. Everything was working find -- for one day. This morning when I turned on the computer I got the message that " /tmp " was full and KDE could not be opened.

 

I don't know what's going on or how to correct it. How do I clear "/tmp?" I can get to root and cd to /tmp, but I don't know where to go from there. And how do I prevent my partitions/files from filling? How do I examine the partitions and eleminate unwanted backups from the consol, and how do I do the same for /tmp? This is all pretty elementary, I suppose, but I'm not knowledge about finding my way around Mandrive and managing files and partitions, though I learn more each day, the hard way.

 

Jerry

Link to comment
Share on other sites

manually cleaning /tmp is riky and a lot of work afaik. You should install a tool like tmpwatch.

 

[root@localhost scipio]# urpmf --summary tmpwatch
tmpwatch:A utility for removing files based on when they were last accessed

 

Install it with "urpmi tmpwatch" and let it do its job based on a cronjob.

Link to comment
Share on other sites

Thanks, Artic. . .

 

I tried tmpwatch and go this message: "problem reading hdlist or systhesis file of medium update-source.

 

When I load tmpwatch I get a list of commands but I have no idea which commands I should use or what they mean. I'll do some researc on tmpwatch commands but. Can you give me an idea which I should use and how to apply them ?

Link to comment
Share on other sites

NAME

tmpwatch - removes files which haven't been accessed for a period of time 

SYNOPSIS

tmpwatch [-u|-m|-c] [-faqstv] [--verbose] [--force] [--all] [--test]

              [--fuser ] [--atime|--mtime|--ctime] [--quiet] <hours> <dirs>

 

 

DESCRIPTION

tmpwatch recursively removes files which haven't been accessed for a given number of hours. Normally, it's used to clean up directories which are used for temporary holding space such as /tmp.

 

When changing directories, tmpwatch is very sensitive to possible race conditions and will exit with an error if one is detected. It does not follow symbolic links in the directories it's cleaning (even if a symbolic link is given as its argument), will not switch filesystems,

and only removes empty directories and regular files.

 

By default, tmpwatch dates files by their atime (access time), not their mtime (modification time). If files aren't being removed when ls -l implies they should be, use ls -u to examine their atime to see if that explains the problem.

 

If the --atime, --ctime or --mtime options are used in combination, the decision about deleting a file will be based on the maximum of this times.

 

The hours parameter defines the threshold for removing files. If the file has not been accessed for hours hours, the file is removed. Following this, one or more directories may be given for tmpwatch to clean up.

 

 

OPTIONS

 

-u, --atime

    Make the decision about deleting a file based on the file's atime (access time). This is the default.

 

-m, --mtime

    Make the decision about deleting a file based on the file's mtime (modification time) instead of the atime.

 

-c, --ctime

    Make the decision about deleting a file based on the file's ctime (inode change time) instead of the atime; for directories, make the decision based on the mtime.

 

-a, --all

    Remove all file types, not just regular files and directories.

 

-d, --nodirs

    Do not attempt to remove directories, even if they are empty.

 

-f, --force

    Remove files even if root doesn't have write access (akin to rm -f).

 

-t, --test

    Doesn't remove files, but goes through the motions of removing them. This implies -v.

 

-s, --fuser

    Attempt to use the "fuser" command to see if a file is already open before removing it. Not enabled by default. Does help in some circumstances, but not all. Dependent on fuser being installed in /sbin.

 

-v, --verbose

    Print a verbose display. Two levels of verboseness are available -- use this option twice to get the most verbose output.

As you might imagine, there is no "standard rule of thumb" you can apply here. As you haven't used it before, I recommend to use the --atime -s -t option. "tmpwatch --atime 168 /tmp" would remove everything that wasn't accessed since one week from the folder /tmp.

 

one thing you should do nonetheless before cleaning up things with tmpwatch is to clean your cache.

 

urpmi clean cache

 

This will free up space on your system.

Link to comment
Share on other sites

Okay, I tried your suggestions and still can't get on KDE. I did the "urpmi clean cache" and I used "tmpwatch --atime -s -t"

 

I think the base problem may still be that the backups are filling up the ext3 partition. This is what happened a few days ago when I had a computer place "fix" the bootloader. While repairing the bootloader, he discovered that backup file were going on to the ext3 partition rather than on my external drive (Iomega). He deleted a whole bunch of old backups which opened up gigabites of space. One file, alone, had 9.9 g.

 

In trying to fix the problem myself I resized the XP partition giving the extra space to ext3. When I restarted the computer, my guess is, the backup program seeing the change backed up the whold ext3 partition, again.

 

I have no idea how the guy accessed the backup files. I've look for them on hda5 & 7, but cannot fine them. Perhaps they are not filling the linux partition, but something is. I had over 5 gig unused space Thursday. Friday, it was filled. That doesn't make sense.

 

Any ideas on what I should do next?

Is there a way that I can prevent the log window popping up on MCC? It blocks the menu and I can't move the log window out of the way.

Edited by lakelover
Link to comment
Share on other sites

The backups are created in MCC, through the backup whizard.

 

Making a /tmp partition is probably a good idea. I've become liery of manipulating partitions, however. It seems that everytime I've messed with partitions I've screwed something up. If I make a /tmp partition will it be automatically be recognized for /tmp files or do I have to do setup for that. As you can plainly see, I know zip about all this.

 

By the way what is a sda1 partition? That shows up on storage folder list. I don't think it's the IOMEGA.

 

If it weren't for some critical files I need for a project, I'd just do a reinstall, or revert back to XP. This is all taking too much time. Nevertheless, I'd be even more lost with your help.

Link to comment
Share on other sites

If you create a /tmp partition, you need to copy all stuff that is in your current /tmp folder to the new /tmp partition and you need to edit your fstab (do it all from a live-cd), otherwise the /tmp partition will not be mounted and the system will yell at you out of anger.

 

I also wonder why the 5 GB that are free space on your hd get filled. As you do have a dual-boot system, have you checked that your WinXP is free of troyan and other ugly stuff? I read of troyans that slowly fill up your drive with garbage, so checking it is worth a try.

 

You would be even more lost with our hell? Now that sounds cool :D

Link to comment
Share on other sites

Well, I wish I knew how that 5GB got eaten in one day. I still think is has something to do with the backup being written directly to the hda5 partition. I'm going to dig out the 2006 disk 1 and do an upgrade install and see what happens. If I loose everything I'm going to borrow a shotgun and blast the hell out my computer, suck my thumb for awhile and then swear off computers for life :P

 

Whoops!! A wrong word in the previous note is getting me in trouble. I meant to say: "without your help."

Edited by lakelover
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...