Operating System - Linux
1825794 Members
2096 Online
109687 Solutions
New Discussion

How to create FS in Linux.

 
SOLVED
Go to solution
Kenny Chau
Trusted Contributor

How to create FS in Linux.

Hi Linux Experts,

Since I am new to Linux, maybe this question is too easy for you.

How to create File systems in Linux by command? Would you mind to give me the procedure for that?

I am using RH7.

Thanks very much.
Kenny.
Kenny
3 REPLIES 3
I_M
Honored Contributor
Solution

Re: How to create FS in Linux.

Hi

First of all, confirm if you have free (un-assigned) space in your HD.
# fdisk -l

Then create new partition using fdisk.

Then you can create filesystem on your new partition.

# mkfs -t ext2 /dev/hdaX
# mkfs -t msdos /dev/hdaX
# mke2fs /dev/hdaX

Check online manual of the mkfs for more detail options.

Good luck
Craig Kelley
Valued Contributor

Re: How to create FS in Linux.

You can also make them journaled filesystem (ext3) by supplying the -j flag to mke2fs:

mke2fs -j /dev/hda3
mount -t ext3 /dev/hda /mnt/blah

Kenny Chau
Trusted Contributor

Re: How to create FS in Linux.

Thanks for your information.

Regards,
Kenny.
Kenny