国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學(xué)院 > 操作系統(tǒng) > 正文

Vmware擴展磁盤如何不需重啟系統(tǒng)

2024-06-28 14:31:44
字體:
供稿:網(wǎng)友

    在虛擬機Vmware中我們有時候需要添加新的虛擬磁盤或給已有虛擬磁盤擴容(expand),在新增磁盤或磁盤擴容后,linux系統(tǒng)并不能馬上識別到。也就是說你看不到磁盤空間變化(使用fdisk -l查看),這時我們可以通過重啟系統(tǒng)(reboot)解決這個問題,但是很多時候,我們并不想在存儲擴容時重啟系統(tǒng),因為這樣會影響到現(xiàn)有的業(yè)務(wù)系統(tǒng)。那么為什么新增磁盤或磁盤擴容后,Linux系統(tǒng)識別不到呢?這個是因為連接存儲設(shè)備的SCSI總線需要重新掃描,才能識別到這些新的存儲設(shè)備。下面測試一下在添加新的虛擬磁盤或給已有虛擬磁盤擴容如何操作才能不用重啟系統(tǒng)

1:Vmware虛擬磁盤擴容

如下所示,Vmware虛擬磁盤擴容后,使用fdisk -l看不到任何變化

[root@localhost ~]# fdisk -l
 
Disk /dev/sda: 171.7 GB, 171798691840 bytes
255 heads, 63 sectors/track, 20886 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       15665   125724690   8e  Linux LVM
/dev/sda3           15666       15795     1044225   83  Linux
/dev/sda4           15796       20886    40893457+  83  Linux
 
Disk /dev/dm-0: 126.6 GB, 126600871936 bytes
255 heads, 63 sectors/track, 15391 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
 
Disk /dev/dm-0 doesn't contain a valid partition table
 
Disk /dev/dm-1: 2113 MB, 2113929216 bytes
255 heads, 63 sectors/track, 257 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
 
Disk /dev/dm-1 doesn't contain a valid partition table

 

clip_image001

 

方法1:echo 1 > /sys/class/scsi_device/device/rescan

[root@localhost ~]# cd /sys/class/scsi_disk/
[root@localhost scsi_disk]# ls
0:0:0:0
[root@localhost scsi_disk]# cd 0/:0/:0/:0/
[root@localhost 0:0:0:0]# echo '1' > device/rescan 
[root@localhost 0:0:0:0]# fdisk -l
 
Disk /dev/sda: 173.9 GB, 173946175488 bytes
255 heads, 63 sectors/track, 21147 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       15665   125724690   8e  Linux LVM
/dev/sda3           15666       15795     1044225   83  Linux
/dev/sda4           15796       20886    40893457+  83  Linux
 
Disk /dev/dm-0: 126.6 GB, 126600871936 bytes
255 heads, 63 sectors/track, 15391 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
 
Disk /dev/dm-0 doesn't contain a valid partition table
 
Disk /dev/dm-1: 2113 MB, 2113929216 bytes
255 heads, 63 sectors/track, 257 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
 
Disk /dev/dm-1 doesn't contain a valid partition table

clip_image002

 

方法2:重新掃描特定的 SCSI Device

echo 1 > /sys/block/$DEVICE/device/rescan 用sda, sdb, sdc等替換$DEVICE

[root@localhost ~]# echo 1 > /sys/block/sda/device/rescan

2:Vmware新增虛擬磁盤

首先找到您的主機總線編號

[root@localhost ~]# grep mpt /sys/class/scsi_host/host?/PRoc_name
 
/sys/class/scsi_host/host0/proc_name:mptspi

使用下面命令掃描SCSI總線

[root@localhost ~]# echo "- - -" > /sys/class/scsi_host/host0/scan

參考資料:

http://thornelabs.net/2012/08/22/linux-rescan-scsi-bus.html

 


發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 阿勒泰市| 芜湖市| 民县| 秦皇岛市| 隆昌县| 呼图壁县| 泸州市| 阿克陶县| 正阳县| 西宁市| 梅州市| 内丘县| 达拉特旗| 宾川县| 襄城县| 乳山市| 保定市| 南漳县| 阜南县| 德化县| 富阳市| 上杭县| 隆回县| 灯塔市| 鸡西市| 蕲春县| 乌兰浩特市| 册亨县| 北海市| 苗栗县| 溧水县| 灯塔市| 利津县| 夏津县| 怀来县| 曲水县| 桓仁| 祥云县| 高邮市| 榆树市| 潢川县|