遇到该问题,网上扒拉了很多资料,讲的晕乎乎了,至少看了5篇文章都搞定。是我太笨了。具体vmware添加硬盘的过程就不写了。记得是必须选择SCSI或者SATA类型的接口和把虚拟磁盘存储为单个文件。
网上说的<H>、<B>、<T>、<L>这几个我是没理解。只知道H是host,其他的没对应。可能就是这里不理解造成的吧。
还有下边的一句,我更不理解。
[root@localhost ~]# echo "scsi add-single-device 0 0 1 0" > /proc/scsi/scsi
下边这个也不理解。也蒙不对,或许你可以。下边有解释。
echo "- - -" > /sys/class/scsi_host/host2/scan
先查看一下原有的磁盘个数和大小。我原来是两个 sda和sdb。现在添加了个sdc
格式出问题了。将就看吧。
[root@localhost ~]# fdisk -l Disk /dev/sda: 21.5 GB, 21474836480 bytes, 41943040 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk label type: dosDisk identifier: 0x000c55de Device Boot Start End Blocks Id System/dev/sda1 * 2048 2099199 1048576 83 Linux/dev/sda2 2099200 41943039 19921920 8e Linux LVMWARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.Disk /dev/sdb: 3221 MB, 3221225472 bytes, 6291456 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk label type: gptDisk identifier: B96F00DE-E5C8-4F6F-B022-447E95A47920# Start End Size Type Name 1 34 5859375 2.8G Microsoft basic primaryDisk /dev/mapper/centos-root: 19.3 GB, 19323158528 bytes, 37740544 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk /dev/mapper/centos-swap: 2147 MB, 2147483648 bytes, 4194304 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytes
查看一下原有磁盘对应的一些参数,这里我认为是重点
[root@localhost ~]# [root@localhost ~]# cat /proc/scsi/scsi Attached devices: Host: scsi1 Channel: 00 Id: 00 Lun: 00 Vendor: VMware, Model: VMware Virtual S Rev: 1.0 Type: Direct-Access A NSI SCSI reVision: 02 Host: scsi1 Channel: 00 Id: 01 Lun: 00 Vendor: VMware, Model: VMware Virtual S Rev: 1.0 Type: Direct-Access ANSI SCSI revision: 02Host: scsi2 Channel: 00 Id: 00 Lun: 00 Vendor: NECVMWar Model: VMware SATA CD01 Rev: 1.00 Type: CD-ROM ANSI SCSI revision: 05
只知道硬盘是直连的设备所以显示Direct-Access,最下边的是CD-ROM 。硬盘是scsi1,光驱是scsi2
敲黑板,划重点。敲黑板,划重点。敲黑板,划重点
硬盘是scsi1对应的就是host1
光驱是scsi2对应的就是host2
执行 echo "- - -" > /sys/class/scsi_host/host2/scan
[root@localhost ~]# echo "- - -" > /sys/class/scsi_host/host1/scan[root@localhost ~]# [root@localhost ~]#
[root@localhost ~]# 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: 0x000c55de Device Boot Start End Blocks Id System /dev/sda1 * 2048 2099199 1048576 83 Linux /dev/sda2 2099200 41943039 19921920 8e Linux LVM WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion. Disk /dev/sdb: 3221 MB, 3221225472 bytes, 6291456 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: gpt Disk identifier: B96F00DE-E5C8-4F6F-B022-447E95A47920 # Start End Size Type Name 1 34 5859375 2.8G Microsoft basic primary Disk /dev/mapper/centos-root: 19.3 GB, 19323158528 bytes, 37740544 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/sdc: 5368 MB, 5368709120 bytes, 10485760 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@localhost ~]#
推荐相关lvm文章
万能数据恢复大师怎么找回硬盘中数据?-万能数据恢复大师找回硬盘中数据教程
建议收藏:「保姆级」系统安装教程,WinXP~Win11 都适用