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

Commands for formatting Linux partitions

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

When the hard disk partition is complete, the partition needs to be formatted.

Use the mkfs tool to format the hard disk partition and support two partition tables: MBR and GPT.

Command 1: format sdb1 partition to ext3 format

Mkfs.ext3 / dev/sdb1

Mke2fs 1.41.12 (17-May-2010) File system tag = operating system: Linux Block size = 4096 (log=2) Block size = 4096 (log=2) Stride=0 blocks, Stripe width=0 blocks131072 inodes, 524288 blocks26214 blocks (5.00%) reserved for the super user first data block = 0Maximum filesystem blocks=53687091216 block groups32768 blocks per group, 32768 fragments per group8192 inodes per groupSuperblock backups stored on blocks: 32768,98304,163840,229376,294912

Writing inode table: complete

Creating journal (16384 blocks): complete Writing superblocks and filesystem accounting information: complete This filesystem will be automatically checked every 24 mounts or180 days, whichever comes first. Use tune2fs-c or-i to override.

Command 2: format sdb5 partition to ext4 format

Mkfs-t ext4 / dev/sdb5

Mke2fs 1.41.12 (17-May-2010) File system tag = operating system: Linux Block size = 4096 (log=2) Block size = 4096 (log=2) Stride=0 blocks, Stripe width=0 blocks131072 inodes, 524288 blocks26214 blocks (5.00%) reserved for the super user first data block = 0Maximum filesystem blocks=53687091216 block groups32768 blocks per group, 32768 fragments per group8192 inodes per groupSuperblock backups stored on blocks: 32768,98304,163840,229376 294912 is writing inode table: complete Creating journal (16384 blocks): complete Writing superblocks and filesystem accounting information: complete This filesystem will be automatically checked every 20 mounts or180 days, whichever comes first. Use tune2fs-c or-i to override.

P.s.

Extended partitions in the MBR partition table disk cannot be formatted, that is, only primary and logical partitions can be formatted

The formatting operation takes effect immediately, and there is no need to restart the Linux system, but the file system and type of the disk cannot be found with the df command at this time, because it has not been mounted yet.

Df-hT / dev/sdb1Filesystem Type Size Used Avail Use% Mounted on--492m 260K 491M1 / dev

Summary

The above is the Linux partition formatting command introduced by the editor to you. I hope it will be helpful to you. If you have any questions, welcome to leave a message for me, the editor will reply you in time, if you have any questions, please leave a message for me, the editor will reply you in time!

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