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 程 ...
随机推荐
- delphi FMX 数字下拉滑动
滑动输入数字 NumberBox控件 HorzIncrement:划动自动增加输入值的步长 combobox控件 http://docwiki.embarcadero.com/RADStudio/Be ...
- BCB中实现拖拽Panel 改变位置和大小的代码
//--------------------------------------------------------------------------- #ifndef Unit1H #define ...
- C# 小例子
数组冒泡排序(升序排序): , , , , , , , , , , , }; //第一种 ; i < num.Length - ; i++) { ; j < num.Length - i ...
- linux 学习3 第四讲 文件常用命令
好几天没有在网上总结了.我把ppt先誊写在本子上,这样听的时候记录就方便很多,添些东西就可以. 我想先看shell那部分,但是没有之前几章的准备,是没法跟着视频动手操作的.所以还是按部就班得学习. 虽 ...
- input[file]标签的accept=”image/*”属性响应很慢的解决办法
转自:http://blog.csdn.net/lx583274568/article/details/52983693 input[file]标签的accept属性可用于指定上传文件的 MIME类型 ...
- c++ 别名
#include <iostream> int main() { ; // 别名 int &ref = i; std::cout << &i << ...
- 嵌套移动APP端的H5页面meta标签
<meta charset="utf-8"> <meta content="width=device-width, initial-scale=1.0, ...
- Android_AsyncTaskDemo之QQ记步数(画圆形图片知识)
今天学习了AsyncTask Android 的异步机制.我简单的实现我的一个小小案例--qq记步数.然后穿插一个画圆形图片的知识点. 由于所学知识有限,目前我计数,还有排名等等我就简单的利用随机数实 ...
- Android菜鸟成长记15 -- BitMap
BitMap简介 Bitmap是Android系统中的图像处理的最重要类之一.用它可以获取图像文件信息,进行图像剪切.旋转.缩放等操作,并可以指定格式保存图像文件.本文从应用的角度,着重介绍怎么用Bi ...
- 如何在cmd下切换不同版本的Python
(1)分别安装python-2.7.12.amd64.msipython-3.5.2-amd64.exe(python官网下载的)顺序无所谓(为了看着方便,我把安装路径修改统一了)(2)配置环境变量D ...