Vmware Workstation增加硬盘空间

Vmware Workstation增加硬盘空间
************
先将虚拟机Power Off,在Virtual Machine Setting对话框里点击左下角的“Add”,选择“Hard Disk”,之后选择“Create a new virtual disk”,分配容量。
[root@centos u01]# df -h
文件系统              容量  已用 可用 已用% 挂载点
/dev/sda1             6.8G  6.8G     0 100% /
tmpfs                 506M     0  506M   0% /dev/shm
①fdisk -l查看是否识别了新硬盘,如果添加的是IDE硬盘,就应该看到hdb,如果是SCSI硬盘,看到的就应该是sdb
[root@centos u01]# fdisk -l

Disk /dev/sda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         913     7333641   83  Linux
/dev/sda2             914        1044     1052257+  82  Linux swap / Solaris

Disk /dev/sdb: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb doesn't contain a valid partition table
②使用fdisk /dev/sdc,在出现的选项中选择“w”,即将分区表写入硬盘并退出
[root@centos u01]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
③fdisk -l查看
[root@centos u01]# fdisk -l

Disk /dev/sda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         913     7333641   83  Linux
/dev/sda2             914        1044     1052257+  82  Linux swap / Solaris

Disk /dev/sdb: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
[root@centos u01]# df -h
文件系统              容量  已用 可用 已用% 挂载点
/dev/sda1             6.8G  6.8G     0 100% /
tmpfs                 506M     0  506M   0% /dev/shm
④用mkfs命令将其格式化,mkfs /dev/sdc
[root@centos u01]# mkfs /dev/sdb
mke2fs 1.39 (29-May-2006)
/dev/sdb is entire device, not just one partition!
Proceed anyway? (y,n) y
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
524288 inodes, 1048576 blocks
52428 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1073741824
32 block groups
3
⑤用mount命令将其挂载,mount -t ext2 /dev/sdb /media
[root@centos u01]# mount -t ext2 /dev/sdb /media
[root@centos u01]# df -h
文件系统              容量  已用 可用 已用% 挂载点
/dev/sda1             6.8G  6.8G     0 100% /
tmpfs                 506M     0  506M   0% /dev/shm
/dev/sdb              4.0G  8.0M  3.8G   1% /media
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值