您的位置:首页 > 运维架构 > Linux

Linux下添加磁盘阵列空间(vdisk盘),分区,格式化详解

2013-09-10 21:03 351 查看
sfdisk -l

确定/dev/sda是新识别到的存储vdisk盘。

1.创建分区

[root@yyxtdb1 init.d]#fdisk /dev/sda

Command (m for help): n #新建一个磁盘分区,d表示删除分区

Command action

e extended

p primary partition (1-4)

p #创建主分区,另一个是逻辑分区

Partition number (1-4): 1 #分区编号,这里表示sda1

First cylinder (1-130, default 1):回车

Using default value 1

Last cylinder or +size or +sizeM or +sizeK (1-130, default 130): 回车

Using default value 130

Command (m for help): w #保存所做操作

The partition table has been altered!

Calling ioctl() to re-read partition table.

Syncing disks.

2.格式化分区

[root@testdb /]# mkfs -t ext3 /dev/sda1

mke2fs 1.39 (29-May-2006)

Filesystem label=

OS type: Linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

50855936 inodes, 101711523 blocks

5085576 blocks (5.00%) reserved for the super user

First data block=0

Maximum filesystem blocks=4294967296

3104 block groups

32768 blocks per group, 32768 fragments per group

16384 inodes per group

Superblock backups stored on blocks:

32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,

4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968

Writing inode tables: done

Creating journal (32768 blocks): done

Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 39 mounts or

180 days, whichever comes first. Use tune2fs -c or -i to override.

3. 挂载分区

[root@testdb /]# mount /dev/sda1 /oradata

[root@testdb /]# df

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

/dev/cciss/c0d0p3 136710416 5192684 124461184 5% /

/dev/cciss/c0d0p1 101086 12514 83353 14% /boot

tmpfs 4088540 0 4088540 0% /dev/shm

/dev/sda1 400462500 199164 379921032 1% /oradata

[root@testdb /]# df -h

文件系统 容量 已用 可用 已用% 挂载点

/dev/cciss/c0d0p3 131G 5.0G 119G 5% /

/dev/cciss/c0d0p1 99M 13M 82M 14% /boot

tmpfs 3.9G 0 3.9G 0% /dev/shm

/dev/sda1 382G 195M 363G 1% /oradata

4.添加挂载命令到开机自启动中

vi /etc/rc.local

在最后添加mount /dev/sda1 /oradata。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: