码迷,mamicode.com
首页 > 系统相关 > 详细

Redhat 6.4 linux系统不重启识别热添加的硬盘方法

时间:2018-06-10 15:25:51      阅读:712      评论:0      收藏:0      [点我收藏+]

标签:执行   roo   nbsp   方式   ble   update   目录   offset   login   

1、选择虚拟机添加一块硬盘

技术分享图片

 

2、查看系统当前磁盘信息

[root@zhongyi-test ~]# 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命令行执行以下命令

[root@zhongyi-test ~]# echo "- - -" > /sys/class/scsi_host/host0/scan
[root@zhongyi-test ~]# echo "- - -" > /sys/class/scsi_host/host1/scan
[root@zhongyi-test ~]# echo "- - -" > /sys/class/scsi_host/host2/scan

4、查看/var/log/messages系统日志,出现重新扫描磁盘日志

[root@zhongyi-test ~]# 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/目录):
[root@zhongyi-test ~]# 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命令查看):
[root@zhongyi-test ~]# 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系统下添加成功^_^!!!

Redhat 6.4 linux系统不重启识别热添加的硬盘方法

标签:执行   roo   nbsp   方式   ble   update   目录   offset   login   

原文地址:https://www.cnblogs.com/Wolf-Dreams/p/9162469.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!