操作环境:

CentOS Linux 6.5

硬盘:

/dev/sda 大小500G,为4*15K HDD做的硬Raid10,用来部署系统分区以及Oracle应用分区。

/dev/sdb 大小4.1T 为6*10K HDD做的硬Raid5,用来做Oracle的数据文件分区

/dev/sdc 大小4.1T 为6*10K HDD做的硬Raid5,用来做Oracle的数据索引

平时在Linux下使用的硬盘都没超过2T的单盘,所以刚开始用fdisk分区出来发现只有2T,还有点疑惑,一查才知道原来是因为fdisk不支持创建GPT分区,GPT支持大于2TB分区,MBR只能支持2TB的分区。下面是两种分区格式的具体区别:

MBR分区表:(MBR含义:主引导记录)
所支持的最大卷:2T (T; terabytes,1TB=1024GB)
对分区的设限:最多4个主分区或3个主分区加一个扩展分区。
GPT分区表:(GPT含义:GUID分区表)
支持最大卷:18EB,(E:exabytes,1EB=1024TB)
每个磁盘最多支持128个分区

Linux下的parted工具的使用也很简单,具体操作如下:

root@me:/mnt# parted /dev/sda
Using /dev/sda
Welcome to GNU Parted! Type ‘help’ to view a list of commands.

(parted) mklabel gpt
Warning: The existing disk label on /dev/sda will be destroyed and all data on this disk
will be lost. Do you want to continue?
Yes/No? yes

(parted) print
Model: DELL PERC 6/i Adapter (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number  Start  End  Size  File system  Name  Flags

(parted)mkpart primary 0GB 500GB
Warning: You requested a partition from 0.00B to 500GB.
The closest location we can manage is 17.4kB to 500GB.
Is this still acceptable to you?
Yes/No? yes
Warning: The resulting partition is not properly aligned for best performance.
Ignore/Cancel? Ignore

(parted) print
Model: DELL PERC 6/i Adapter (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number  Start   End    Size   File system  Name     Flags
1      17.4kB  500GB  500GB               primary

(parted)quit
Information: You may need to update /etc/fstab.
root@me:/#mkfs.ext4 /dev/sda1
mke2fs 1.41.12 (17-May-2010)
文件系统标签=
操作系统:Linux
块大小=4096 (log=2)
分块大小=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
30490624 inodes, 121962487 blocks
6098124 blocks (5.00%) reserved for the super user
第一个数据块=0
Maximum filesystem blocks=4294967296
3722 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000
正在写入inode表: 完成
Creating journal (32768 blocks): 完成
Writing superblocks and filesystem accounting information: 完成
This filesystem will be automatically checked every 24 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

这样我们就完成了分区的创建以及格式化,其他分区步骤类似,全部完成并装好系统我们可以编辑/etc/fstab 文件以实现开机自动挂载分区。

原创文章,请阅读页脚的许可方式,转载请注明: 转载自王恒的博客 [ https://wangheng.org ]

本文链接地址: https://wangheng.org/?p=94948

给我留言

*

*