【小白入门 通俗易懂】2021韩顺平 一周学会Linux
https://www.bilibili.com/video/BV1Sv411r7vd?p=59
step1 查看当前计算机硬盘
[root@shell37 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 20G 0 disk
├─sda1 8:1 0 300M 0 part /boot
├─sda2 8:2 0 2G 0 part [SWAP]
└─sda3 8:3 0 17.7G 0 part /
sr0 11:0 1 1024M 0 rom
[root@shell37 ~]#
step2 用vmware 添加硬盘(图示)
选择一下路径,保存就好
step3 验证是否硬盘加载到当前系统
----- 再次执行,发现没有 起效
[root@shell37 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 20G 0 disk
├─sda1 8:1 0 300M 0 part /boot
├─sda2 8:2 0 2G 0 part [SWAP]
└─sda3 8:3 0 17.7G 0 part /
sr0 11:0 1 1024M 0 rom
reboot 重启系统
--- 重启后,看到已经有 sdb 这块硬盘了,1G 大小
[root@shell37 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 20G 0 disk
├─sda1 8:1 0 300M 0 part /boot
├─sda2 8:2 0 2G 0 part [SWAP]
└─sda3 8:3 0 17.7G 0 part /
sdb 8:16 0 1G 0 disk
sr0 11:0 1 1024M 0 rom
step4 给新增硬盘sdb 划分分区 sdb2
[root@shell37 dev]# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.23.2).
---- 改变只在内存中,如果要保存,需要执行write 命令
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0xbb362624.
m 为手工输入 显示帮助指令
Command (m for help): m ---- m 为手工输入 显示帮助指令
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
g create a new empty GPT partition table
G create an IRIX (SGI) partition table
l list known partition types
m print this menu
n add a new partition -------------------------需要此处执行新增一个分区
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v