有的時候由於硬盤空間不夠,須要在線增長硬盤,有的時候由於沒法識別就可能須要重啓服務器。
bash
這裏介紹一下服務器在不重啓的狀況下,增長硬盤操做。服務器
[root@dbackup ~]# 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塊硬盤。ide
這裏沒法找到新的/dev/sdcit
1.肯定磁盤的總線號
io
[root@dbackup ~]# ls /sys/class/scsi_host/ host0
這裏只有一個host0table
2.從新掃描scsi總線來添加設備class
[root@dbackup host0]# echo "- - -" > /sys/class/scsi_host/host0/scan
3.查看硬盤db
[root@dbackup79 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,下面就能夠進行分區了。tab
說明:di
以上可能會出現如
[root@backup ~]# ls /sys/class/scsi_host/ host0 host1 host2
三個總線,這須要逐個去從新掃描
[root@backup ~]# echo "- - -" > /sys/class/scsi_host/host0/scan [root@backup ~]# echo "- - -" > /sys/class/scsi_host/host1/scan [root@backup ~]# echo "- - -" > /sys/class/scsi_host/host2/scan
或者若是你的環境不是scsi磁盤(sas/sata也屬於scsi),則掃描的可能就是scsi_host了