1、选择虚拟机添加一块硬盘
2、查看系统当前磁盘信息
[[email protected] ~]# ls -l /dev/sd* brw-rw----. 1 root disk 8, 0 Jun 10 09:49 /dev/sda brw-rw----. 1 root disk 8, 1 Jun 10 09:49 /dev/sda1 brw-rw----. 1 root disk 8, 2 Jun 10 09:49 /dev/sda2 brw-rw----. 1 root disk 8, 3 Jun 10 09:49 /dev/sda3
3、在shell命令行执行以下命令
[[email protected] ~]# echo "- - -" > /sys/class/scsi_host/host0/scan[[email protected] ~]# echo "- - -" > /sys/class/scsi_host/host1/scan[[email protected] ~]# echo "- - -" > /sys/class/scsi_host/host2/scan
4、查看/var/log/messages系统日志,出现重新扫描磁盘日志
[[email protected] ~]# less /var/log/messages Jun 10 10:27:02 zhongyi-test rsyslogd: [origin software="rsyslogd" swVersion="5.8.10" x-pid="1475" x-info="http://www.rsyslog.com"] rsyslogd was HUPed Jun 10 10:27:33 zhongyi-test rhsmd: In order for Subscription Manager to provide your system with updates, your system must be registered with the Customer Portal. Please enter your Red Hat login to ensure your system is up-to-date. Jun 10 10:27:38 zhongyi-test kernel: scsi 2:0:1:0: Direct-Access VMware, VMware Virtual S 1.0 PQ: 0 ANSI: 2 Jun 10 10:27:38 zhongyi-test kernel: scsi target2:0:1: Beginning Domain Validation Jun 10 10:27:38 zhongyi-test kernel: scsi target2:0:1: Domain Validation skipping write tests Jun 10 10:27:38 zhongyi-test kernel: scsi target2:0:1: Ending Domain Validation Jun 10 10:27:38 zhongyi-test kernel: scsi target2:0:1: FAST-40 WIDE SCSI 80.0 MB/s ST (25 ns, offset 127) Jun 10 10:27:38 zhongyi-test kernel: sd 2:0:1:0: [sdb] 62914560 512-byte logical blocks: (32.2 GB/30.0 GiB) Jun 10 10:27:38 zhongyi-test kernel: sd 2:0:1:0: [sdb] Write Protect is off Jun 10 10:27:38 zhongyi-test kernel: sd 2:0:1:0: [sdb] Cache data unavailable Jun 10 10:27:38 zhongyi-test kernel: sd 2:0:1:0: [sdb] Assuming drive cache: write through Jun 10 10:27:38 zhongyi-test kernel: sd 2:0:1:0: [sdb] Cache data unavailable Jun 10 10:27:38 zhongyi-test kernel: sd 2:0:1:0: [sdb] Assuming drive cache: write through Jun 10 10:27:38 zhongyi-test kernel: sdb: unknown partition table Jun 10 10:27:38 zhongyi-test kernel: sd 2:0:1:0: [sdb] Cache data unavailable Jun 10 10:27:38 zhongyi-test kernel: sd 2:0:1:0: [sdb] Assuming drive cache: write through Jun 10 10:27:38 zhongyi-test kernel: sd 2:0:1:0: [sdb] Attached SCSI disk Jun 10 10:27:38 zhongyi-test kernel: sd 2:0:1:0: Attached scsi generic sg2 type 0
5、验证磁盘是否添加成功(标绿代表添加成功)
方式一(ls命令查看/dev/目录): [[email protected] ~]# ls -l /dev/sd* brw-rw----. 1 root disk 8, 0 Jun 10 09:49 /dev/sda brw-rw----. 1 root disk 8, 1 Jun 10 09:49 /dev/sda1 brw-rw----. 1 root disk 8, 2 Jun 10 09:49 /dev/sda2 brw-rw----. 1 root disk 8, 3 Jun 10 09:49 /dev/sda3 brw-rw----. 1 root disk 8, 16 Jun 10 10:27 /dev/sdb 方法二(fdisk命令查看): [[email protected] ~]# fdisk -l /dev/sd* Disk /dev/sda: 32.2 GB, 32212254720 bytes 255 heads, 63 sectors/track, 3916 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x0009fb16 Device Boot Start End Blocks Id System /dev/sda1 1 26 204800 83 Linux Partition 1 does not end on cylinder boundary. /dev/sda2 * 26 90 512000 83 Linux Partition 2 does not end on cylinder boundary. /dev/sda3 90 3917 30739456 8e Linux LVM Disk /dev/sda1: 209 MB, 209715200 bytes 255 heads, 63 sectors/track, 25 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Disk /dev/sda2: 524 MB, 524288000 bytes 255 heads, 63 sectors/track, 63 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Disk /dev/sda3: 31.5 GB, 31477202944 bytes 255 heads, 63 sectors/track, 3826 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Disk /dev/sdb: 32.2 GB, 32212254720 bytes 255 heads, 63 sectors/track, 3916 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000
6、ok,至此磁盘在不重启linux系统下添加成功^_^!!!
原文地址:https://www.cnblogs.com/Wolf-Dreams/p/9162469.html
时间: 2024-08-17 14:11:46