下文簡(jiǎn)單介紹一個(gè)方法,實(shí)現(xiàn)不重新啟動(dòng)linux而可以識(shí)別到新增的磁盤.
成都創(chuàng)新互聯(lián)是一家集網(wǎng)站建設(shè),隨縣企業(yè)網(wǎng)站建設(shè),隨縣品牌網(wǎng)站建設(shè),網(wǎng)站定制,隨縣網(wǎng)站建設(shè)報(bào)價(jià),網(wǎng)絡(luò)營(yíng)銷,網(wǎng)絡(luò)優(yōu)化,隨縣網(wǎng)站推廣為一體的創(chuàng)新建站企業(yè),幫助傳統(tǒng)企業(yè)提升企業(yè)形象加強(qiáng)企業(yè)競(jìng)爭(zhēng)力??沙浞譂M足這一群體相比中小企業(yè)更為豐富、高端、多元的互聯(lián)網(wǎng)需求。同時(shí)我們時(shí)刻保持專業(yè)、時(shí)尚、前沿,時(shí)刻以成就客戶成長(zhǎng)自我,堅(jiān)持不斷學(xué)習(xí)、思考、沉淀、凈化自己,讓我們?yōu)楦嗟钠髽I(yè)打造出實(shí)用型網(wǎng)站。環(huán)境描述:
OS: Redhat linux 5.4 x86(主機(jī)為vmware 虛擬主機(jī))
增加一個(gè)50G的lun
方法一:
一. 手工增加磁盤的命令
# echo "scsi add-single-device w x y z" > /proc/scsi/scsi
為使該命令正常運(yùn)行,必須指定正確的參數(shù)值 w、x、y 和 z,如下所示:
w 是主機(jī)適配器標(biāo)識(shí),第一個(gè)適配器為零(0)
x 是主機(jī)適配器上的 SCSI 通道,第一個(gè)通道為零(0)
y 是設(shè)備的 SCSI 標(biāo)識(shí)
z 是 LUN 號(hào),第一個(gè) LUN 為零(0)
二. 執(zhí)行命令前,檢查/proc/scsi/scsi文件,確定新磁盤的id
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
Vendor: VMware Model: Virtual disk Rev: 1.0
Type: Direct-Access ANSI SCSI revision: 02
Host: scsi0 Channel: 00 Id: 01 Lun: 00
Vendor: VMware Model: Virtual disk Rev: 1.0
Type: Direct-Access ANSI SCSI revision: 02
Host: scsi0 Channel: 00 Id: 02 Lun: 00
Vendor: VMware Model: Virtual disk Rev: 1.0
Type: Direct-Access ANSI SCSI revision: 02
Host: scsi0 Channel: 00 Id: 03 Lun: 00
Vendor: VMware Model: Virtual disk Rev: 1.0
Type: Direct-Access ANSI SCSI revision: 02
Host: scsi0 Channel: 00 Id: 04 Lun: 00
Vendor: VMware Model: Virtual disk Rev: 1.0
Type: Direct-Access ANSI SCSI revision: 02
可以看到大的id號(hào)為04,新增磁盤的ID應(yīng)該確定為5.
三. 執(zhí)行fdisk -l命令,檢查當(dāng)前磁盤的情況
[root@soadb scsi]# fdisk -l
Disk /dev/sda: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 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 2610 20860402+ 8e Linux LVM
......
Disk /dev/sde: 53.6 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sde doesn't contain a valid partition table
四. 執(zhí)行命令
#echo "scsi add-single-device 0 0 5 0" >/proc/scsi/scsi
五. 執(zhí)行fdisk命令,檢查結(jié)果
[root@soadb scsi]# fdisk -l
......
Disk /dev/sde: 53.6 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sde doesn't contain a valid partition table
Disk /dev/sdf: 53.6 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdf doesn't contain a valid partition table
可以看到,新增的50G的磁盤已經(jīng)在操作系統(tǒng)中識(shí)別到,設(shè)備名稱為/dev/sdf.
此時(shí)就可以使用這個(gè)設(shè)備了.
方法二: