LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-16-2019, 09:16 AM   #1
helen314
Member
 
Registered: Jun 2019
Posts: 78

Rep: Reputation: 0
Using DD with status=progress copying RAID5


As usual, I am not sure in which sub-forum to post this.

These are more less just notes and or curiosity questions.

I am currently using "dd" to copy RAID5 "partitions".
I opted to do all four of them overnight.
I realize coping from one USB to another is not the fastest , but I started with around 2-3 Mbits / second and now I am "down" to less then 850 kilobits / second.
The speed is irrelevant, as long as my OS does not crash...

I also noted that "DD" copies the entire "partition", not just actual data.
Perhaps mdadm is also "updating" the new RAID and that is what is slowing thing down.


Quote:
sudo dd if=/dev/md0p3 of=/dev/md1p3 status-progress
 
Old 06-16-2019, 09:52 AM   #2
dc.901
Senior Member
 
Registered: Aug 2018
Location: Atlanta, GA - USA
Distribution: CentOS/RHEL, openSuSE/SLES, Ubuntu
Posts: 1,005

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
I am curious, why not use rsync?
Yes, you will need to create partition and run mkfs...
But, with rsync you can run it again tomorrow, and it will sync only the changes, where as dd will start all over.

Perhaps, I do not understand your requirements, and may be dd is the tool to use in this case?
 
Old 06-16-2019, 10:46 AM   #3
helen314
Member
 
Registered: Jun 2019
Posts: 78

Original Poster
Rep: Reputation: 0
Yes, you will need to create partition and run mkfs...

That is why, unless there is a way to copy / build the entire RAID5 array.

How can rsynch operate between two arrays?
I am assuming AFTER one is copied to the other they are independent.
(I'll will RTFM after I post this.)

I am also assuming that the array will synch "automatically" - doing it manually would not make much sense.

But it can be optioned to do additional automatic synch at programmed time.
 
Old 06-17-2019, 07:15 AM   #4
dc.901
Senior Member
 
Registered: Aug 2018
Location: Atlanta, GA - USA
Distribution: CentOS/RHEL, openSuSE/SLES, Ubuntu
Posts: 1,005

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
If your RAID configuration / hardware is not changing, then using dd is overkill.

Usually, creating RAID then partitions then filesystem is (mostly) one time deal. Once that is done, it is ready for data...
Then, you can use rsync to copy data from one array to other.
You can create a script and put it in cron if you want to automate.

rsync is one tool, there are many other ways to do this. I have used tar, and xfsdump/xfsrestore (for XFS filesystem), and there is dump/restore (for ext3/4 filesystems). Note: xfsdump/xfsrestore and dump/restore will copy everything every-time, where as rsync and tar can be used to do copy only what's changed.

So, all depends on what you want to do.
 
Old 06-17-2019, 10:38 AM   #5
helen314
Member
 
Registered: Jun 2019
Posts: 78

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by dc.901 View Post
If your RAID configuration / hardware is not changing, then using dd is overkill.

Usually, creating RAID then partitions then filesystem is (mostly) one time deal. Once that is done, it is ready for data...
Then, you can use rsync to copy data from one array to other.
You can create a script and put it in cron if you want to automate.

rsync is one tool, there are many other ways to do this. I have used tar, and xfsdump/xfsrestore (for XFS filesystem), and there is dump/restore (for ext3/4 filesystems). Note: xfsdump/xfsrestore and dump/restore will copy everything every-time, where as rsync and tar can be used to do copy only what's changed.

So, all depends on what you want to do.



Yes, what I wanted to do is to duplicate existing working RAID5 into new devices.
Technically md0 to md1. I want to have two independent RAID5 arrays and eventually will delete the md0.


Perhaps it is the "(r) synch " in the name what is misleading (to me ) - perhaps I am too picky , but I see a difference in "coping" and "synchronizing".

Anyway - so far using "dd" worked and I am going to start using the md1 array from now on.


I find it interesting when one posts a question , receives reply to use such and such and then get another reply suggesting to use xyz instead.

Remind me of the proverbial "there is more than one way to skin a cat ".
Different methods are great, usually it is good learning , but somehow it misses the objective to "fix things".

Somewhat off topic - but maybe it is OK to ask this here.

RAID5 is OK whit 2 devices , better with 3.
When I "add" another device , it shows up as "spare".
Is this "spare" "synchronized" with the other hardware?
How do I verify that ?

Crude, and not preferred, way would be to delete the "active" device and run mdadm in monitor option.

Just asking.
 
Old 06-17-2019, 05:23 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,125

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Perhaps you should spend some time perusing the Linux_Raid site.
 
Old 06-17-2019, 06:37 PM   #7
helen314
Member
 
Registered: Jun 2019
Posts: 78

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by syg00 View Post
Perhaps you should spend some time perusing the Linux_Raid site.
Excellent and much appreciated and unusual advise - RTFM.

How does that answer my "spare" question?
It does not.

Thanks
 
Old 06-17-2019, 07:06 PM   #8
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,699

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Quote:
RAID5 is OK whit 2 devices , better with 3.
When I "add" another device , it shows up as "spare".
Is this "spare" "synchronized" with the other hardware?
How do I verify that ?
No, RAID 5 uses a minimum of 3 disks. If your only using two then it is running in degraded mode and you will lose all data if a disk fails. The added drive is a hot spare and not part of the array until one of them fails.

cat /proc/mdstat will output the current status of your RAID.
 
Old 06-17-2019, 09:18 PM   #9
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,125

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Quote:
Originally Posted by helen314 View Post
How does that answer my "spare" question?
If you had bothered to make the effort to look, you would have found a page that covers that specifically.

And you might have learnt a thing or two in addition to that as well.
 
Old 06-18-2019, 12:25 AM   #10
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by helen314 View Post
Excellent and much appreciated and unusual advise - RTFM.

How does that answer my "spare" question?
It does not.

Thanks
Only people who do in fact NOT Read The Fantastic Manual react like this when - correctly - asked to do so.
 
1 members found this post helpful.
Old 06-18-2019, 08:56 AM   #11
helen314
Member
 
Registered: Jun 2019
Posts: 78

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by michaelk View Post
No, RAID 5 uses a minimum of 3 disks. If your only using two then it is running in degraded mode and you will lose all data if a disk fails. The added drive is a hot spare and not part of the array until one of them fails.

cat /proc/mdstat will output the current status of your RAID.
OK, I was wrong with saying RAID5 is OK with two disks.
It is my understanding that when I test remove one of the active devices I'll see some activities when monitoring mdadm.

I just build yet another md2 and been looking at current activities using cat /proc/mdstat.

Noticed two odd things - it is "recovering" empty " , no data added so far , devices.
Secondly - it makes "gparted" crazy, it keeps scanning devices whose "recovering non existent data " contents is changing.

I think I'll wait until the "recovery" is done before I attempt to "ddrescue" from existing md0 to new one md2.
Just curious if it will work.
 
Old 06-18-2019, 10:37 AM   #12
RickDeckard
Member
 
Registered: Jan 2014
Location: Canton, Georgia, USA
Distribution: Debian 12
Posts: 205

Rep: Reputation: Disabled
OP, you may have been thinking of *data* disks. I know one disk in R5 is dedicated to parity.
 
Old 06-18-2019, 11:01 AM   #13
helen314
Member
 
Registered: Jun 2019
Posts: 78

Original Poster
Rep: Reputation: 0
One more silly note about RAID.
Why does OS (Ubuntu ) keep changing mdx numbers?
I currently have three arrays , at various stages of usability , and only md0 stays and always reads as md0.

Here is what mdstat say

Quote:
a@a-desktop:~$ cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4] [linear] [multipath] [raid0] [raid1] [raid10]
md126 : active raid5 sde9[3] sde8[1] sde7[0]
204668928 blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/3] [UUU]

md127 : active raid5 sde11[3] sde5[1] sde4[0]
39999488 blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/3] [UUU]
[====>................] resync = 23.8% (4772468/19999744) finish=6.8min speed=37167K/sec

md0 : active raid5 sdf19[4](S) sde6[6](S) sdb6[3] sdb4[1] sda3[0]
204668928 blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/3] [UUU]

unused devices: <none>
a@a-desktop:~$

This is what mdadm --examine --scan -v gives about SAME devices


Quote:
a@a-desktop:~$ sudo mdadm --examine --scan -v
ARRAY /dev/md/1 level=raid5 metadata=1.2 num-devices=3 UUID=2fcd6c3c:7536faa9:8eb26bcd:31243bf7 name=z-desktop:1
devices=/dev/sde9,/dev/sde8,/dev/sde7
ARRAY /dev/md/2 level=raid5 metadata=1.2 num-devices=3 UUID=a7736001:e4f5321e:691bd2ef:fad4e8ba name=a-desktop:2
devices=/dev/sde11,/dev/sde5,/dev/sde4
ARRAY /dev/md/0 level=raid5 metadata=1.2 num-devices=3 UUID=5afe531e:3c41ecd9:7057ae6e:98985049 name=jim-desktop:0
spares=2 devices=/dev/sdf19,/dev/sdf18,/dev/sde6,/dev/sdb6,/dev/sdb4,/dev/sda3
a@a-desktop:~$
 
  


Reply

Tags
raid5



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
progress - to monitor progress of commands robertkwild CentOS 20 10-04-2017 06:35 PM
LXer: How to monitor progress of Linux commands using PV and Progress utilities LXer Syndicated Linux News 0 11-11-2016 07:01 PM
[SOLVED] btrfs RAID5 vs MD RAID5 + LVM eRJe Linux - General 4 01-20-2014 05:54 PM
Recreate a Raid5 MD0 into a Raid5 MD3 CADIT Linux - Server 2 01-11-2010 04:46 AM
Multi Layer RAID50 fail (Intel SRCS14L RAID5 + 3ware 9550SX-4LP RAID5)+Linux RAID 0 BaronVonChickenPants Linux - Server 4 09-27-2009 04:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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