Centos 6 安裝 Raid 1 和raid 10 筆記
RAID10
Note1: All of the following partitions are optional except / and swap.
Note2: If / or /var partition is full, the system will fail.
1. Select custom layout
Sda = hard disk 1
Sdb = hard disk 2
Sdc = hard disk 3
Sdd = hard disk 4
- Create - Raid partition
Create a 600MB partition on all four drives Sda, Sdb, Sdc and Sdd for /boot partitions later on.
- Raid partition
Create a 32000MB partition on all four drives Sda, Sdb, Sdc and Sdd for swap partitions later on.
- Raid partition
Create a 80000MB partition on all four drives Sda, Sdb, Sdc and Sdd for / partitions later on.
- Raid partition
Fill to maximum to the remain spaces on all four drives Sda, Sdb, Sdc and Sdd for /var partitions later on.
- Create - Raid devise
Create /boot mount point on all four 600MB partitions. Select all 600MB partition.
File System Type - Ext4 Select Raid Level - Raid 1
- Create - Raid devise
Create swap mount point on all four 32000MB partitions.
Choose File System Type - swap Select Raid Level - Raid 10
Create / mount point on all four 80000MB partitions.
Create /var mount point on all four maximum partitions.
File System Type - Ext4 Select Raid Level - Raid 10
Boot devise
md0 /boot
md1 swap
md2 /
md3 /var
Install bootloader on load devices /dev/md0
Change Boot devise
Press change devise choose /dev/md0
Well known issue is that the CentOS Software RAID will not load GRUB on /dev/md0. It can be reproduced if we choose /dev/md0 on the previous step and then the CentOS won’t boot. Therefore we need to fix the boot loader:
http://www.centosblog.com/fix-for-cento ... id-devmd0/
1. Using the CentOS install media, boot to the rescue mode
2. select the “start shell” option
3. Enter the following command: chroot /mnt/sysimage
4. Re-install GRUB: grub-install /dev/md0
5. Reboot
(if not working, go to bios and load the default setting and do it again)
Recovery examples
https://www.centos.org/forums/viewtopic.php?t=30281
# yum install mdadm
# cat /proc/mdstat
Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] [multipath] [faulty]
md2 : active raid1 sdb2[1]
1851110336 blocks [2/1] [_U]
md3 : active raid1 sdb3[1]
101374912 blocks [2/1] [_U]
with commands:
# mdadm --manage /dev/md2 --add /dev/sda2
# mdadm: added /dev/sda2
# mdadm --manage /dev/md3 --add /dev/sda3
# mdadm: added /dev/sda3
Check Progree
# cat /proc/mdstat
The Differences Between MBR and GPT: see
http://www.maketecheasier.com/differenc ... r-and-gpt/
For a MBR (Master Boot Record) disk, you can only have four primary partitions, each partition can only go up to a maximum of 2TB in size.
GUID Partition Table (GPT) is part of the UEFI standard. This means that on a UEFI-based system With GPT, you can create theoretically unlimited partitions on the hard disk, even though it is generally restricted to 128 partitions by most OSes. Unlike MBR that limits each partition to only 2TB in size, each partition in GPT can hold up to 2^64 blocks in length (as it is using 64-bit), which is equivalent to 9.44ZB for a 512-byte block (1 ZB is 1 billion terabytes). In Microsoft Windows, that size is limited to 256TB.
Most Linux kernels come with support for GPT. Unless you are compiling your own kernel and you didn’t add this feature in, you should have no problem getting your favorite distro to work in GPT disk. One thing to note, you wil have to use Grub 2 as the bootloader.
For centos 6
RAM on your server Minimum swap space
2 GB or less Two times the amount of RAM on the server.
2 GB to 8 GB The same as the amount of RAM on the server.
8 GB to 64 GB Half the amount of RAM on the server.
64 GB or more 4 GB
RAID1
1. Select custom layout
Sdc = hard disk 1
Sdd = hard disk 2
- Create - Raid partition
Create a 600MB partition on all four drives Sdc1 and Sdd1 for /boot partitions later on.
- Create - Raid partition
Fill to maximum allowable size for swap, /, and var partitions later on.
Create md0 - Raid device /boot ext4 for sda1 & sdb1
Create md1- Raid device physical volume (LVM) for sdc2 & sdd2
create -> LVM Volume Group
add
-> File System Type -> ext4 -> / -> 100000mb
-> File System Type -> ext4 -> /var -> the rest disk space
-> File System Type -> swap -> 36000mb
The rest steps are the same as raid 10.
- 發表回應前,請先登入