2023年11月25日发(作者:)

# parted /dev/sdb

GNU Parted 1.6.19

Copyright (C) 1998 - 2004 Free Software Foundation, Inc.

This program is free software, covered by the GNU General Public License.

This program is distributed in the hope that it will be useful, but WITHOUT ANY

WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A

PARTICULAR PURPOSE. See the GNU General Public License for more details.

使用 /dev/sdb

(parted) mklabel gpt

(parted) print

/dev/sdb 的磁盘几何结构:0.000-2048.000 兆字节

磁盘标签类型:gpt

Minor 起始点 终止点 文件系统 名称 标志

(parted) mkpart # mkpart 可对该磁盘进行分区

Partition type? [primary]? primary # 分区类型为主分区primary

File system type? [ext2]? xfs # 文件系统类型默认为ext2,可选ext3

(parted) print

/dev/sdb 的磁盘几何结构:0.000-2048.000 兆字节

磁盘标签类型:gpt

Minor 起始点 终止点 文件系统 名称 标志

1 0.017 2047.983

(parted) quit

# -f /dev/sdb1 //格式化后,

#cat /etc/fstab 查看自动挂载信息

# mount /dev/sdb1 /mnt # 挂载至/mnt目录

#vi /etc/fstab 添加自动挂载信息

/dev/sdb1 /mnt xfs noatime,defaults 1 1

#mount -a

# df -h

[root@i0 st2]# df -h

Filesystem Size Used Avail Use% Mounted on

/dev/sda2 24G 6.9G 16G 31% /

/dev/sda5 109G 620K 109G 1% /Data

/dev/sda1 99M 18M 76M 20% /boot

tmpfs 2.0G 0 2.0G 0% /dev/shm

/dev/sdb1 5.1T 1.1M 5.1T 1% /st2 //.