LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   doubt in commands (https://www.linuxquestions.org/questions/linux-general-1/doubt-in-commands-907497/)

rithi143 10-10-2011 08:41 PM

doubt in commands
 
tell me differences between mkfs and mke2fs. are they doing the same work? if yes means then why they are using two names for the same function.

rameshshihora 10-10-2011 08:57 PM

Hello,

Actually both the commands is use to create the filesystem.

>>>>>
mkfs - mkfs is simply a front-end for the various file system builders (mkfs.fstype) available under Linux
I think there is a limitation to create the Journaling file system using mkfs command.

It has the below option to create the defaile file system which is ext2.

-t fstype
Specifies the type of file system to be built. If not specified, the default file system type (currently ext2) is used.
>>>>>

mke2fs - create an ext2/ext3/Journal filesystem
- There is confiuration file called /etc/mke2fs.conf where you can mentioned default paramter of file systems.

For the further details .. you should read manual pages for both this command.

Thnaks & Regards,
Ramesh Shihora

rithi143 10-10-2011 09:09 PM

ya both commands are used for creating filesystem. As per ur reply i think mke2fs have the configuration file where mkfs does not have config file.

onebuck 10-11-2011 08:37 AM

Hi,

Welcome to LQ!
Quote:

Originally Posted by rithi143 (Post 4495128)
ya both commands are used for creating filesystem. As per ur reply i think mke2fs have the configuration file where mkfs does not have config file.

I do suggest that you read the man page for 'mkfs';
Quote:

excerpt from 'man mkfs';
NAME
mkfs - build a Linux file system

SYNOPSIS
mkfs [-V] [-t fstype] [fs-options] filesys [blocks]

DESCRIPTION
mkfs is used to build a Linux file system on a device, usually a hard disk partition. filesys is
either the device name (e.g. /dev/hda1, /dev/sdb2), or a regular file that shall contain the
file system. blocks is the number of blocks to be used for the file system.

The exit code returned by mkfs is 0 on success and 1 on failure.

In actuality, mkfs is simply a front-end for the various file system builders (mkfs.fstype)
available under Linux. The file system-specific builder is searched for in a number of directo-
ries like perhaps /sbin, /sbin/fs, /sbin/fs.d, /etc/fs, /etc (the precise list is defined at com-
pile time but at least contains /sbin and /sbin/fs), and finally in the directories listed in the
PATH environment variable. Please see the file system-specific builder manual pages for further
details.
Please read the last paragraph for understanding. Once you do, then realization to the fact 'mkfs' is just the front end for particular file system builders on the system in use.

Read the man page and at the bottom you will see references to 'mkfs.fstype' within the 'See Also'. You could then 'man command' for the particular builder.
HTH!


All times are GMT -5. The time now is 07:57 AM.