Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Use the mkfs command of linux to establish a file system on a specific partition

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Editor to share with you the use of linux's mkfs command to set up a file system on a specific partition. I hope you will learn a lot after reading this article. Let's discuss it together.

Create ext2, ext3, ext4, ms-dos, vfat file systems on disk partitions, and ext2 is created by default. Mkfs is used to build a Linux file system, usually a hard disk partition, on a device. The file is either a device name (for example, / dev/hda1,/dev/sdb2) or a regular file that contains the file system. Success returns 0 and failure returns 1.

In fact, mkfs is just the front end of the various file system builders (mkfs.fstype) available under Linux, searching for file system-specific generators in possible directories such as / sbin, / sbin/fs, / sbin/fs.d, / etc/fs, / etc/fs, and so on (exact lists are defined at compile time, but at least / sbin and / sbin/fs are included), and finally in the directories listed in the PATH environment variable.

Syntax format: mkfs [parameters]

Common parameters:

Device prepared to check the hard disk partition, for example: / dev/sda1-V detailed display mode-t given file system type, the default value of Linux is ext2-c before making the file system, check whether the partition has bad tracks-l bad_blocks_file adds the block data with bad tracks to the size of the block given block in bad_blocks_file

Reference example

Build a msdos file system on / dev/hda5, check for bad tracks, and list the process in detail:

[root@linuxcool] # mkfs-V-t msdos-c / dev/hda5

Format the sda6 partition to ext3 format:

[root@linuxcool] # mfks-t ext3 / dev/sda6 has finished reading this article. I believe you have some understanding of using linux's mkfs command to set up a file system on a specific partition. If you want to know more about it, welcome to follow the industry information channel. Thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report