一、分区
这里我使用的是鸟哥linux私房菜上的案例。
- 4个分区组成RAID5;
- 每个分区约1GB大小,需确定每个分区一样大较佳;
- 1个分区设为spare disk(备份分区),大小也为1GB
- chunk(区块)设定为256K;
- 此RAID5挂载在/srv/raid目录下
[root@study ~]# gdisk /dev/sda #对sda磁盘划分区
Command (? for help): n
Partition number (4-128, default 4): #默认值
First sector (34-83886046, default = 65026048) or {+-}size{KMGTP}: +1gb #大小1gb
Last sector (67123200-83886046, default = 83886046) or {+-}size{KMGTP}: +1gb
Current type is 'Linux filesystem'
Hex code or GUID (L to show codes, Enter = 8300): fd00 #fd00代表Linux RAID
Changed type of partition to 'Linux RAID'
#重复5次
#按w写并退出
Command (? for help): w
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!
Do you want to proceed? (Y/N): y
OK; writing new GUID partition table (GPT) to /dev/sda.
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot.
The operation has completed successfully.
[root@study ~]# gdisk -l /dev/sda
#看到分区4,5,6,7,8表示成功分区
Number Start (sector) End (sector) Size Code Name
1 2048 6143 2.0 MiB EF02
2 6144 2103295 1024.0 MiB 0700
3 2103296 65026047 30.0 GiB 8E00
4 67123200 69220351 1024.0 MiB FD00 Linux RAID
5 71317504 73414655 1024.0 MiB FD00 Linux RAID
6