CentOS 6 add RAID1 partition

General support questions
Post Reply
bristr
Posts: 32
Joined: 2014/05/22 19:07:03

CentOS 6 add RAID1 partition

Post by bristr » 2016/02/08 16:25:11

Hello,
When I installed CentOS 6 originally I had it set up with two 4TB drives in RAID1. I have the volumes set up as follows:

Code: Select all

(parted) print free
Model: ATA ST4000DM000-1F21 (scsi)
Disk /dev/sda: 4001GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number  Start   End     Size    File system  Name  Flags
        17.4kB  1049kB  1031kB  Free Space
 1      1049kB  4195MB  4194MB                     raid
 2      4195MB  5244MB  1049MB  ext4               raid
 3      5244MB  13.6GB  8320MB                     raid
 4      13.6GB  2178GB  2164GB                     raid
 5      2178GB  3184GB  1006GB                     raid
        3184GB  4001GB  817GB   Free Space
I am wanting to create another volume with the 817GB of free space at the end. However, I have not been able to find a straight-forward guide that shows what I need to do. I do not want this to affect the existing partitions in any way. If this was a regular non-RAID partition it would be much easier.
Does anyone know of a guide that can show what I am trying to do here? Thank you.

gulikoza
Posts: 188
Joined: 2007/05/06 20:15:23

Re: CentOS 6 add RAID1 partition

Post by gulikoza » 2016/02/09 09:01:01

Create 2 new partitions in the free space on each of the disks.
After reboot, 2 new devices will be visible (/dev/sda6 and /dev/sdb6, I presume), use that to create new raid device:

mdadm -Cv /dev/mdXX -l1 -n2 /dev/sda6 /dev/sdb6 (replace XX with next free md number).

This shouldn't affect existing partitions, but make sure you have a backup anyway just in case :D

bristr
Posts: 32
Joined: 2014/05/22 19:07:03

Re: CentOS 6 add RAID1 partition

Post by bristr » 2016/02/15 18:36:16

That appeared to work but when I tried to create a file system, it said it was misaligned by 512 bytes. Do you know what that means or how to resolve that?
Thank you.

gulikoza
Posts: 188
Joined: 2007/05/06 20:15:23

Re: CentOS 6 add RAID1 partition

Post by gulikoza » 2016/02/24 14:11:03

What's the exact error?

Post Reply