Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

How to add software RAID-1 to an existing system?

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
Renaissance
Posts: 1
Joined: 2020-07-24 19:12

How to add software RAID-1 to an existing system?

#1 Post by Renaissance »

Hello

I have existing Debian system and and I'm trying to put it in a RAID-1 array. The current system runs on a 120 gb SSD storage (sda) device and a 2 TB hard drive (sdc).I added a additional 120 gb SSD (sdb) and a 2 TB hard drive (sdd).
In the first step, I copied the partitions:
sfdisk -d /dev/sda | sfdisk /dev/sdb
sfdisk -d /dev/sdc | sfdisk /dev/sdd

After that I tried to create an mdadm array:
sudo mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sda1 /dev/sdb1

after this command mdadm answers me:
mdadm: cannot open /dev/sdb : Device or resource busy

Where do I make a mistake ?

LE_746F6D617A7A69
Posts: 932
Joined: 2020-05-03 14:16
Has thanked: 7 times
Been thanked: 68 times

Re: How to add software RAID-1 to an existing system?

#2 Post by LE_746F6D617A7A69 »

The devices and/or partitions must not be mounted during creation of the RAID array ;)
Bill Gates: "(...) In my case, I went to the garbage cans at the Computer Science Center and I fished out listings of their operating system."
The_full_story and Nothing_have_changed

User avatar
eriefisher
Posts: 130
Joined: 2008-06-04 03:49
Location: Ontario's South Coast

Re: How to add software RAID-1 to an existing system?

#3 Post by eriefisher »

I find this. It does mention the error:

https://www.linuxbabe.com/linux-server/ ... id-1-setup
____________________________________________
There's a manual?
Siduction
Debian Sid
Xfce4 4.14

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: How to add software RAID-1 to an existing system?

#4 Post by p.H »

Wrong title. You do not want to add sofware RAID but convert the system to RAID 1. Much harder.
Be happy. If the mdadm command had completed without error, it would have overwritten your system.

Method 1:
- backup data
- réinstall system with RAID
- restore data

Method 2:
- backup system and data
- create RAID arrays
- restore system and data

Method 3 (the dangerous one):
- create degraded RAID arrays on the new disks
- copy system and data to the RAID arrays (adjusting fstab an so on as required)
- reinstall/update the boot loader to boot from the RAID array
- reboot on the RAID system
- add the original disks to the RAID arrays

Post Reply