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

If none of the more specific forums is the right place to ask

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

Postby Renaissance » 2020-07-24 20:12

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 ?
Renaissance
 
Posts: 1
Joined: 2020-07-24 19:12

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

Postby LE_746F6D617A7A69 » 2020-07-24 21:00

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
LE_746F6D617A7A69
 
Posts: 390
Joined: 2020-05-03 14:16

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

Postby eriefisher » 2020-07-24 21:06

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
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?

Postby p.H » 2020-07-25 09:33

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
p.H
 
Posts: 1480
Joined: 2017-09-17 07:12


Return to General Questions

Who is online

Users browsing this forum: No registered users and 15 guests

fashionable