[vox-tech] Editing menu.lst

Jeff Newmiller jdnewmil at dcn.davis.ca.us
Tue Oct 21 08:11:01 PDT 2008


Bob Scofield wrote:
> I need some help on editing menu.lst.  I'm trying to change it so that my 
> laptop's default is to boot into Linux instead of Windows.
> 
> If I want to read menu.lst by executing "less menu.lst" I have no problem.  
> But if I execute "vi menu.lst" I get this:
> 
>> E325: ATTENTION
>> Found a swap file by the name ".menu.lst.swp"
>>           owned by: root   dated: Tue Jul 10 23:00:09 2007
>>          file name: /boot/grub/menu.lst
>>           modified: YES
>>          user name: root   host name: fir
>>         process ID: 6909
>> While opening file "menu.lst"
>>              dated: Tue Aug 26 18:09:56 2008
>>       NEWER than swap file!

I think this error message is unusually helpful, as error messages
go.  Googling "vim E325" provides even more information.  I offer
some thoughts below on interpreting the details for future reference.

>> (1) Another program may be editing the same file.
>>     If this is the case, be careful not to end up with two
>>     different instances of the same file when making changes.
>>     Quit, or continue with caution.

The key word here is "editing"... the swap file is related to
the process of editing the file, not the system RAM swapspace
(which is stored in a partition, while below this swapfile is
described as a named file in the directory tree).  This
swap file is specific to the vim editor and to the edits you make
during an editing session, so using a different editor probably
wouldn't give you this error... therefore the "other program"
referred to would have to be another vim session.

With that in mind, are there any other vim sessions editing the
file? "ps a -F | grep vim" should let you know for sure, and
"pstree -p | less" lets you see which shell session started it.

>> (2) An edit session for this file crashed.
>>     If this is the case, use ":recover" or "vim -r menu.lst"
>>     to recover the changes (see ":help recovery").
>>     If you did this already, delete the swap file ".menu.lst.swp"
>>     to avoid this message.

This option seems most likely on a single-sysadmin (home) system.
If you don't see any other sessions in the output from the "ps"
command described above, then one of the actions described here
would be most cautious.  However, it would not be good to proceed
with this assumption if there IS another vim session active, since
the file could end up getting changed twice and you might not
know what the contents of the file were afterward.

>> Swap file ".menu.lst.swp" already exists!
>> [O]pen Read-Only, (E)dit anyway, (R)ecover, (D)elete it, (Q)uit, (A)bort:
> 
> I don't get this "menu.lst.swp" thing.  My guess is that I should choose "E" 
> and "edit anyway."  Is this what I should do?  Is there any danger here?

Assuming you think alternative [2] is the case, [E] seems appropriate. It
depends whether you want to recover the edits you already started or start
from scratch.  In this case I would imagine that you would want to make all
your edits in a single continuous session so you have a clear idea what has
changed.

-- 
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                       Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
---------------------------------------------------------------------------


More information about the vox-tech mailing list