Re: mkfs vs mke2fs

From: Matthew Hiller (matthew.hiller@yale.edu)
Date: Mon Aug 16 1999 - 15:15:05 EDT


On Mon, 16 Aug 1999, Ron Nath wrote:

> I just created new partitions on hdb of type:
> hdb1 - primary
> hdb2 - extended
> hdb5 - logical
> hdb6 - logical
>
> I was able to make the filesystem of on hdb1 using
> mkfs -t ext2 /dev/hdb1
>
> For the logical partitions Im not sure if I can do the same thing
> mkfs -t ext2 /dev/hdb5
> mkfs -t ext2 /dev/hdb6
>
> or whether I should use
> mke2fs -t ext2 /dev/hdb2 and it will do it for both logical drives.

        Make a separate ext2 filesystem on each logical partition; trying
to format your extended partition wouldn't be a good thing. Well, it's
unlikely to do the right thing, at any rate. I'm not trying it to confirm.

        BTW, you're not restricted to one primary partition and one
extended w/ logical partitions when running Linux like you are with DOS. A
drive can have as many as four primary partitions (or three and one
extended).

        Also BTW, mke2fs doesn't take a -t argument, from what I can tell;
it's a program specifically used for creating ext2 filesystems, so it
assumes that, well, that's what you want to do.

> I guess after reading the man pages Im still not clear on the difference
> between mkfs and mke2fs and when each should be used.

        mkfs is more generic; you can throw it a -t fstype argument and
it'll create that kind of filesystem. On RH 5.2, at least, mkfs is in fact
just a command-line frontend to other filesystem utilities. mke2fs is
specifically the tool used to create ext2 filesystems. You'd use mkfs if
it was convenient, basically (like, if you wanted to create a minix
filesystem on one partition but didn't remember offhand that the command
to do that is /sbin/mkfs.minix or whatever.)

Matt Hiller



This archive was generated by hypermail 2b29 : Wed Apr 27 2005 - 03:30:03 EDT