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

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

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

linux系统下重启tomcat的shell脚本

linux系统下重启tomcat的shell脚本: tomcat_home=/opt/apache-tomcat-6.0.32 #找到tomcat进程的id并kill掉 ps -ef |grep tomcat |awk {'print $2'} | sed -e "s/^/kill -9 /g" | sh - #删除日志文件,如果你不先删除可以不要下面一行 rm $tomcat_home/logs/* -rf #删除tomcat的临时目录 rm $tomcat_home/work/*

Linux 系统中重启数据库

Linux 系统中重启数据库: 1.进入数据库用户:  su - oracle 2.先关闭监听: lsnrctl stop 3.再关闭数据库服务 :  sqlplus shutdown immediate 4.开启数据库服务:sqlplus startup 5.开启监听:lsnrctl start 版权声明:本文为博主原创文章,未经博主允许不得转载.

Linux 系统关机重启命令

Linux 系统关机重启 关机 (系统的关机.重启以及登出 ) shutdown -h now 关闭系统(1) init 0 关闭系统(2) telinit 0 关闭系统(3) shutdown -h hours:minutes & 按预定时间关闭系统 shutdown -c 取消按预定时间关闭系统 shutdown -r now 重启(1) reboot 重启(2) logout 注销 原文地址:https://www.cnblogs.com/huao990928/p/12321815.htm

Linux系统下取IP地址的几种方法

Linux系统下取IP地址所在行的方法:(1).ifconfig eth0 | grep "inet addr"          inet addr:10.57.36.112  Bcast:10.57.36.255  Mask:255.255.255.0注释:grep过滤包含"inet addr"字符串的内容(2).ifconfig eth0 | sed -n '2p'          inet addr:10.57.36.112  Bcast:10.57.36

【Linux】查看所使用的Linux系统是32位还是64 位的方法

转自:http://blog.csdn.net/u014455929/article/details/52469658 查看所使用的Linux系统是32位还是64 位的方法 方法一:getconf LONG_BIT # getconf LONG_BIT 1 1 我的Linux是32位!!! 方法二:arch # arch 1 1 显示 i686 就是32位,显示 x86_64 就是64位 方法三:file /bin/ls # file /bin/ls 1 1 方法四:uname -a # una

Linux系统采用netstat命令查看DDOS攻击的方法

Linux系统采用netstat命令查看DDOS攻击的方法 来源:互联网 作者:佚名 时间:07-05 15:10:21 [大 中 小] 这篇文章主要为大家介绍了Linux系统采用netstat命令查看DDOS攻击的方法,对于网络安全而言非常重要!需要的朋友可以参考下 Linux系统用netstat命令查看DDOS攻击具体命令用法如下: 复制代码 代码如下: netstat -na 显示所有连接到服务器的活跃的网络连接 复制代码 代码如下: netstat -an | grep :80 | so

linux系统之间通过nfs网络文件系统挂载设置方法

linux系统之间通过nfs网络文件系统挂载设置方法 NFS允许一个系统在网络上与他人共享目录和文件,通过使用NFS,用户和程序可以像访问本地文件一样访问远端系统上的文件,下面介绍linux系统之间通过nfs网络文件系统挂载的设置方法 NFS简介 NFS是Network File System的简写,即网络文件系统. 网络文件系统是FreeBSD支持的文件系统中的一种,也被称为NFS. NFS允许一个系统在网络上与他人共享目录和文件.通过使用NFS,用户和程序可以像访问本地文件一样访问远端系统上

Linux系统是32位还是64位查看方法总结

[声明] 本文版权归原作者所有,欢迎转载,转载请注明出处. 原作者:潇湘隐者 出处:http://www.cnblogs.com/kerrycode/ 原文链接:https://www.cnblogs.com/kerrycode/p/3785768.html Linux系统是32位还是64位查看方法总结 方法1:getconf LONG_BIT 查看 如下例子所示: 32位Linux系统显示32, 64位Linux系统显示64.最简单.快捷的方法. [[email protected] ~]#

Linux 在线新增硬盘,系统不重启识别新增硬盘

不想关闭系统直接添加磁盘,发现linux系统不自动识别新增加的硬盘: 1.查看现有的磁盘,只有一块磁盘sda: [[email protected] ~]# 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