为Linux虚拟机增加磁盘空间

在做Oracle 备份恢复实验时,发现我的Linux虚拟机空间不足。
以下为增加10G空间的步骤。
一    将Linux系统Power Off ,在虚拟机设置中选择 Add-->Hard Disk-->Next ....
二    启动Linux,用Root用户进入系统
三    为磁盘创建文件系统:mkfs.ext3 /dev/sdb
四    挂载
    [root@xugj ~]#  mkdir /mnt/sdb
    [root@xugj ~]#  mount /dev/sdb   /mnt/sdb
五    分区: fdisk /dev/sdb

点击(此处)折叠或打开

  1. [root@xugj ~]# fdisk /dev/sdb
  2. Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklab el
  3. Building a new DOS disklabel. Changes will remain in memory only,
  4. until you decide to write them. After that, of course, the previous
  5. content won't be recoverable.
  6. The number of cylinders for this disk is set to 1305.
  7. There is nothing wrong with that, but this is larger than 1024,
  8. and could in certain setups cause problems with:
  9. 1) software that runs at boot time (e.g., old versions of LILO)
  10. 2) booting and partitioning software from other OSs
  11. (e.g., DOS FDISK, OS/2 FDISK)
  12. Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
  13. Command (m for help): m
  14. Command action
  15. a toggle a bootable flag
  16. b edit bsd disklabel
  17. c toggle the dos compatibility flag
  18. d delete a partition
  19. l list known partition types
  20. ………………
  21. Command (m for help): n
  22. Command action
  23. e extended
  24. p primary partition (1-4)
  25. p
  26. Partition number (1-4): 1
  27. First cylinder (1-1305, default 1):
  28. Using default value 1
  29. Last cylinder or +size or +sizeM or +sizeK (1-1305, default 1305):
  30. Using default value 1305
  31. Command (m for help): p
  32. Disk /dev/sdb: 10.7 GB, 10737418240 bytes
  33. 255 heads, 63 sectors/track, 1305 cylinders
  34. Units = cylinders of 16065 * 512 = 8225280 bytes
  35. Device Boot Start End Blocks Id System
  36. /dev/sdb1 1 1305 10482381 83 Linux
  37. Command (m for help): w
  38. The partition table has been altered!
  39. Calling ioctl() to re-read partition table.
  40. WARNING: Re-reading the partition table failed with error 0: 成功.
  41. The kernel still uses the old table.
  42. The new table will be used at the next reboot.
  43. Syncing disks.

六: 将“挂载”动作添加到开机执行中
[root@xugj ~]# vi /etc/fstab
 添加一行:
 /dev/sdb       /mnt/sdb    ext3    defaults        0 1

七:检验
[root@xugj ~]# df -h
文件系统                                                      容量              已用         可用         已用%    挂载点
/dev/mapper/VolGroup00-LogVol00                 5.7G             4.8G         596M        90%        /
/dev/sda1                                                    99M              9.8M         84M          11%        /boot
tmpfs                                                          379M            0               379M         0%        /dev/shm
/dev/mapper/VolGroup00-LogVol01                 4.9G             2.8G         1.9G          61%       /home
/dev/mapper/VolGroup00-LogVol03                 279M            48M          218M         18%       /tmp
/dev/sdb                                                      9.9G             151M        9.2G          2%         /var

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/30066956/viewspace-2105607/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/30066956/viewspace-2105607/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值