VMware Linux Guest 增加磁盘无需重启的方法
摘要
操作步骤
1 编辑Linux Guest配置,增加磁盘
2 扫描SCSI Bus,添加SCSI设备
[root@BendSha_RHEL5_5_x64 /]# 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 38 305203+ 83 Linux
/dev/sda2 39 2353 18595237+ 83 Linux
/dev/sda3 2354 2610 2064352+ 82 Linux swap / Solaris
Disk /dev/sdb: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 1305 10482381 83 Linux
[root@BendSha_RHEL5_5_x64 /]# ls /sys/class/scsi_host
host0 host11 host14 host17 host2 host22 host25 host28 host30 host6 host9
host1 host12 host15 host18 host20 host23 host26 host29 host4 host7
host10 host13 host16 host19 host21 host24 host27 host3 host5 host8
[root@BendSha_RHEL5_5_x64 /]# echo "- - -" > /sys/class/scsi_host/host0/scan
[root@BendSha_RHEL5_5_x64 /]#
[root@BendSha_RHEL5_5_x64 /]# cat /proc/scsi/scsi
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
Vendor: VMware, Model: VMware Virtual S Rev: 1.0
Type: Direct-Access ANSI SCSI revision: 02
Host: scsi0 Channel: 00 Id: 01 Lun: 00
Vendor: VMware, Model: VMware Virtual S Rev: 1.0
Type: Direct-Access ANSI SCSI revision: 02
Host: scsi1 Channel: 00 Id: 00 Lun: 00
Vendor: NECVMWar Model: VMware SATA CD00 Rev: 1.00
Type: CD-ROM ANSI SCSI revision: 05
Host: scsi0 Channel: 00 Id: 02 Lun: 00
Vendor: VMware, Model: VMware Virtual S Rev: 1.0
Type: Direct-Access ANSI SCSI revision: 02
[root@BendSha_RHEL5_5_x64 /]# 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 38 305203+ 83 Linux
/dev/sda2 39 2353 18595237+ 83 Linux
/dev/sda3 2354 2610 2064352+ 82 Linux swap / Solaris
Disk /dev/sdb: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 1305 10482381 83 Linux
Disk /dev/sdc: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdc doesn't contain a valid partition table
3 格式化并创建挂载点
[root@BendSha_RHEL5_5_x64 /]# mkfs.ext4 /dev/sdc
mke4fs 1.41.12 (17-May-2010)
/dev/sdc is entire device, not just one partition!
Proceed anyway? (y,n) y
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
......
[root@BendSha_RHEL5_5_x64 /]# mkdir /data
[root@BendSha_RHEL5_5_x64 /]# mount /dev/sdc /data/
[root@BendSha_RHEL5_5_x64 /]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 18G 11G 5.5G 67% /
/dev/sda1 289M 30M 245M 11% /boot
tmpfs 941M 0 941M 0% /dev/shm
/dev/sdb1 9.9G 220M 9.2G 3% /logvol
/dev/sdc 20G 172M 19G 1% /data
拓展
[root@BendSha_RHEL5_5_x64 /]# ls /sys/block/
fd0 ram0 ram10 ram12 ram14 ram2 ram4 ram6 ram8 sda sdc
md0 ram1 ram11 ram13 ram15 ram3 ram5 ram7 ram9 sdb sr0
[root@BendSha_RHEL5_5_x64 /]# echo 1 > /sys/block/sdc/device/delete
[root@BendSha_RHEL5_5_x64 /]# ls /sys/block/
fd0 ram0 ram10 ram12 ram14 ram2 ram4 ram6 ram8 sda sr0
md0 ram1 ram11 ram13 ram15 ram3 ram5 ram7 ram9 sdb
[root@BendSha_RHEL5_5_x64 /]# echo "scsi add-single-device 0 0 2 0">/proc/scsi/scsi
[root@BendSha_RHEL5_5_x64 /]# cat /proc/scsi/scsi
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
Vendor: VMware, Model: VMware Virtual S Rev: 1.0
Type: Direct-Access ANSI SCSI revision: 02
Host: scsi0 Channel: 00 Id: 01 Lun: 00
Vendor: VMware, Model: VMware Virtual S Rev: 1.0
Type: Direct-Access ANSI SCSI revision: 02
Host: scsi1 Channel: 00 Id: 00 Lun: 00
Vendor: NECVMWar Model: VMware SATA CD00 Rev: 1.00
Type: CD-ROM ANSI SCSI revision: 05
Host: scsi0 Channel: 00 Id: 02 Lun: 00
Vendor: VMware, Model: VMware Virtual S Rev: 1.0
Type: Direct-Access ANSI SCSI revision: 02
[root@BendSha_RHEL5_5_x64 /]# 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 38 305203+ 83 Linux
/dev/sda2 39 2353 18595237+ 83 Linux
/dev/sda3 2354 2610 2064352+ 82 Linux swap / Solaris
Disk /dev/sdb: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 1305 10482381 83 Linux
Disk /dev/sdd: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdd doesn't contain a valid partition table
VMware Linux Guest 增加磁盘无需重启的方法的更多相关文章
- VMware虚拟机Linux中增加磁盘空间的扩容操作
VMwareware虚拟机安装的Red Hat Enterprise Linux系统剩余空间不足,造成软件无法正常安装.如果重新装一遍系统就需要重新配置好开发环境和软件的安装配置.结合自己的实践,总结 ...
- linux下增加磁盘改变指定文件路径分区挂载点和迁移数据
Centos7 系统上原有目录/data 挂载根目录下,空间有点小,我们需要把/data目录挂载到另一个磁盘,同时把数据迁移. 1.查看分区情况 fdisk -l 2.查看路径对应分区情况 df -l ...
- VMware Workstation 12 增加磁盘容量 Windows Server 2012 系统
1.安装虚拟机后,检查C盘容量大小,发现C盘现在的空间是59.9GB,如下图: 2.使用window+R键,出现运行窗口,输入‘cmd’——>‘cd C:\Program Files (x86) ...
- VMware Workstation 12 增加磁盘容量 Windows Server 2012 系统 扩展
1.安装虚拟机后,检查C盘容量大小,发现C盘现在的空间是59.9GB,如下图: 2.使用window+R键,出现运行窗口,输入‘cmd’——>‘cd C:\Program Files (x86) ...
- linux下面增加磁盘空间
1.先看看情况 [root@localhost tmp]# fdisk -l Disk /dev/sda: 3221 MB, 3221225472 bytes 255 heads, 63 sector ...
- VMware Linux 共享文件夹 虚拟机无共享文件解决方法
恢复虚拟机ubuntu后,首先,点击 虚拟机——安装VMware Tools(Install VMware Tools),这时我们会在Ubuntu系统桌面上发现VMware Tools的光盘图标. 双 ...
- vmware虚拟机挂载Windows磁盘的两种方法
第一种 vmware虚拟机通过ntfs-3g挂接windows盘 1.共享windows盘虚拟机设置——>添加硬盘——>选择IDE——>使用物理磁盘——>选择本地盘(单分区)— ...
- [CentOS7] [VMWARE] 增加磁盘空间后扩大逻辑分区
Learn to rescan disk in Linux VM when its backed vdisk in vmware is extended. This method does not r ...
- 【转载】VMware下LINUX的虚拟机增加磁盘空间
转载自:http://space.itpub.net/24435147/viewspace-694200 VMware6.7安装目录下有一个命令行工具vmware-vdiskmanager.exe 程 ...
随机推荐
- [CSS]多浏览器兼容的垂直居中,兼容多个IE
相信你都是在兼容垂直居中而烦恼,翻阅多个网站总是找不到理想的方法而苦恼,来到这里你的问题解决了!如果对你有帮助请点个赞,谢谢. 多兼容垂直居中,在IE6-9亲自测试并通过 <!doctype h ...
- maven安装配置
1.到官网下载maven http://maven.apache.org/download.html 2.解压后解压到任意文件路径 本地解压的位置:C:\soft\apache-maven-3.3.9 ...
- 提升linux下tcp服务器并发连接数限制
1.修改用户进程可打开文件数限制 在Linux平台上,无论编写客户端程序还是服务端程序,在进行高并发TCP连接处理时,最高的并发数量都要受到系统对用户单一进程同时可打开文件数量的限制(这是因为系统 ...
- sql server中除数为零的处理技巧
在sql server中做除法处理的时候,我们经常需要处理除数为零的情况,因为如果遇到这种情况的时候,sqlserver会抛出遇到以零作除数错误的异常,我们总不希望把这个异常显示给用户吧. 做个会报这 ...
- EF 底层基础方法
1 using System; 2 using System.Data; 3 using System.Collections.Generic; 4 using System.Data.Entity; ...
- 在windows下使用visual studio code建立.NET Core console程序
开发环境准备 下载vs code,.NET Core sdk: https://www.microsoft.com/net/core#windowscmd 目前最新版为code 1.8.1,.NET ...
- JQuery 刷新关闭页面
关闭当前页面,刷新之前页面(js): window.opener.location.href = window.opener.location.href; window.close(); 刷新当前页面 ...
- CSS考试题目
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- sscanf与正则表达式(转)
今天翻google reader的时候看到这样一篇文章,介绍的是sscanf的高级用法.直到今天我才知道sscanf是可以直接用正则表达式的,惭愧. 在msdn中sscanf的声明如下 int ssc ...
- hdu4578 Transformation
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4578 题目大意:n个数(初始为0)m个操作,操作类型有4种,操作1把区间的每个数+a,操作2把区间的每 ...