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

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。

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值