In vmware linux, after a new disk is added, refresh the disk, scan the SCSI bus again, and add the SCSI device without restarting the VM.

Source: Internet
Author: User

In vmware linux, after a new disk is added, refresh the disk, scan the SCSI bus again, and add the SCSI device without restarting the VM.

[Root @ centos4 scsi_host] # ls

Host0 host1 host2

[Root @ centos4 scsi_host] # 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 (minimum/optimal): 512 bytes/512 bytes

Disk label type: dos

Disk identifier: 0x00081e99

Device Boot Start End Blocks Id System

/Dev/sda1*2048 2099199 1048576 83 Linux

/Dev/sda2 2099200 41943039 19921920 8e Linux LVM

Disk/dev/mapper/centos-root: 18.2 GB, 18249416704 bytes, 35643392 sectors

Units = sectors of 1*512 = 512 bytes

Sector size (logical/physical): 512 bytes/512 bytes

I/O size (minimum/optimal): 512 bytes/512 bytes

Disk/dev/mapper/centos-swap: 2147 MB, 2147483648 bytes, 4194304 sectors

Units = sectors of 1*512 = 512 bytes

Sector size (logical/physical): 512 bytes/512 bytes

I/O size (minimum/optimal): 512 bytes/512 bytes

[Root @ centos4 scsi_host] # echo "---">/sys/class/scsi_host/host0/scan

[Root @ centos4 scsi_host] # 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 (minimum/optimal): 512 bytes/512 bytes

Disk label type: dos

Disk identifier: 0x00081e99

Device Boot Start End Blocks Id System

/Dev/sda1*2048 2099199 1048576 83 Linux

/Dev/sda2 2099200 41943039 19921920 8e Linux LVM

Disk/dev/mapper/centos-root: 18.2 GB, 18249416704 bytes, 35643392 sectors

Units = sectors of 1*512 = 512 bytes

Sector size (logical/physical): 512 bytes/512 bytes

I/O size (minimum/optimal): 512 bytes/512 bytes

Disk/dev/mapper/centos-swap: 2147 MB, 2147483648 bytes, 4194304 sectors

Units = sectors of 1*512 = 512 bytes

Sector size (logical/physical): 512 bytes/512 bytes

I/O size (minimum/optimal): 512 bytes/512 bytes

Disk/dev/sdb: 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 (minimum/optimal): 512 bytes/512 bytes

[Root @ centos4 scsi_host] # lsblk

Name maj: MIN RM SIZE RO TYPE MOUNTPOINT

Sda 8:0 0 20G 0 disk

Ipv── sda1 8:1 0 1G 0 part/boot

└ ── Sda2 8:2 0 19G 0 part

├ ── Centos-root 253: 0 0 17G 0 lvm/

└-Centos-swap 253: 1 0 2G 0 lvm [SWAP]

Sdb 8: 16 0 20G 0 disk

Sr0 1 4.2G 0 rom

[Root @ centos4 scsi_host] #

Re-scan the SCSI bus. Adding a SCSI device without restarting the VM will cause

Boot into dracut #

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.