E297: Write error in swap file
I am trying to do a simple edit using vi on a large .sh file 818532 in size. I have loads of swap so I can't understand why I get the write error.
Swap 4192956K total, 2270396k used and 1922560k free
Am I missing something obvious.
Smaller files can be edited without any problems.
The OS is Linux Redhat 5
I assume it's a space issue as the temp .swp file that is generated is 1051811840 but this seems far bigger that the original file?
Is there another way to edit a large file as this just doesn't seem logical :-(
It sounds like you might be filling up a partition when trying to edit the file. I have been able to edit up to 250MB files in vi in the past. You just have to make sure that the filesystem you do the edit within has the space to write another copy of the file, like vi does when it creates it's ./.<filename>.swp file.
The reason for question #5 is because Red Hat Linux 5 hasn't been directly available for years (though I still have one of the old boxes with CDs in my closet) and was last updated on 16-Apr-1999. Red Hat's Enterprise Linux 5 is a fairly recent distro release, originally released in 14-Mar-2007, with update3 released in January of this year. Just trying to cut down the possible confusion.
[NOTE: It seems you edited the post as I was writing this as your current post has much more than what I have above, which I got from clicking 'Quote'. From what I see, I am not sure your original number was correct. Are you sure the original .sh file is just shy of 800KB? I can't see vi going to over 1GB for an 800KB file. 800MB, maybe?]
If you have the desktop up, you can try editing the file in gedit.
Thanks, yes it looks like I am filling up the partition.
error is 0297 error writing to swap
The df output shows
/dev/sda5 1.9G for size 820Mb used 1019Mb available 45% used
no quotas that I am aware of
perms of directory are dwxr-xr-w so I can write to the folder.
The original file is 821638013 and the only file in the folder.
The version of RedHat Enterprise Linux cat /proc/version shows Redhat 4.1.2-42 uname gives me 2.6.18-92.1.22.e15
I was wondering if I should temporarily amend the .rc file for vim so I don't use all the space, but this doesn't sound like the best thing to do.
How much free space do you think I need, is there a rough rule of thumb, eg file size time 2 ?
I suppose the easiest solution is to find somewhere with a couple of gb os free space and then it should just work.
Thankyou for the help.
I managed to find an area with about 30gb free and I was able to change the file. It took about 5 mins to save and the swap seemed to be about 1.5 times the orginal file size.
What about just using sed instead if it's a simple edit ?.
|All times are GMT -5. The time now is 07:07 PM.|