/kb

personal knowledgebase

Archive for the ‘windows’ tag

Remove Windows line endings in VIM

with 5 comments

The Windows line endings (^M) can be easily removed with most editors. In ViM it is very easy.

To remove all windows line endings (and replace with nothing), type the following:

:%s/^V^M//g

(note that the ^V will not display).

Sometimes it is necessary to add a line break as well:

:%s/^V^M/\r/g

Partly based on a Tech Recipes article.

Written by Håvard Grimelid

November 17th, 2008 at 11:14 am

Posted in Editors

Tagged with , , , ,

Repairing corrupted FAT32 drive

without comments

By using fsck as described below I managed to restore one of my hard drives.

$ fsck.msdos -r -v -V /dev/hda2

According to the man file, the options have the following effects:

-r Interactively repair the file system. The user is asked for advice whenever there is more than one approach to fix an inconsistency.
-v Verbose mode. Generates slightly more output.
-V Perform a verification pass. The file system check is repeated after the first run. The second pass should never report any fixable errors. It may take considerably longer than the first pass, because the first pass may have generated long list of modifications that have to be scanned for each disk read.

Reference: Fedora Mailing List.

Written by Håvard Grimelid

June 28th, 2008 at 1:30 pm

Posted in General

Tagged with , ,