## 创建分区
查看磁盘
```
fdisk -l
```
查看系统分区使用情况
```
df -hT
```
创建新的分区
```
fdisk /dev/sdb
Command (m for help):
...
```
挂载分区(手动)
```
mkdir /data
mount /dev/sdb1 /data
df -hT
```
修改配置文件vi /etc/fstab(自动)
```
/dev/sdb1 /data xfs defaults 0 0
```
运行mount -a
```
mount -a
```
## mount
挂载iso镜像
```
mount -o loop CentOS-7-x86_64-Minimal-1810.iso /media
umount /media
```
挂载光盘
```
mount /dev/cdrom /media
umount /media
```
挂载Windows共享 / Samba共享
```
mount -t cifs -o username=user01,password=****** //192.168.10.10/share /cifs_share
```
挂载NFS
```
mount -t nfs 192.168.10.71:/data /data
```
## dd
刻录iso刻录到U盘
```
dd if=CentOS-7-x86_64-Minimal-1810.iso of=/dev/sdb bs=512k
```
磁盘克隆
```
dd if=/dev/sdb of=/dev/sdc
```
## parted
安装parted
```
yum install parted -y
```
查询分区
```
parted
# By default /dev/sda is selected
print
print devices
quit
```
创建gpt分区
```
parted /dev/sdb
# Create partition table
(parted) mklabel gpt
# Create partition
(parted) mkpart
Partition name? []? data
File system type? [ext2]? xfs
Start? 1
End? 100%
(parted) print
Model: VMware, VMware Virtual S (scsi)
Disk /dev/sdb: 2199GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 2199GB 2199GB data
quit
# 创建文件系统
mkfs -t xfs /dev/sdb1
# 挂载分区
mkdir /data
mount /dev/sdb1 /data
df -hT | grep sdb
Filesystem Type Size Used Avail Use% Mounted on
/dev/sdb1 xfs 2.0T 33M 2.0T 1% /data
```