linux添加硬盘分区格式化,Linux下添加硬盘、分区并格式化

IBM服务器,Linux系统,三块硬盘做Raid5,今天终于成功加上了块硬盘!

1、用Raid驱动盘(是不是这么叫?呵呵)引导,将新加的盘做Raid0(因为只加了一块盘)

2、通过fdisk分区

3、通过mkfs.ext3格式化新的分区,完成

第一步很简单

第二步,分区

1、通过fdisk -l查看未分区硬盘

Disk /dev/sda: 72.8 GB, 72802631680 bytes

254 heads, 63 sectors/track, 8885 cylinders

Units = cylinders of 16002 * 512 = 8193024 bytes

Device Boot     Start        End     Blocks    Id   System

/dev/sda1    *          1         13     103981+   83   Linux

/dev/sda2             14       8656   69152643    83   Linux

/dev/sda3           8657       8885    1832229    82   Linux swap

Disk /dev/sdb: 36.4 GB, 36401315840 bytes

254 heads, 63 sectors/track, 4442 cylinders

Units = cylinders of 16002 * 512 = 8193024 bytes

Device Boot     Start        End     Blocks    Id   System

这儿可以看到,/dev/sdb尚未分区

2、通过fdisk /dev/sdb对/dev/sdb进行分区

[root@ckkhserver root]# fdisk /dev/sdb

The number of cylinders for this disk is set to 4442.

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    add a new partition,创建一分区

Command action

e    extended

p    primary partition (1-4)

我不知道这是什么意思,但尝试后知道,应该选p    primary partition (1-4)

然后根据情况键入数字,比如1

再根据提示选择分区的类型,L查看知道有这么一个类型,83   Linux

那就选这个类型,输入83,然后保存退出,分区就完成了

第三步,格式化

这儿,格式化成ext3格式,命令为mkfs.ext3 /dev/hdb1

为了让硬盘在系统启动时自动挂载,用vi编辑/etc/fstab文件,加入如下内容(比如挂载到/mnt/hd目录)

/dev/dhb1 /mnt/hd reiserfs defaults 1 1

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值