LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-23-2020, 01:51 AM   #1
jnoake
LQ Newbie
 
Registered: Jan 2009
Posts: 24

Rep: Reputation: 11
Growing Raid 1 (but reducing disks)


Hi,
I have:

Raid 0 MD2 |--------------5Tb---------------|
on
Raid 1 MD0 |----2Tb---|
Raid 1 MD1 |-------3Tb--------|


MD0 = sde, sdf (2Tb each)

MD1 = sdc, sdd (3Tb each)


I want to migrate the Raid 0 MD2 volume data onto a 10Tb raid 1.


sda, sdb (10Tb each)


Can I achieve this using the raid rebuild tools so that I end up with:

Raid 1 MD0 |--------------------------10Tb----------------------|

MD0 = sda, sdb (10Tb Each)


MD1 = (gone)

MD2 = (gone)



, or would it be necessary to create a new raid1 and then rsync the Raid 0 MD2 volume to it.


Raid 1 MD3 |--------------------------10Tb----------------------|
rsync ^

Raid 0 MD2 |--------------5Tb---------------|


Does that make sense?
 
Old 12-23-2020, 02:32 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,103

Rep: Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117
I was about to say this should be reasonably straight-forward - if time consuming. However the RAID wiki page titled "A_guide_to_mdadm" states thus:
Quote:
Raid-0 can be converted to raid-10, or to raid-4/5/6.
You might need to investigate further before proceeding.
 
Old 12-23-2020, 02:48 AM   #3
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
This is a weird setup, and I don't quite understand. RAID 0 is striping, which means that half of md2's data resides on md0 and md1, respectively. You can convert md0 to a four-disk array, then remove the two smaller disks (see below), but this will only give you half of the striped data. Am I missing something?

EDIT: I do wonder how much time you'd save by growing a mirrored array vs. just rsync'ing the filesystem. Not so much, perhaps?

According to the kernel.org RAID wiki:
Quote:
Raid 1 stores identical copies across all drives. As such, this has the simplest procedure for adding and removing drives. When a new drive is added, the data is copied across from one of the existing drives. When removing a drive, the drive can simply be deleted from the array.
EDIT2: svg00's quotation comes from the same Wiki page.

Last edited by berndbausch; 12-23-2020 at 02:51 AM.
 
Old 12-23-2020, 04:42 AM   #4
jnoake
LQ Newbie
 
Registered: Jan 2009
Posts: 24

Original Poster
Rep: Reputation: 11
Quote:
Originally Posted by berndbausch View Post
This is a weird setup, and I don't quite understand...

I started with the 2Tb and got the additional 3Tb disks later. I wanted a single mountpoint for the whole 5Tb and the raid 0 did the job.


I was hoping for a response that would have given me a straightforward way, time is not really the issue.
If it could have been a case of banging the 10Tb in , adding it to the existing raid somehow and just letting it get on with it, followed by the 2nd 10 for the mirror and removing the previous four, that would have been cool with little or no downtime.


Given the answers so far it seems that I would be better creating a new raid1 and rsync'ing, that is just a pain since it has to be rsync'ed with the OS services paused to prevent losing changes - that could take half a day downtime and then putting it in place of the existing raid0, fstab edits etc.
Can't just add the 10's and extend as I am out of sata ports.

Last edited by jnoake; 12-23-2020 at 04:49 AM.
 
Old 12-23-2020, 05:21 AM   #5
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
I misunderstood this, and of course I did not know your SATA port limitation.

First, you can remove one drive from each mirror, e.g. sdc and sde, thereby making room for attaching the new drives. The mirrors should continue to function with a single disk each.

After that, personally I would create a new RAID md3 from the two new disks and rsync the data from md2 to md3.

Or build another RAID1 (let's call it md4) on top of md2 and md3, then let the md driver perform the synchronization, then remove md2. Not sure if the now degraded md4 can be undone after that. That's why the rsync method seems safer.

Another thought: Build md3 on a different system and rsync the data over the network.
 
1 members found this post helpful.
Old 12-23-2020, 06:59 AM   #6
jnoake
LQ Newbie
 
Registered: Jan 2009
Posts: 24

Original Poster
Rep: Reputation: 11
Quote:
Originally Posted by berndbausch View Post
I misunderstood this, and of course I did not know your SATA port limitation.

First, you can remove one drive from each mirror, e.g. sdc and sde, thereby making room for attaching the new drives. The mirrors should continue to function with a single disk each.

After that, personally I would create a new RAID md3 from the two new disks and rsync the data from md2 to md3.

Or build another RAID1 (let's call it md4) on top of md2 and md3, then let the md driver perform the synchronization, then remove md2. Not sure if the now degraded md4 can be undone after that. That's why the rsync method seems safer.

Another thought: Build md3 on a different system and rsync the data over the network.

Thank you, this is the advice I needed.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
LXer: Linux Keeps Growing and Growing and Growing LXer Syndicated Linux News 1 06-05-2020 04:38 AM
LXer: Growing Pains, a platformer where you're constantly growing is now on Linux LXer Syndicated Linux News 0 09-10-2019 11:33 PM
RAID seek_error_rate on both disks suddenly growing very fast by smartctl Manager Linux - Server 2 02-27-2017 12:16 PM
MySQL ibdata1 growing and growing and growing and... jnojr Linux - Software 1 07-20-2009 07:11 PM
X utilaziion is growing and growing amirb Linux - Desktop 2 05-28-2007 03:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:11 AM.

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