Formatting a partition

Linux configures the mkfs command to format the Linux partitions. If a partition has previously formatted, you need to use mkfs command, and Linux will reformat the partition to same filesystem. Or you have have to specify the type of filesystem to be built by including the -t switch and for checking the bad blocks with -c switch before formatting.

For example; the following commands format the /dev/sda1 partitions to noted filesystems:

# mkfs -t ext2 /dev/sda1

# mkfs -t ext3 /dev/sda1
# mkfs -t vfat  /dev/sda1
# mkfs -t reiserfs /dev/sda1


Or you can use:-
# mkfs -j /dev/sda1
 (-j creates a journal with ext3 filesystem)

And if you are formatting a partition for Linux swap space, use the mkswap command. For example, if you want  /dev/sda4 as a swap partition, the command is

# mkswap /dev/sda4


Related posts:-

Comments

0 Responses to "Formatting a partition"

Post a Comment

 

Managing Shell And its Secrets

Subscribe To Get Update On Mobile

Subscribe
Get updates of latest post on your mobile free