红联Linux门户
Linux帮助

新手学堂:Linux操作系统硬盘扩容的方法

发布时间:2009-03-26 19:46:58来源:红联作者:gary168
硬盘扩容的步骤,注意:机器一定要先关机,然后在插硬盘,否则机器不是宕机就报一群IO错误。


1,启动机器后 按 F8 键进入阵列管理 先 view logical driver 看看自己实际存在的物理硬盘个数及其所占的端口,然后 careate logical driver 很据实际需要选择 radius[0] [0+1] [1],我选择radius[0],按 F8 存盘退出 注意: 如果创建错误 运行 delete logical driver 进行删除,最后重启机器


2,查看现有文件系统


df -k

文件系统 1K-块 已用 可用 已用% 挂载点

/dev/cciss/c0d0p1 98747 14994 78654 17% /boot

/dev/cciss/c0d0p7 21525300 5074728 15357136 25% /home

/dev/cciss/c0d1p1 70009904 553120 65900456 1% /old


根据结果推荐 新增家物理设备在linux系统中的设备名,以上最到编号是 c0d1,由此我们可以推断新设备名称为 c0d2。


3,验证新设备名的准确性


sfdisk -l /dev/cciss/c0d2


Disk /dev/cciss/c0d2: 17433 cylinders, 255 heads, 32 sectors/track


sfdisk: ERROR: sector 0 does not have an msdos signature

/dev/cciss/c0d2: unrecognized partition


4,对新设备进行分区


fdisk /dev/cciss/c0d2


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

Command action

e extended

p primary partition (1-4)


p

Partition number (1-4): 1

First cylinder (1-17433, default 1):

Using default value 1

Last cylinder or +size or +sizeM or +sizeK (1-17433, default 17433):

Using default value 17433


Command (m for help): w

The partition table has been altered!


5,给新分区的存储设备创建linux文件系统: mkfs -t ext3 /dev/cciss/c0d2p1


6, 把文件系统过载到新的目录: mount /dev/cciss/c0d2p1 /目录


ok,到现在你的硬盘已经添加到系统,你可以使用的新硬盘了,空间好大,呵呵。


注意:


a、文件挂错了,可以用 umount /dev/cciss/c0d2p1 /目录 进行卸载


b、万一阵列管理程序找不见硬盘及其现有硬盘也不见了,那你新插入的盘一定是坏盘 哈哈 以上情况我全遇到了。
文章评论

共有 2 条评论

  1. gary168 于 2009-04-02 19:24:17发表:

    呵呵,真不愧是行家。

  2. jagub 于 2009-03-27 21:45:20发表:

    这个不是搞阵列的方法吗?