My Profile

Keep Up to Date:
Blog RSS
Blog
Forum RSS
Forum
Post New Topic Post Reply
Posted 3 Months, 3 Weeks ago
Woodstock
Senior Boarder
Posts: 71
graphgraph
User Offline
 
I've inherited this Linux system in my new job, but have a long way to go...

I'm getting the 'write error in swap file' error when using vi. It seems clear that one disk partition is full, and that I need to delete something, but I can't work out what to get rid of. The / is all directories, and /tmp and /var are on separate partitions. All of the commonly used files are on other partitions, it's just this one 500M partition that is at 100%. It's mounted on /, but this doesn't help me identify what directories or files might be being stored there.

Reading some other posts on this common error hasn't helped identify where vi might be hiding it's swap file - is there any way of finding out?

Any help much appreciated!

Cheers
The administrator has disabled public write access.
Posted 3 Months, 2 Weeks ago
ejtaal
Expert Boarder
Posts: 80
graphgraph
User Offline
 
Basically the /root home dir (the home dir of root), /bin, /sbin, /opt, /spare (if they exists), /home and other things like that.

In the same dir or in your home dir.
The administrator has disabled public write access.
Posted 3 Months, 2 Weeks ago
Arligoth
Senior Boarder
Posts: 69
graphgraph
User Offline
 
So what? Turn off the backup.

Sure.

Why not?

It'll be on your home dir, so delete it.

If that's where your home dir is, then you're in trouble, It should be on a /home partition.

Why?

Sure. Ask it. Or strace it.

Man vi ...

-n No swap file will be used. Recovery after a crash will be impossible. Handy if you want to edit a file on a very slow medium (e.g. floppy). Can also be done with 'et uc=0'. Can be undone with 'et uc=200'.

... -r List swap files, with information about using them for recovery.

-r {file} Recovery mode. The swap file is used to recover a crashed editing session. The swap file is a file with the same filename as the text file with '.swp' appended. See ':help recovery'.

Etc etc tec. Shum Problem?
The administrator has disabled public write access.
Posted 3 Months, 2 Weeks ago
dsojda
Expert Boarder
Posts: 85
graphgraph
User Offline
 
Why be concerned with where vi puts its swap file? You need to look instead for what it is that's filling up that partition.

First, use the _df_ command to find out which partition is full. (You didn't exactly say so, but it appears that you meant to say it is the root partition. Whatever, _df_ will tell you.)

Then you can use _du_ to tell you exactly which files on that partition are using how much space. (*Do* read the man pages on these commands!)

Assuming it is the root partition, here is a command that will give you a list of everything larger than 2mb on your root partition,

du -axm / grep '^[23456789]' more

When you get a look at where the space is being used you'll likely have some better questions to post here... as in, which of them should exist and which shouldn't be so large.
The administrator has disabled public write access.
Posted 3 Months, 2 Weeks ago
newsgirl
Expert Boarder
Posts: 81
graphgraph
User Offline
 
Perhaps the OP is not referring to paging space, but the backup file that vim makes when editing a file, which they've unfortunately dubbed a 'swap file', which serves for recovery if vi gets killed without saving. It's usually written in the same directory as the file being edited, is a 'hidden' file, and ends in '.swp'. If you try to edit a file in a directory where you don't have write permission, you might get that error. (If this is the case, see the vi(m) manpage.)
The administrator has disabled public write access.
Posted 3 Months, 2 Weeks ago
Bhaumik Shukla
Expert Boarder
Posts: 81
graphgraph
User Offline
 
[-] [-] Probably it's vim, so vi(m) - ESC :help swap
The administrator has disabled public write access.
Posted 3 Months, 2 Weeks ago
Elaine
Senior Boarder
Posts: 78
graphgraph
User Offline
 
He is clearly *not* talking about system paging space.

You've trimmed too much of the OP's original article and lost the significant part:

'... it's just this one 500M partition that is at 100%. It's mounted on / ...'

He has a full root partition, and for that he doesn't really need to be concerned with where vi is putting its swap file. What he needs to do is find out what is filling up a 500M root partition...

(Which is not to say that the advice above is wrong, or that he might not have two, or even more, problems and that could indeed be one of them. But he first needs to clean something out of that 100% full root partition.)
The administrator has disabled public write access.
Posted 3 Months, 2 Weeks ago
ppreddy
Senior Boarder
Posts: 79
graphgraph
User Offline
 
^^^^^^^^^^^^^^^^^^^^^^^^^^^

I hate when that happens. You invariably get blamed for creating the second problem in the course of fixing the first one...
The administrator has disabled public write access.
 
Copyright © 2006 - Dec 2008 My Linux Gang