VM虚拟机中Linux扩展磁盘空间的方法

一 VM中删除快照,扩展磁盘

二 

linux-ffa4:~ # fdisk -l

Disk /dev/sda: 75.2 GB, 75161927680 bytes
255 heads, 63 sectors/track, 9137 cylinders, total 146800640 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 identifier: 0x0003f680

Device Boot Start End Blocks Id System
/dev/sda1 2048 4208639 2103296 82 Linux swap / Solaris
/dev/sda2 * 4208640 104857599 50324480 83 Linux

 

linux-ffa4:~ # fdisk /dev/sda

Command (m for help): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)

 

我们执行一下该命令:

[root@db1 dev]# partprobe

Warning: Unable to open /dev/hdc read-write (Read-only file system).  /dev/hdc has been opened read-only.

如果还有错误,可以从错误中看出来,需要reboot重启然后再mkfs格式化硬盘空间就可以了。

mkfs -t ext3 /dev/sda3

 

mount /dev/sda3 /exapp

现在分区好了我们用mount 挂载一下该分区即可使用了,这里我把它挂载到mnt目录下

 

 

如果想每次系统重启都能自动挂载该分区可修改/etc/fstab文件,在最后加一段 /dev/sda3    /www    ext3    defaults 1 2 (格式说明:/dev/sdb1 代表哪个分区  ext3是该分区的格式 defaults 是挂载时所要设定的参数(只读,读写,启用quota等),输入defaults包括的参数有(rw、dev、exec、auto、nouser、async) ,1是使用dump是否要记录,0是不要。 2是开机时检查的顺序,是boot系统文件就为1,其他文件系统都为2,如不要检查就为0)

 

 /dev/sda3    /www    ext3    defaults  就行了。

 

 

 

 

 

 

 、

 

 

转载于:https://www.cnblogs.com/psy5choit/p/7552409.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值