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

Posted Wolf_Dreams

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Redhat 6.4 linux系统不重启识别热添加的硬盘方法相关的知识,希望对你有一定的参考价值。

1.1    选择虚拟机添加一块硬盘

 

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

1.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

1.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

1.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

结束    ok,至此磁盘在不重启linux系统下添加成功^_^!!!

以上是关于Redhat 6.4 linux系统不重启识别热添加的硬盘方法的主要内容,如果未能解决你的问题,请参考以下文章

linux不重启识别新添加的硬盘

VMware安装Linux系统CentOS 6.4

linux redhat 添加硬盘并挂载

RedHat Enterprise Linux 6.4使用网易Centos 6 的yum源

linux redhat 6.5 添加EMC新lun不需要重启系统的办法

RedHat Enterprise Linux 6.4使用yum安装出现This system is not registered to Red Hat Subscription Management