码迷,mamicode.com
首页 > 其他好文 > 详细

parted分区以及格式化方法

时间:2019-01-08 21:04:22      阅读:1079      评论:0      收藏:0      [点我收藏+]

标签:account   flag   ice   erb   []   writing   idt   perl   print   

1、查看磁盘分区

[root@localhost 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、分区

[root@localhost 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.

[root@localhost 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. 格式化

[root@localhost 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、查看分区

   

[root@localhost 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

[root@localhost 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分区以及格式化方法

标签:account   flag   ice   erb   []   writing   idt   perl   print   

原文地址:https://www.cnblogs.com/dyytsoft/p/10241050.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!