1.查看分区挂载情况
book@100ask:~/study/cbase$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 956M 0 956M 0% /dev
tmpfs 196M 3.3M 193M 2% /run
/dev/sda1 217G 11G 195G 5% /
tmpfs 980M 0 980M 0% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 980M 0 980M 0% /sys/fs/cgroup
2.查看磁盘的分区情况
book@100ask:~/study/cbase$ sudo fdisk -l /dev/sda
Disk /dev/sda: 500 GiB, 536870912000 bytes, 1048576000 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
Disklabel type: dos
Disk identifier: 0xf32f71d7
Device Boot Start End Sectors Size Id Type
/dev/sda1 2048 462639103 462637056 220.6G 83 Linux
/dev/sda2 * 462639104 464592895 1953792 954M 83 Linux
/dev/sda3 464592896 482168831 17575936 8.4G 82 Linux swap / Solaris
/dev/sda4 482168832 1048573951 566405120 270.1G 83 Linux
3.磁盘创建/删除/格式化分区
book@100ask:~/study/cbase$ sudo fdisk /dev/sda
Welcome to fdisk (util-linux 2.31.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): m
4.修改分区格式,例如修改为vfat格式
book@100ask:~/study/cbase$ mkfs -t vfat /dev/sdb1
|