linux磁盘分区、文件系统、挂载

一、磁盘分区
1、查看当前分区是mbr 还是gpt

[root@centos8 ~]$ fdisk -l /dev/sdb
Disk /dev/sdb: 2 GiB, 2147483648 bytes, 4194304 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 3AF87A15-A7E2-4BBD-A36D-850FA9291997

2、将磁盘创建分区表msdos 为mbr分区 参数gpt为gpt分区

[root@centos8 ~]$ parted /dev/sdb mklabel msdos



3、查看分区信息、文件系统类型、分区容量、主分区还是扩展分区还是逻辑分区

```bash
[root@centos8 ~]$ parted /dev/sda print
Model: ATA CentOS8-0 SSD (scsi)
Disk /dev/sda: 21.5GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type      File system     Flags
 1      1049kB  316MB   315MB   primary   ext4            boot
 2      316MB   13.2GB  12.9GB  primary   xfs
 3      13.2GB  15.3GB  2147MB  primary   linux-swap(v1)
 4      15.3GB  21.5GB  6127MB  extended
 5      15.3GB  21.5GB  6126MB  logical   xfs

4、创建分区

[root@centos8 ~]$ parted /dev/sdb mkpart primary 1 101
Information: You may need to update /etc/fstab.

[root@centos8 ~]$ parted /dev/sdb print                                    
Model: ATA CentOS8-1 SSD (scsi)
Disk /dev/sd
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值