首先你要关掉系统,把分配的硬盘空间变大,或者重新建立一个虚拟硬盘(这时下面的就不是sda了,而是sdb1了)。这两种方法都可行,我都试过了。
其次用root用户登录到你的linux系统,查看你系统的分区
 #fdisk   -l                                         
会出现以下的信息:
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          64      512000   83  Linux
/dev/sda2              64        2611    20458496   8e  Linux LVM
 
Disk /dev/mapper/vg_zxw-lv_root: 18.8 GB, 18832424960 bytes
255 heads, 63 sectors/track, 2289 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
 
Disk /dev/mapper/vg_zxw-lv_root doesn't contain a valid partition table
 
Disk /dev/mapper/vg_zxw-lv_swap: 2113 MB, 2113929216 bytes
255 heads, 63 sectors/track, 257 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
 
Disk /dev/mapper/vg_zxw-lv_swap doesn't contain a valid partition table
根据提示信息可以判断出此系统的磁盘接口为SCSI,对应“sda”如果上面的红色字体是“hda”,那么此系统的磁盘接口为IDE对应“hda”所以我做一下操作:

#fdisk   /dev/sda

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').
 
Command (m for help):m                   //“ 列出fdisk的帮助”
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)
 
Command (m for help):n                   //” 命令n用于添加新分区"
Command action
   e   extended
   p   primary partition (1-4)
p                                  //" 选择创建主分区"此时,

Partition number (1-4):3                         //fdisk会让你选择主分区的编号,如果已经有了主分区sda1,sda2,那么编号就选3,即要创建的该分区为sda3.
First cylinder (2611-3916, default 2611):                         //此时,fdisk又会让你选择该分区的开始值这个就是分区的Start 值(start cylinder);这里最好直接按回车,
Using default value 2611
Last cylinder, +cylinders or +size{K,M,G} (2611-3916, default 3916):                    //此时,fdisk又会让你选择该分区的开始值这个就是分区的End 值这里最好直接按回车,
Using default value 3916
 
Command (m for help): w                       //w "保存所有并退出,分区划分完毕"
The partition table has been altered!
 
Calling ioctl() to re-read partition table.
 
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.                                 
三、我们的新建分区/dev/sda3,却不是LVM的。所以,接下来使用fdisk将其改成LVM的。
#fdisk  /dev/sda
Command (m for help): m
Command (m for help): t //改变分区系统id

Partition number (1-4): 3 //指定分区号
Hex code (type L to list codes): 8e //指定要改成的id号,8e代表LVM。
Command (m for help): w
三、重启系统后,登陆系统。(一定要重启系统,否则无法扩充新分区)
四、格式化该新添加的分区:
#fdisk   -l

Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          64      512000   83  Linux
/dev/sda2              64        2611    20458496    8e  Linux LVM
/dev/sda3            2611        3916    10483750    8e  Linux LVM
你会发现多了一块分区。
#mkfs  -t   ext3  /dev/sda3           //在硬盘分区“/dev/sda3”上创建“ext3”文件系统。
然后我们把这个分区挂载到本系统上:

五、使用命令mount

mount -t ext3 /dev/sda3 /mnt/disk2

这里的disk2,是自己建立的要挂载的目录,不知道如何使用该命令的可以使用man命令查看。man mount。

linux添加磁盘空间的更多相关文章

  1. LINUX下添加磁盘空间的方法详解

    给Linux系统添加磁盘空间在工作会经常遇到. 在添加第二块磁盘一般系统默认为hdb(IDE硬盘)sdb(SCSI 硬盘),以hdb为例. linux-isep:~ # fdisk /dev/hdb ...

  2. Linux查看磁盘空间大小命令

    Linux查看磁盘空间大小命令df -hldf -hl 查看磁盘剩余空间df -h 查看每个根路径的分区大小du -sh [目录名] 返回该目录的大小du -sm [文件夹] 返回该文件夹总M数du ...

  3. 给VMware下的Linux扩容磁盘空间到根分区(以centos7.0为例)

    一.扩展VMWare硬盘空间 关闭Vmware 的 Linux系统,这样,才能在VMWare菜单中设置: VM -> Settings... -> Hardware -> Hard ...

  4. linux 查看磁盘空间

    linux 查看磁盘空间大小命令 df :命令是linux系统以磁盘分区为单位查看文件系统,可以加上参数查看磁盘剩余空间信息 df -hl:查看磁盘剩余空间信息,显示如下: 文件系统          ...

  5. 关于Linux服务器磁盘空间占满问题的解决方法

    下面给大家分享一篇关于Linux服务器磁盘占满问题解决方法(/dev/sda3 满了),需要的的朋友参考下吧   下面我们一起来看一篇关于Linux服务器磁盘占满问题解决(/dev/sda3 满了), ...

  6. Linux 磁盘空间查询&&解决Linux 中“磁盘空间不足”的问题

    一.linux 查看目录的剩余空间大小 两个命令df .du结合比较直观 df -h 查看整台服务器的硬盘使用情况 du -lh --max-depth=1 : 查看当前目录下一级子文件和子目录占用的 ...

  7. Linux 查看磁盘空间 相关命令

    Linux 查看磁盘空间 相关命令 实际工作中,我们经常需要查看磁盘空间的使用情况,以防止磁盘空间不足,导致的系统崩溃或者服务异常等问题. 常用的磁盘空间查看命令如下: 1.查看磁盘空间的整体使用情况 ...

  8. ORA-19502: write error on file "", blockno (blocksize=)/linux下磁盘空间满了解决办法--Virtualbox

    今天,在测试环境启动数据库时,报错: SQL> startup; ORACLE instance started. Total System Global Area  285212672 byt ...

  9. VMware虚拟机Linux增加磁盘空间的扩容操作

    转载自点击打开链接 用VMwareware虚拟机安装的Red Hat Enterprise Linux系统剩余空间不足,造成软件无法正常安装.如果重新装一遍系统就需要重新配置好开发环境和软件的安装配置 ...

随机推荐

  1. Spring依赖包

    spring框架jar包 1.下载spring源包spring地址:http://www.springsource.org/download我下的是spring-framework-3.1.0.REL ...

  2. Java基础——Servlet(三)

    还在学习Servlet,觉得这里的知识点蛮多的.还要继续努力,加油. 拿韩老师的话激励一下自己,共勉.韩老师说,“成功其实也不难,只要树立一个目标,不需要你是一个很强的人,不需要你很高智商,不需要你是 ...

  3. Android - 系统开机你知道多少?

    https://github.com/zhantong/interview/blob/master/Android/Android.md#38-android%E7%B3%BB%E7%BB%9F%E5 ...

  4. Code Signal_练习题_Knapsack Light

    You found two items in a treasure chest! The first item weighs weight1 and is worth value1, and the ...

  5. ubuntu 18.04 设置固定ip

    # This file is generated from information provided by # the datasource.  Changes to it will not pers ...

  6. 【代码笔记】iOS-获得现在的时间(2015-09-11)

    一,代码. - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, ...

  7. 【读书笔记】iOS-网络-理解错误源

    考虑一个字节是如何从设备发往运程服务器以及如何从远程服务器将这个字节接收到设备,这个过程只需要几百毫秒时间,不过确要求网络设备都能正常工作才行.设备网络和网络互联的复杂性导致了分层网络的产生.分层网络 ...

  8. SuperSlide轮播插件滚动高度或宽度不对的问题解决

    声明:本文由w3h5原创,转载请注明出处:<SuperSlide轮播插件滚动高度或宽度不对的问题解决> SuperSlide 是一款比较实用的轮播插件,网站上常用的“焦点图/幻灯片”“Ta ...

  9. Flutter 图片如何充满父布局

    正常我们需要显示一张图片,会用到Image这个控件.打个比方,我们加载一张本地的图片,先看一下这个Image.asset的源码: Image.asset(String name, { Key key, ...

  10. 成为Java顶尖程序员,先过了下面问题!

    一.数据结构与算法基础 说一下几种常见的排序算法和分别的复杂度. 用Java写一个冒泡排序算法 描述一下链式存储结构. 如何遍历一棵二叉树? 倒排一个LinkedList. 用Java写一个递归遍历目 ...