你好,游客 登录 注册 搜索
背景:
阅读新闻

Linux 使用LVM扩充硬盘空间

[日期:2011-08-12] 来源:Linux社区  作者:jlbslqqs [字体:大 中 小]

通过df -h 命令可以查看系统现有的磁盘空间的使用情况。

现有的磁盘空间的使用情况

如果我们有为使用的磁盘空间我们可以通过 fdisk -l 命令查看

 

查看未使用的磁盘空间

 

在这里我们可以查看到有 /dev/xvdc  磁盘没有分配, 大小是43G 的空间。

我们现在启用这个磁盘空间, 首先格式化

输入命令  fdisk /dev/xvdc

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.
The number of cylinders for this disk is set to 2871.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0×0000 of partition table 4 will be corrected by w(rite)

Command (m for help): n   #输入n,新建分区

Command action
   e   extended
   p   primary partition (1-4)
   p  #输入P,主分区


Partition number (1-4): 1   #目前是xvdc第一个分区输入1

First cylinder (1-2871, default 1):  #敲回车,默认就行了
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-2871, default 2871):
Using default value 2871

Command (m for help): t   #这里输入t,指定分区的格式为8e (LVM)
Selected partition 1
Hex code (type L to list codes): 8e
Changed system type of partition 1 to 8e (Linux LVM)

Command (m for help): w  #这里输入w,保存退出
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.

磁盘分区 

linux
相关资讯       Linux知识 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款