Linux安全网 - Linux操作系统_Linux 命令_Linux教程_Linux黑客

会员投稿 投稿指南 本期推荐: 强烈推荐:Ylmf OS 3.0 正式版发布附迅雷高 XP系统下硬盘安装Fedora 14图文教程
搜索:
您的位置: Linux安全网 > Linux入门 > » 正文

星外vps-centos系统挂载硬盘

来源: 未知 分享至:

星外默认centos系统的硬盘是10g,当开通硬盘大于10g的时候就需要,开通后手动的挂载

##本文中红色部分命令蓝色部分为解释或是提示##

  1. [root@localhost ~]# fdisk -l  
  2.  
  3. Disk /dev/hda: 21.4 GB, 21474836480 bytes  
  4. 255 heads, 63 sectors/track, 2610 cylinders  
  5. Units = cylinders of 16065 * 512 = 8225280 bytes  
  6.  
  7.    Device Boot      Start         End      Blocks   Id  System  
  8. /dev/hda1   *           1          13      104391   83  Linux  
  9. /dev/hda2              14        1305    10377990   8e  Linux LVM  
  10. [root@localhost ~]# df -h  
  11. 文件系统              容量  已用 可用 已用% 挂载点  
  12. /dev/mapper/VolGroup00-LogVol00  
  13.                       7.7G  1.9G  5.4G  27% /  
  14. /dev/hda1              99M   22M   73M  23% /boot  
  15. tmpfs                 252M     0  252M   0% /dev/shm  

如上所示/dev/dha硬盘总大小是21G,实际VolGroup00-LogVol00只有7.7G的空间

下面的步骤就是把剩余的空闲硬盘都增加到VolGroup00-LogVol00逻辑卷中

1.使用fdisk创建LVM分区

fdisk /dev/hda

  1. [root@localhost ~]# fdisk /dev/hda  
  2.  
  3. The number of cylinders for this disk is set to 2610.  
  4. There is nothing wrong with that, but this is larger than 1024,  
  5. and could in certain setups cause problems with:  
  6. 1) software that runs at boot time (e.g., old versions of LILO)  
  7. 2) booting and partitioning software from other OSs  
  8.    (e.g., DOS FDISK, OS/2 FDISK)  
  9.  
  10. Command (m for help): n  
  11. Command action 
  12.    e   extended  
  13.    p   primary partition (1-4)  
  14. p  
  15. Partition number (1-4): 3  
  16. First cylinder (1306-2610, default 1306):  
  17. Using default value 1306  
  18. Last cylinder or +size or +sizeM or +sizeK (1306-2610, default 2610):  
  19. Using default value 2610  

输入n增加分区
输入p类型设置为:主分区
输入3分区编号设置为3
回车 为默认大小
回车 为默认 大小

然后再设置分区的类型 

  1. Command (m for help): t  
  2. Partition number (1-4): 3  
  3. Hex code (type L to list codes): 8e  
  4. Changed system type of partition 3 to 8e (Linux LVM) 

输入t 设置分区类型
输入3 3号分区
输入8e 设置为LVM

  1. Command (m for help): p  
  2.  
  3. Disk /dev/hda: 21.4 GB, 21474836480 bytes  
  4. 255 heads, 63 sectors/track, 2610 cylinders  
  5. Units = cylinders of 16065 * 512 = 8225280 bytes  
  6.  
  7.    Device Boot      Start         End      Blocks   Id  System  
  8. /dev/hda1   *           1          13      104391   83  Linux  
  9. /dev/hda2              14        1305    10377990   8e  Linux LVM  
  10. /dev/hda3            1306        2610    10482412+  8e  Linux LVM 

输入p 打印分区表 (可以看到刚刚创建的/dev/hda3)
 

  1. Command (m for help): v  
  2. 13452 unalcate.html' target='_blank'>located sectors  
  3.  
  4. Command (m for help): w  
  5. The partition table has been altered!  
  6.  
  7. Calling ioctl() to re-read partition table.  
  8.  
  9. WARNING: Re-reading the partition table failed with error 16: 设备或资源忙.  

Tags:
分享至:
最新图文资讯
1 2 3 4 5 6
验证码:点击我更换图片 理智评论文明上网,拒绝恶意谩骂 用户名:
关于我们 - 联系我们 - 广告服务 - 友情链接 - 网站地图 - 版权声明 - 发展历史