[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: vim file write mode on journaling fs.



Bram Moolenaar wrote:
> 
> Russell Cattelan wrote:
> 
> > > The following script was used.
> > >
> > > #!/bin/sh
> > > echo Test > file1
> > > cp file1 file2
> > > rm file1

> I'm glad Seth found an example with basic commands which shows Vim isn't
> really doing something strange.
<snip> 
> Summary: I consider this to be a problem with the filesystem, not with Vim.
> For people that want to be sure their file is synced, the ":!sync" command can
> be used.

I'll chime in and say I never thought vim was doing anything strange...
:)

However... regarding broken filesystems... let's try this with ext2:

[root@lite /root]# cat testit 
#!/bin/sh
mke2fs -q /dev/sda2
mount /dev/sda2 /mnt/sda2
echo Test > /mnt/sda2/file1
cp /mnt/sda2/file1 /mnt/sda2/file2
rm /mnt/sda2/file1
[root@lite /root]# ./testit
[root@lite /root]# ls -aR /mnt/sda2
/mnt/sda2:
.  ..  file2  lost+found

/mnt/sda2/lost+found:
.  ..

<wait 20 seconds>
<pull plug>
<reboot>
[root@lite /root]# e2fck /dev/sda2
e2fsck 1.19, 13-Jul-2000 for EXT2 FS 0.5b, 95/08/09
/dev/sda2 was not cleanly unmounted, check forced.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sda2: 11/340032 files (0.0% non-contiguous), 10685/678746 blocks
[root@lite /root]# mount /dev/sda2 /mnt/sda2
[root@lite /root]# ls -aR /mnt/sda2
/mnt/sda2:
.  ..  lost+found

/mnt/sda2/lost+found:
.  ..


Nada... zip... zilch...

Hey, at least with XFS you get to see a filename.  :)

-- 
Eric Sandeen      XFS for Linux     http://oss.sgi.com/projects/xfs
sandeen@sgi.com   SGI, Inc.