parted分区以及格式化方法

Posted dyytsoft

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了parted分区以及格式化方法相关的知识,希望对你有一定的参考价值。

1、查看磁盘分区

[[email protected] tmp]# fdisk -l

Disk /dev/nvme1n1: 4000.8 GB, 4000787030016 bytes, 7814037168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/nvme0n1: 4000.8 GB, 4000787030016 bytes, 7814037168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/nvme4n1: 4000.8 GB, 4000787030016 bytes, 7814037168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/nvme7n1: 4000.8 GB, 4000787030016 bytes, 7814037168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/nvme3n1: 4000.8 GB, 4000787030016 bytes, 7814037168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/nvme5n1: 4000.8 GB, 4000787030016 bytes, 7814037168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/nvme6n1: 4000.8 GB, 4000787030016 bytes, 7814037168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/nvme2n1: 4000.8 GB, 4000787030016 bytes, 7814037168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes

2、分区

[[email protected] tmp]# parted /dev/nvme1n1

GNU Parted 3.1 Using /dev/nvme1n1

Welcome to GNU Parted! Type ‘help‘ to view a list of commands.

(parted) mktable                                                         

New disk label type? gpt                                                 

(parted) mkpart                                                          

Partition name?  []?                                                     

File system type?  [ext2]? ext4                                          

Start? 0                                                                 

End? 4000G                                                               

Warning: The resulting partition is not properly aligned for best performance. Ignore/Cancel? Ignore                                                    

(parted) print                                                           

Model: Unknown (unknown) Disk /dev/nvme1n1: 4001GB

Sector size (logical/physical): 512B/512B

Partition Table: gpt

Disk Flags:

Number  Start   End     Size    File system  Name  Flags  

1      17.4kB  4000GB  4000GB

(parted) quit                                                            
Information: You may need to update /etc/fstab.

[[email protected] tmp]# fdisk -l

WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.

Disk /dev/nvme1n1: 4000.8 GB, 4000787030016 bytes, 7814037168 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk label type: gpt

#         Start          End    Size  Type            Name  

1           34   7812500000    3.7T  Microsoft basic

3. 格式化

[[email protected] tmp]# mkfs.ext4 /dev/nvme1n1p1

mke2fs 1.42.9 (28-Dec-2013)

Discarding device blocks: done                           

Filesystem label=

OS type: Linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

Stride=0 blocks,

Stripe width=0 blocks

244146176 inodes, 976562495 blocks

48828124 blocks (5.00%) reserved for the super user

First data block=0

Maximum filesystem blocks=3124756480

29803 block groups

32768 blocks per group, 32768 fragments per group

8192 inodes per group

Superblock backups stored on blocks:  

            32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,  

            4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,  

            102400000, 214990848, 512000000, 550731776, 644972544

Allocating group tables: done                           

Writing inode tables: done                           

Creating journal (32768 blocks): done

Writing superblocks and filesystem accounting information: done   

4、查看分区

   

[[email protected] tmp]# fdisk -l

WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.

Disk /dev/nvme1n1: 4000.8 GB, 4000787030016 bytes, 7814037168 sectors

Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk label type: gpt

#         Start          End    Size  Type            Name  

1           34   7812500000    3.7T  Microsoft basic

Disk /dev/nvme0n1: 4000.8 GB, 4000787030016 bytes, 7814037168 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/nvme4n1: 4000.8 GB, 4000787030016 bytes, 7814037168 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/nvme7n1: 4000.8 GB, 4000787030016 bytes, 7814037168 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/nvme3n1: 4000.8 GB, 4000787030016 bytes, 7814037168 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/nvme5n1: 4000.8 GB, 4000787030016 bytes, 7814037168 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/nvme6n1: 4000.8 GB, 4000787030016 bytes, 7814037168 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/nvme2n1: 4000.8 GB, 4000787030016 bytes, 7814037168 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

[[email protected] tmp]# parted /dev/nvme1n1 print

Model: Unknown (unknown)

Disk /dev/nvme1n1: 4001GB Sector size (logical/physical): 512B/512B

Partition Table: gpt

Disk Flags:

Number  Start   End     Size    File system  Name  Flags  

1      17.4kB  4000GB  4000GB  ext4


以上是关于parted分区以及格式化方法的主要内容,如果未能解决你的问题,请参考以下文章

redhat 6.5 格式化大于16TB磁盘方法

新服务器上线parted分区格式化label挂载

Linux4.3 parted分区GPT格式

Linux7/Centos7磁盘分区格式化及LVM管理

centos硬盘分区格式化教程

大磁盘分区 parted