Redhat 6.4 linux系统不重启识别热添加的硬盘方法
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了Redhat 6.4 linux系统不重启识别热添加的硬盘方法,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含4438字,纯文字阅读大概需要7分钟。
内容图文

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系统下添加成功^_^!!!
原文:https://www.cnblogs.com/Wolf-Dreams/p/9162469.html
内容总结
以上是互联网集市为您收集整理的Redhat 6.4 linux系统不重启识别热添加的硬盘方法全部内容,希望文章能够帮你解决Redhat 6.4 linux系统不重启识别热添加的硬盘方法所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。