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。