CentOS 6.8不重启在线增加硬盘
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了CentOS 6.8不重启在线增加硬盘相关的知识,希望对你有一定的参考价值。
有的时候因为硬盘空间不够,需要在线增加硬盘,有的时候因为无法识别就可能需要重启服务器。
这里介绍一下服务器在不重启的情况下,增加硬盘操作。
[[email protected] ~]# fdisk -l Disk /dev/sda: 42.9 GB, 42949672960 bytes 255 heads, 63 sectors/track, 5221 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 * 1 13 104391 83 Linux /dev/sda2 14 5221 41833260 8e Linux LVM Disk /dev/sdb: 193.2 GB, 193273528320 bytes 255 heads, 63 sectors/track, 23497 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/sdb doesn‘t contain a valid partition table Disk /dev/dm-0: 21.4 GB, 21474836480 bytes 255 heads, 63 sectors/track, 2610 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/dm-0 doesn‘t contain a valid partition table Disk /dev/dm-1: 209.2 GB, 209278992384 bytes 255 heads, 63 sectors/track, 25443 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/dm-1 doesn‘t contain a valid partition table Disk /dev/dm-2: 4294 MB, 4294967296 bytes 255 heads, 63 sectors/track, 522 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/dm-2 doesn‘t contain a valid partition table
我硬盘里已经有2块硬盘,但是我刚才又增加了一块,有3块硬盘。
这里无法找到新的/dev/sdc
1.确定磁盘的总线号
[[email protected] ~]# ls /sys/class/scsi_host/ host0
这里只有一个host0
2.重新扫描scsi总线来添加设备
[[email protected] host0]# echo "- - -" > /sys/class/scsi_host/host0/scan
3.查看硬盘
[[email protected] host0]# fdisk -l Disk /dev/sda: 42.9 GB, 42949672960 bytes 255 heads, 63 sectors/track, 5221 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 * 1 13 104391 83 Linux /dev/sda2 14 5221 41833260 8e Linux LVM Disk /dev/sdb: 193.2 GB, 193273528320 bytes 255 heads, 63 sectors/track, 23497 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/sdb doesn‘t contain a valid partition table Disk /dev/dm-0: 21.4 GB, 21474836480 bytes 255 heads, 63 sectors/track, 2610 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/dm-0 doesn‘t contain a valid partition table Disk /dev/dm-1: 209.2 GB, 209278992384 bytes 255 heads, 63 sectors/track, 25443 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/dm-1 doesn‘t contain a valid partition table Disk /dev/dm-2: 4294 MB, 4294967296 bytes 255 heads, 63 sectors/track, 522 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/dm-2 doesn‘t contain a valid partition table Disk /dev/sdc: 128.8 GB, 128849018880 bytes 255 heads, 63 sectors/track, 15665 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/sdc doesn‘t contain a valid partition table
多了一个sdc,下面就可以进行分区了。
说明:
以上可能会出现如
[[email protected] ~]# ls /sys/class/scsi_host/ host0 host1 host2
三个总线,这需要逐个去重新扫描
[[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
或者如果你的环境不是scsi磁盘(sas/sata也属于scsi),则扫描的可能就是scsi_host了
本文出自 “枫林晚” 博客,请务必保留此出处http://fengwan.blog.51cto.com/508652/1844341
以上是关于CentOS 6.8不重启在线增加硬盘的主要内容,如果未能解决你的问题,请参考以下文章