LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-24-2014, 09:22 AM   #1
fermat97
LQ Newbie
 
Registered: Apr 2014
Posts: 4

Rep: Reputation: Disabled
Problems with vim, everything appear blank when opening a file using vi


Hi,
I use putty in order to connect to a Linux server, and I would like open some mfiles using vi or vim. But when i put "vi myfile.m" saw the error:

E297: Write error in swap file
E303: Unable to open swap file for "myfile.m", recovery
"myfile.m" 0L, 0C
Press ENTER or type command to continue

and when I press Enter the file would be totally blank, it seems that vi erase everything. I tried with other text files and always the same thing happened. I even tried to write a new text file and the same problem. something strange is that I have the same problem with emacs and less commands.

would you please let me know what is the problem and how I can fix it. By the way I am a real beginner !

tahnks,
Pierre
 
Old 04-24-2014, 09:28 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,687
Blog Entries: 14

Rep: Reputation: 1022Reputation: 1022Reputation: 1022Reputation: 1022Reputation: 1022Reputation: 1022Reputation: 1022Reputation: 1022
I've not seen this error but since it tries to create the swap file on disk my first guess would be you're out of space in whatever filesystem you're doing the vi session in.

If that is the case you shouldn't lose anything when you see the blank screen so long as you do NOT tell it write when you exit vim or emacs.

Run "df -hP" to see how full your filesystems are. Any you see at or near 100% full should be cleaned up to free some space.
 
Old 04-24-2014, 09:33 AM   #3
fermat97
LQ Newbie
 
Registered: Apr 2014
Posts: 4

Original Poster
Rep: Reputation: Disabled
Thanks.
when I run df I get:

Filesystem 1K-blocks Used Available Use% Mounted on
/dev/md0 461084740 437640804 0 100% /
none 4 0 4 0% /sys/fs/cgroup
udev 8204348 4 8204344 1% /dev
tmpfs 1643308 1264 1642044 1% /run
none 5120 0 5120 0% /run/lock
none 8216536 0 8216536 0% /run/shm
none 102400 0 102400 0% /run/user

The onlything near 100% is the /dev/md0
what should I do with md0?Do I have to earse it? nothing happen when I do so?
 
Old 04-25-2014, 10:04 AM   #4
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,687
Blog Entries: 14

Rep: Reputation: 1022Reputation: 1022Reputation: 1022Reputation: 1022Reputation: 1022Reputation: 1022Reputation: 1022Reputation: 1022
/dev/md0 461084740 437640804 0 100% /

"/dev/md0" is the device and "/" is the filesystem. This filesystem is the one at the base of all other directories and is known as the "root" filesystem.

Since you don't have separate /var, /tmp, /usr and others it means you really only have the single filesystem on your disk. (The others you see are special filesystems built in memory at boot time.)

WARNING: You must be careful in deleting files in root.

Having root full would prevent most things from working.

Things typically safe to remove are the things in directories /tmp and /var/tmp.

Things typically safe to compress are files ending with a suffix of .tar (you can compress such files with "gzip <filename>.tar").

You may also have very large log files in /var/log that can be truncated or deleted but you would have to be sure such files are not currently in use by any process. (You can run "lsof <filename>" to determine if a file is open.)

You can also look for core dumps (files named "core") with command:
find / -name core
Run the file command against any core file found ("file <pathto>/core"). If that shows it is a core dump (usually it will tell you it was caused by a SIGSEG* or something similar) it is safe to delete. However some programs (e.g. Oracle) actually make directories named "core" so it is important you NOT delete files that aren't actually core dumps.

Beyond that you'd have to look at your system carefully to determine what is safe to delete or truncate. You may have downloaded files over time that you no longer need.
 
Old 04-26-2014, 03:29 PM   #5
fermat97
LQ Newbie
 
Registered: Apr 2014
Posts: 4

Original Poster
Rep: Reputation: Disabled
Thanks alot.
 
Old 04-26-2014, 03:42 PM   #6
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,655

Rep: Reputation: 1256Reputation: 1256Reputation: 1256Reputation: 1256Reputation: 1256Reputation: 1256Reputation: 1256Reputation: 1256Reputation: 1256
If you have been running very long, look to see if you have some overlarge, or an excess number of log files in /var/log and its subdirectories.

One file you can delete nearly anytime is the .xsession-errors* files (there may be more than one). These contain messages that might have been generated by X based applications (most of the messages are just status reports, but can be useful to catch error messages from the same applications).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem for Opening any file with VIM ? raviteja_s Linux - Newbie 1 10-02-2010 04:35 AM
[SOLVED] Vim 7.0 opening slowly bartonski Linux - Software 2 05-09-2010 02:06 PM
Problems opening log file jonette20 Linux - Software 2 04-17-2008 03:58 PM
Blank page when opening PHPWiki. Install file won't help much Thakowbbery Linux - Software 0 04-17-2007 09:57 AM
konqueror problems (looping dirs and file opening) Cyber Maid Linux - Software 4 12-17-2005 08:57 PM


All times are GMT -5. The time now is 03:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration