LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-18-2017, 12:31 AM   #1
karthick_pk
LQ Newbie
 
Registered: Apr 2017
Posts: 5

Rep: Reputation: Disabled
Need to increase space on Raid1


Hello Friends ,

I have some queries on increasing sapce in "Raid1" partition on centos 6

I have 2 HDD (sda & sdb) with four partition (swap, /boot, / and /opt), all are configured on Raid1. The four raid1 partition (md0, md1, md2, md3)on each HDD are taken from four "part" of each HDD

[root@mail ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 3.7T 0 disk
├─sda1 8:1 0 32G 0 part
│ └─md0 9:0 0 32G 0 raid1 [SWAP]
├─sda2 8:2 0 512M 0 part
│ └─md1 9:1 0 511.4M 0 raid1 /boot
├─sda3 8:3 0 100G 0 part
│ └─md2 9:2 0 100G 0 raid1 /
├─sda4 8:4 0 3.5T 0 part
│ └─md3 9:3 0 3.5T 0 raid1 /opt
└─sda5 8:5 0 1M 0 part
sdb 8:16 0 3.7T 0 disk
├─sdb1 8:17 0 32G 0 part
│ └─md0 9:0 0 32G 0 raid1 [SWAP]
├─sdb2 8:18 0 512M 0 part
│ └─md1 9:1 0 511.4M 0 raid1 /boot
├─sdb3 8:19 0 100G 0 part
│ └─md2 9:2 0 100G 0 raid1 /
├─sdb4 8:20 0 3.5T 0 part
│ └─md3 9:3 0 3.5T 0 raid1 /opt
└─sdb5 8:21 0 1M 0 part

I need to increase the space only on /opt , So i added one more HDD - sdc.

[root@mail ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 3.7T 0 disk
├─sda1 8:1 0 32G 0 part
│ └─md0 9:0 0 32G 0 raid1 [SWAP]
├─sda2 8:2 0 512M 0 part
│ └─md1 9:1 0 511.4M 0 raid1 /boot
├─sda3 8:3 0 100G 0 part
│ └─md2 9:2 0 100G 0 raid1 /
├─sda4 8:4 0 3.5T 0 part
│ └─md3 9:3 0 3.5T 0 raid1 /opt
└─sda5 8:5 0 1M 0 part
sdb 8:16 0 3.7T 0 disk
├─sdb1 8:17 0 32G 0 part
│ └─md0 9:0 0 32G 0 raid1 [SWAP]
├─sdb2 8:18 0 512M 0 part
│ └─md1 9:1 0 511.4M 0 raid1 /boot
├─sdb3 8:19 0 100G 0 part
│ └─md2 9:2 0 100G 0 raid1 /
├─sdb4 8:20 0 3.5T 0 part
│ └─md3 9:3 0 3.5T 0 raid1 /opt
└─sdb5 8:21 0 1M 0 part
sdc 8:32 0 5.5T 0 disk


Now my question is,

1. Is it possible to increase the space only on /opt ? (in this scenario im asking)
2. If possible, Can i do two equal partition on sdc and may i use it for sda4 & sdb4 to increase the space on md3 (/opt) ?

Hope my explanation is bit clear, please help on my query.

Thank you,
 
Old 04-18-2017, 07:43 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Since sdc would be a single disk it is a single point of failure so you would not get any RAID benefit by partitioning it and adding both partitions to a single RAID1 meta-disk (or to a filesystem no matter how you partition it).

If you're willing to take the risk of having no redundancy for /opt you could just use the entire sdc for a single partition and replace you're existing /opt with that. Alternatively you could make the sdc partition a subdirectory of /opt (e.g. /opt/myappdir) and move whatever needs the most space onto it while leaving everything else in your /opt.

Ideally you'd install yet another disk that you could pair with sdc for the new stuff.

Another way to get redundancy would be to reinstall using RAID5 for the 3 disks (assuming they're all the same size). You'd end up with the full space of 2 of the disks available which is what you'd have with a RAID1 with 2 disks and another disk not in RAID at all so the benefit of RAID5 would be having redundancy.

Last edited by MensaWater; 04-18-2017 at 08:03 AM.
 
Old 04-18-2017, 07:53 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
If you insist on abrogating the protection afforded by RAID1, why not just use RAID0 ?. I'm not sure mdadm will allow conversion this "on the fly".

Note, I am not advocating this, merely offerring it as another option.

Last edited by syg00; 04-18-2017 at 07:55 PM. Reason: Note
 
Old 04-19-2017, 04:54 AM   #4
karthick_pk
LQ Newbie
 
Registered: Apr 2017
Posts: 5

Original Poster
Rep: Reputation: Disabled
@ MensaWater

>> Since sdc would be a single disk it is a single point of failure so you would not get any RAID benefit by partitioning it.
Im ok with this above statement. i ready to go forward

[root@mail ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 3.7T 0 disk
├─sda1 8:1 0 32G 0 part
│ └─md0 9:0 0 32G 0 raid1 [SWAP]
├─sda2 8:2 0 512M 0 part
│ └─md1 9:1 0 511.4M 0 raid1 /boot
├─sda3 8:3 0 100G 0 part
│ └─md2 9:2 0 100G 0 raid1 /
├─sda4 8:4 0 3.5T 0 part
│ └─md3 9:3 0 3.5T 0 raid1 /opt
└─sda5 8:5 0 1M 0 part
sdb 8:16 0 3.7T 0 disk
├─sdb1 8:17 0 32G 0 part
│ └─md0 9:0 0 32G 0 raid1 [SWAP]
├─sdb2 8:18 0 512M 0 part
│ └─md1 9:1 0 511.4M 0 raid1 /boot
├─sdb3 8:19 0 100G 0 part
│ └─md2 9:2 0 100G 0 raid1 /
├─sdb4 8:20 0 3.5T 0 part
│ └─md3 9:3 0 3.5T 0 raid1 /opt
└─sdb5 8:21 0 1M 0 part
sdc 8:32 0 5.5T 0 disk


We cannot change the set up in the above format , because it is a live mail server and in /opt zimbra (a mail server application) is running..

my doubt is , md3 is taken from sda4, sdb4. i need to increase the sapce on sda4, sdb4 to get incease the space in md3. Since sda4, sdb4 are- type "part" is it possible to increse the sapce ?

├─sda4 8:4 0 3.5T 0 part
│ └─md3 9:3 0 3.5T 0 raid1 /opt

├─sdb4 8:20 0 3.5T 0 part
│ └─md3 9:3 0 3.5T 0 raid1 /opt

if possible how can we do please tell me..
 
Old 04-19-2017, 06:06 AM   #5
karthick_pk
LQ Newbie
 
Registered: Apr 2017
Posts: 5

Original Poster
Rep: Reputation: Disabled
@ MensaWater

>>Another way to get redundancy would be to reinstall using RAID5 for the 3 disks (assuming they're all the same size). You'd end up with the full space of 2 of the disks available which is what you'd have with a RAID1 with 2 disks and another disk not in RAID at all so the benefit of RAID5 would be having redundancy.

MensaWater, here we are using the sofware RAID, Can you please tell me how to move my configuration from RAID1 to RAID5, Can i do this with out any data ?
 
Old 04-19-2017, 07:31 AM   #6
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Your problem is that your existing setup is RAID1. If you add another disk (or partition) it simply becomes another copy without giving any increase in space (i.e. it merely increases redundancy).

As 2 of us have noted using the 3rd disk alone (even if you mirror 2 partitions on it) as a separate meta-disk will leave you without any real redundancy. If you say you can't take down time even for planned maintenance then not having redundancy is a bad idea.

My suggestion, if you are willing to forego redundancy is to move the largest item off of md3 to the new disk.

In /opt you can run "du -sk * |sort -rn" to see which is the largest subdirectory.

You can then make a new subdirectory called something else (e.g. mkdir /opt/zimbra.new if /opt/zimbra is your largest) and mount your new disk or partition (e.g. /dev/sdc1) as /opt/zimbra.new.

You'd be able to copy all the files from existing directory to the .new directory. You'd want to do final copy with any application using the existing directory shutdown. You can find what is using it with lsof (e.g. lsof /opt/zimbra).

You can then move the existing to .old (e.g. mv /opt/zimbra /opt/zimbra.old) and recreate the directory to be an empty mount point (e.g. mkdir /opt/zimbra).

You'd then set up your /etc/fstab to mount the device used (e.g. /dev/sdc1) as /opt/zimbra. You'd unmount the /opt/zimbra.new and remount as /opt/zimbra. You'd then remount the filesystem.

Again the above would allow you to have the additional space of the new device for whatever you moved but would NOT be redundant if it is a single drive (even if you use multiple partitions).
 
Old 08-23-2017, 08:13 AM   #7
bastian69
LQ Newbie
 
Registered: Aug 2017
Posts: 3

Rep: Reputation: Disabled
Thank you very much for the information, I clarify a lot. Thank you.
 
  


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
Increase RAID1 Array atulya2009 Linux - Newbie 1 02-03-2011 08:09 AM
New disks (RAID1), not enough space? ScorchPipe Linux - General 1 01-17-2011 01:18 AM
user need to increase space to run a program its showing not enough space svani Red Hat 4 04-16-2010 04:04 AM
Software RAID1 increase storage Fordor Linux - General 1 11-08-2008 09:06 PM
hard disk partitioning/I am out of space /how to increase linux space? RMLinux Red Hat 8 09-05-2008 12:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:14 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