不重启在CentOS 7/ RHEL 7虚拟机添加一块新硬盘

前端之家收集整理的这篇文章主要介绍了不重启在CentOS 7/ RHEL 7虚拟机添加一块新硬盘前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

1、在ESX、VMware或vCenter中添加一块新硬盘

2、显示当前磁盘分区

# fdisk -l

Disk /dev/sda: 21.5 GB,21474836480 bytes,41943040 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
Disk label type: dos
Disk identifier: 0x000a9f38

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048        6143        2048   83  Linux
/dev/sda2   *        6144     1030143      512000   83  Linux
/dev/sda3         1030144    41943039    20456448   8e  Linux LVM

3、查看主机总线号

# ls /sys/class/scsi_host
host0  host1  host2

# ls -l /sys/block/sda
lrwxrwxrwx 1 root root 0 Dec  5 02:30 /sys/block/sda -> ../devices/pci0000:00/0000:00:10.0/host0/target0:0:0/0:0:0:0/block/sda

4、重新扫描SCSI总线来加载设备

# echo "- - -" > /sys/class/scsi_host/host0/scan 

5、验证磁盘加载情况
ls -l /sys/block/sdb                            
lrwxrwxrwx 1 root root 0 Dec  5 02:35 /sys/block/sdb -> ../devices/pci0000:00/0000:00:10.0/host0/target0:0:1/0:0:1:0/block/sdb

# fdisk -l

Disk /dev/sda: 21.5 GB,41943040 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
Disk label type: dos
Disk identifier: 0x000a9f38

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048        6143        2048   83  Linux
/dev/sda2   *        6144     1030143      512000   83  Linux
/dev/sda3         1030144    41943039    20456448   8e  Linux LVM

Disk /dev/mapper/cl-root: 9206 MB,9206497280 bytes,17981440 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


Disk /dev/mapper/cl-swap: 4294 MB,4294967296 bytes,8388608 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


Disk /dev/mapper/cl-var: 3145 MB,3145728000 bytes,6144000 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


Disk /dev/mapper/cl-home: 4294 MB,8388608 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


**Disk /dev/sdb: 21.5 GB,41943040 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

**
原文链接:https://www.f2er.com/centos/375110.html

猜你在找的CentOS相关文章