登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

我的博客

每一天,为明天。今天的努力只为明天的不后悔。

 
 
 

日志

 
 

LINUX 添加磁盘空间  

2010-07-31 00:17:45|  分类: LINUX_系统 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

给系统添加磁盘空间在工作会经常遇到。我在添加第二块磁盘一般系统默认为hdb(IDE硬盘)sdb(SCSI 硬盘)我们以hdb为例。

linux-isep:~ # fdisk /dev/hdb

The number of cylinders for this disk is set to 8322.
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)

Command (m for help): m               //先帮助一下。避免误操作。
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)
选择n

Command action
   l   logical (5 or over)
   p   primary partition (1-4)
如果想建立逻辑分区就选l,主分区就选p.

接下来是输入大小,这个大小是整个扩展分区的大小,强烈建议默认。然后建立逻辑分区的时候才会让你选择建立的数量,以及每个分区的大小。

最后w保存退出。

格式化刚刚建立的分区,先查看一下。

linux-isep:~ # fdisk -l

Disk /dev/hdb: 4294 MB, 4294967296 bytes
16 heads, 63 sectors/track, 8322 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdb1               1        8322     4194256+   5  Extended
/dev/hdb5               1        8322     4194225   83  Linux

在这里要特别注意一下。/dev/hdb1是扩展分区,并不是逻辑分区.(一般情况下,1-4为主分区.5以后是逻辑分区.逻辑分区都包括在扩展分区里面,这个和WIN的道理是一样的)我们要格式化的是逻辑分区.使用命令

 mkfs -t ext3 /dev/hdb5

如果使用hdb1的话,会有如下错误提示

linux-isep:~ # mkfs -t ext3 /dev/hdb1
mke2fs 1.39 (29-May-2006)
/dev/hdb1: Invalid argument passed to ext2 library while setting up superblock


  评论这张
 
阅读(5074)| 评论(0)

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018