LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 02-08-2016, 01:18 PM   #1
Toasterman
Member
 
Registered: Oct 2013
Posts: 77

Rep: Reputation: Disabled
CentOS 6 add RAID1 partition


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:
(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 need to add an additional partition with the unallocated space, not create a whole new table. 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.

Last edited by Toasterman; 02-08-2016 at 01:20 PM.
 
Old 02-08-2016, 01:56 PM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
I'm assuming you want these to be separate from your existing RAID1, sort of mirrored on their own? If so..

You'll want to create a new partition (6) in your case (on both drives).

Code:
# parted /dev/sda
(parted) mkpart logical 3184Gib 4001Gib
(parted) set 6 raid on
(parted) align-check optimal 6
After you created your partition 6 on each drive device, you need to create an MD device and then add them to be mirrored:

Code:
# mdadm --create /dev/mdX --level=1 --raid-devices=2 /dev/sda6 /dev/sdb6
Where X in /dev/mdX is your new unused md device (some start at 0, some start at 126 or 127, just make sure to use one you aren't already using for the existing RAID1 setup). Get the existing ones by doing a:

Code:
# cat /proc/mdstat
Once you get your RAID1 going, you can format the device with whatever filesystem you prefer (ex. mkfs.ext4 /dev/mdX). Once it has a filesystem, you can mount it to start using it. (Also add to /etc/fstab to mount at boot time of course).

I'm also assuming the new partitions are devices sda6 and sdb6, you'll want to do an fdisk -l to make sure.

I'm doing most of this from memory so you might want to double check my commands. Always backup your data before doing these types of changes as well.

But those should be the basic steps in adding your unused disk space in it's own RAID1 mirror.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
resize and add new software raid1 xfs partition m0ntassar Linux - Newbie 0 11-06-2009 07:06 AM
Add 2 more drives to a existing software RAID1 jc_cpu Linux - Server 3 04-08-2009 12:49 AM
add a new disk to raid1 array retrev Linux - General 1 04-08-2007 01:57 AM
Add Software RAID1 to SuSE 8.2 brucehohl Linux - Hardware 0 11-12-2003 06:42 AM
How to add RAID1 without a reboot G../ Linux - Newbie 1 07-20-2002 10:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 01:39 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration