-1

Here is the original post There is very ancient post on this forum about adding / creating new RAID5 using EXISTING data on non RAID5 partition. I ASSUME the discussion was pertaining to HARDWARE RAID5. Can I add / create / build RAID5 partitions using SOFTWARE RAID5 using exiting data on one partition? I am familiar with Linux "mdadm".

Edit Dec 7 And here is the repeat of the title and my question. Would it be possible for somebody to actually answer the question?

I have a partition containing data and I DO NOT WANT TO LOOSE SUCH DATA. How do I create RAID using the existing partition ?

Prefer RAID5 , but can do ( verified in mdadm) RAID6.

Here is a actual command I used to get a partial copy of ONE partition of the original RAID5 I am trying to restore.

( I'll make another dd copy into BIGGER partition, no problem )

nov25-1@nov251-desktop:~$ sudo dd if=/dev/sdb4 of=/dev/sdf11 dd: writing to '/dev/sdf11': No space left on device 301840385+0 records in 301840384+0 records out 154542276608 bytes (155 GB, 144 GiB) copied, 19143.6 s, 8.1 MB/s nov25-1@nov251-desktop:~$

What is my NEXT step - using mdadm?

I do not need "how to RAID" references , I am asking for ACTUAL, NEXT step to proceed.

Jan Hus
  • 117
  • 4
  • 4
    Please don't - RAID 5 is dangerously out of date - it has been for the best part of fifteen years - many sysadmins/designers consider it irresponsible of disk controller manufacturers to still offer it, it's that dangerous. We get people coming here all the time asking for help recovering their data from R5 arrays. Please only use R6/60 or R1/10. – Chopper3 Dec 05 '22 at 14:57
  • How does that answer my question ? This has been my most recent access to this and my post title "did not meet quality standards"... Are replies, such as yours, also monitored for "quality standards "? IMHO reply should contribute to solution, yours, IMHO, does not. Cheers. – Jan Hus Dec 05 '22 at 15:15
  • 3
    Did you notice it's not an answer, it's a comment :) Either way don't use R5 – Chopper3 Dec 05 '22 at 15:19

2 Answers2

1

First would like to repead the warning from Chopper3, reconsider creation of RAID5.

And the procedure. From here you can see how to create RAID1 from single disk.

  1. Partition the second disk (w/o data)
  2. Create the RAID device
  3. Make file system
  4. Copy the data on the array
  5. Boot on the new disk (if this is boot disk)
  6. Add original disk to array
  7. Partition original disk
  8. Add disk partition to array
  9. Alter fstab

Then you can use this answer to convert RAID1 to RAID5

Romeo Ninov
  • 5,263
  • 4
  • 20
  • 26
  • I am specifically asking on how to use Linux mdadm to recover failed RAID. I do not need instruction on how to build RAID. – Jan Hus Dec 07 '22 at 13:50
  • 1
    @JanHus, check the headline of this question. Maybe you mistake it with other question you ask: https://serverfault.com/questions/1117315/recovering-raid5-using-linux-mdadm – Romeo Ninov Dec 07 '22 at 14:04
0

RAID-5 is depreciated, please consider another RAID level. (Use Chopper3 advise for the raid level)

To answer your question as it can apply to any other RAID level, you can't easilly.

Most used way to do what you want is to clone the HDD with a third part tool, like a bootable media, create the array and then restore on the RAID array the data.

My solution seem bad, but keep in mind that it can be a good way to test if your media can see your raid hardware, thus testing your backup tool/plan.

yagmoth555
  • 16,758
  • 4
  • 29
  • 50
  • After scanning the article - it looks as mdadm ( Linux "stadard" ) sh;ud be used to buil;d RAID0 . AFTER the RAID0 (partition) is build use Now copy the data from /dev/sda1 to /mnt/new-raid/, for example using rsync. That is what I have been asking.... PLEASE confirm. All of the "other stuff" is pretty much standard mdadm process - been there , done that. – Jan Hus Dec 06 '22 at 01:28
  • QUESTION - why creating intermediate RAID0 and NOT build blank RAID5 and THEN use "rsync" ?? PS I am not sure "mdadm" can build MORE then RAID5. – Jan Hus Dec 06 '22 at 01:32
  • @JanHus, By definition you need 3 disks minimum for RAID5. Do you have 3 free/not in use? – Romeo Ninov Dec 06 '22 at 08:44
  • @JanHus Dont edit to tell it's not an answer, it's one. Comment here, no need to edit. You clone your disk and apply back that clone image to your RAID array, how it's not an answer ? You focus on using mdadm, while you risk to loose all your data if you do an error, my solution is a full backup of your data, and after you create any array you want to apply the data there... – yagmoth555 Dec 07 '22 at 13:50