I. Overview
The virtual machine knows that if the system is running to add a new device to the virtual machine, such as a hard disk, the system is not read the new hard disk, because the system will be in the boot to detect hardware devices. But we may also encounter such a situation, such as running a more important program, this time do not want to restart the Linux system, but also need to add a new hard disk, what to do? This is the case today, VMware added a new hard disk, the system does not recognize, so Baidu, there are a lot of articles, but most of them are to set up LVM, I am lazy, do not want to do so complex, finally found a file to tell how to add a new hard drive without restarting and recognize it, So the general operation, and records summarized down.
Second, the test environment:
1.Linux System: CentOS6.5 32bit
2.vmware:8.04
3. Hard drive Type: SCSI---the system can only add SCSI hard drive during power-on operation
Third, the virtual machine to add hard disk
A single file stores virtual disks--and next--the disk file name is filled--and OK
Iv. operating on Linux systems
After adding a new virtual hard disk, you cannot see the device information for the hard disk under Linux:
Fdisk–l--The result doesn't show the information for the new drive
Follow the steps below to make the Linux system reread and recognize the new hard drive:
1. Determine the host bus number:
1: [root@ineedle~] # ls/sys/class/scsi_host/
2: host0 host1 Host2
2. Rescan the SCSI bus to add the device :
1: [ root @ Ineedle ~] Span style= "background:white; Color:green "># echo"---">/sys/class/scsi_host/host0/scan
2: [ root @ ineedle ~] # echo"---">/sys/class/scsi_host/host1/scan
3: [ root @ ineedle ~] # echo"---">/sys/class/scsi_host/host2/scan
3. Verify that the drive adds results:
1: disk / dev / SDC : 21.5 GB 21474836480 bytes
2: 255 headssectors /track2610cylinders
3:Units = Cylinders of 16065 * + = 8225280 bytes
4:Sector size (logical/Physical): + bytes / + bytes
5:I/O size (Minimum/Optimal): + bytes / + bytes
6: Disk identifier:0 x00000000
you can see that our newly added hard drive has been properly read by the system.
The CentOS system adds a new hard disk to the virtual machine without rebooting