newest mkfs for linux

Previous thread: Re: Adaptech-1542 driver. Linking system. by David R. Giller on Monday, November 25, 1991 - 9:02 pm. (1 message)

Next thread: none
To: <Linux-activists@...>
Date: Monday, November 25, 1991 - 11:22 pm

Ok, here's a mkfs for those that want to try it out. It works on my
system (limited testing), and hopefully we can get possible bugs ironed
out in time for 0.11 (and currently I'm hoping to release that December
8th or something).

This mkfs has two modes: checking and reckless. On a disk that you know
has no problems, you just write "mkfs /dev/hdx size", and you should
have a new system (DON'T do this on a mounted drive: unlike fsck there
is NO way that will work, and you'll probably mess it up completely.)

On a disk with possible read-errors, use "mkfs -c /dev/hdx size", which
will read all the blocks and mark those unreable into a special file
"/.badblocks". I'm not making any guarantees. This is a fast hack
(mainly yesterday and today), and I have tested only on small
filesystems, faking errors by telling mkfs that the filesystem is bigger
than it actually is. If you think the algorithm for marking bad blocks
is weird: you're right.

Linus

PS. Using -c on a big harddisk or on floppies is slow, even though I try
to speed it up by reading 32kB at a time. Also, the current linux kernel
will print out error messages for all the IO errors - that's normal, and
that's what this mkfs should map out.
---------------- snip snip ----------
/*
* mkfs.c - make a linux (minix) file-system.
*
* (C) 1991 Linus Torvalds. This file may be redistributed as per
* the Linux copyright.
*/

/*
* 24.11.91 - time began. Used the fsck sources to get started.
*
* 25.11.91 - corrected some bugs. Added support for ".badblocks"
* The algorithm for ".badblocks" is a bit weird, but
* it should work. Oh, well.
*
* Usuage: mkfs [-c] device size-in-blocks
*
* -c for readablility checking (SLOW!)
*
* The device may be a block device or a image of one, but this isn't
* enforced (but it's not much fun on a character device :-).
*/

#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <fcntl.h>
#include <ctype.h>
#include &l...

Previous thread: Re: Adaptech-1542 driver. Linking system. by David R. Giller on Monday, November 25, 1991 - 9:02 pm. (1 message)

Next thread: none