Chinaunix首页 | 论坛 | 博客
  • 博客访问: 91184
  • 博文数量: 59
  • 博客积分: 10
  • 博客等级: 民兵
  • 技术积分: 260
  • 用 户 组: 普通用户
  • 注册时间: 2012-11-09 17:30
文章分类

全部博文(59)

文章存档

2016年(5)

2015年(23)

2014年(30)

2013年(1)

我的朋友

分类: LINUX

2014-12-23 14:53:59

        我们一开始在VMware上安装ubuntu系统,可能会分配比较小的磁盘空间,随着使用的时间增长,ubuntu系统里面的可以空间可能会越来越小,在影响原有的东西的情况下,我们怎么扩大磁盘空间呢?
        一、在ubuntu系统关闭状态下(非挂起状态),点击“VM”->"Setting"->"hard disk"->"utilities"->"expand", 然后可以自行扩展到多少空间(是包括以前的空间);



二、开启ubuntu系统,进入系统之后,进入命令行终端。
        1、fd -h    可以查看当前系统磁盘使用情况

点击(此处)折叠或打开

  1. jim@localhost:~$ df -h
  2. Filesystem Size Used Avail Use% Mounted on
  3. /dev/sda1 5.5G 3.7G 1.6G 70% /
  4. udev 494M 4.0K 494M 1% /dev
  5. tmpfs 201M 1.3M 199M 1% /run
  6. none 5.0M 0 5.0M 0% /run/lock
  7. none 501M 124K 501M 1% /run/shm
  8. /dev/sda6 8.4G 3.8G 4.2G 48% /home
        2、fdisk /dev/sda  对磁盘进行操作模式(添加分区、删除分区等操作)注意:要在root权限下

点击(此处)折叠或打开

  1. root@localhost:/home/jim# fdisk /dev/sda

  2. Command (m for help): m
  3. Command action
  4.    a toggle a bootable flag
  5.    b edit bsd disklabel
  6.    c toggle the dos compatibility flag
  7.    d delete a partition
  8.    l list known partition types
  9.    m print this menu
  10.    n add a new partition
  11.    o create a new empty DOS partition table
  12.    p print the partition table
  13.    q quit without saving changes
  14.    s create a new empty Sun disklabel
  15.    t change a partition's system id
  16.    u change display/entry units
  17.    v verify the partition table
  18.    w write table to disk and exit
  19.    x extra functionality (experts only)
        3、输入 n添加一个分区,会提示添加主分区还是逻辑分区。
        4、输入p选择添加主分区。会提示输入分区号。
        5、系统会提供一个默认未被使用的分区号,可以直接回车使用默认的分区号,也可以自己输入一个未被使用的分区号。
        6、输入起始扇区和结束扇区,都直接回车用默认值。重启之后就会看到/dev/下会多出来sdax,x代表分区号。
        7、切换到root用户,执行mkfs -t ext3 /dev/sdax,进行格式化。
        8、挂载,mount /dev/sdax /home/work,再执行df -h 就可以看到上面添加的新分区了。
        9、在/etc/fstab文件添加  
            /dev/sda4       /home/xair      ext3    defaults,       0       1
            使得系统启动时自动挂载

       注意:如果第一次添加的分区很小,那就再重复添加一个分区,尺寸就会正常了,这个问题目前未能找到什么原因。
阅读(395) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~