2

I need a large and relatively robust backup method. I had an old desktop running debian and put in two identical 2tb drives in raid-1 configuration using mdadm

So I would start the array using

sudo mdadm --assemble /dev/md0  /dev/sdb /dev/sdc

That was working well. Then I decided that I needed to make sure I understood how I would deal with it if a drive failed. So I unplugged the sata cable from the drive in /dev/sdb and I started the array with

sudo mdadm -assemble /dev/md0 /dev/sdc --run

I confirmed that it seemed to work as expected. I did not alter any files on the drive. Then I replugged the sata cable.

Now when I try to start the array with both drives:

sudo mdadm --assemble /dev/md0  /dev/sdb /dev/sdc

I get the following.

mdadm: /dev/md0 has been started with 1 drive (out of 2).

When I try

sudo mdadm /dev/md0 --re-add /dev/sdb

I get mdadm: --re-add for /dev/sdb to /dev/md0 is not possible

How can I most simply bring the array back online with both disks? I would prefer not to rebuild the entire disk if possible and I would prefer not to loose the data on /dev/dsb.

Any help would be greatly appreciated!

4
  • How did you confirm that it worked as expected? If you mounted one or more volumes on /dev/md0 in read-write mode, you did alter the contents on disk, because the superblock is updated. In that case you must do a full rebuild.
    – JvO
    Commented Aug 18, 2015 at 12:30
  • PS: I seriously suggest making a single large partition on the disks and label them as type 'fd' (Linux raid autodetect). I have used full disk RAID arrays in the past and it gave me huge headaches when I needed to upgrade the disks.
    – JvO
    Commented Aug 18, 2015 at 12:33
  • Thank you for the suggestion. So you are saying that I make 1 partition on each disk and then put sdb1 and sdc1 into the array? Can you please explain the difference? Commented Aug 19, 2015 at 0:31
  • Yes, just like that: 1 big partition per disk with apropriate partition type. The advantage is that the kernel will then automatically assemble the RAID array at startup.
    – JvO
    Commented Aug 19, 2015 at 8:06

1 Answer 1

1
  1. "I need a large and relatively robust backup method."

RAID is not a backup method.

  1. "How can I most simply bring the array back online with both disks? I would prefer not to rebuild the entire disk if possible and I would prefer not to loose the data on /dev/dsb."

You will have to rebuild the array.

By using the array with one disk disconnected, they have become desynchronized. With appropriate metadata, the resynchronisation can be reasonably fast. But in any case, in order to resynchronize the desynchronized disks, a rebuild must be done.

5
  • Please forgive my ignorance here. Can you please explain "With appropriate metadata, the resynchronisation can be reasonably fast"? Commented Aug 18, 2015 at 23:53
  • I followed the advice here and after starting the array with the sdc drive as above, I did mdadm /dev/md0 -a /dev/sdb and it seems to be working. (cat /proc/mdstat says ~300min to go.) Commented Aug 19, 2015 at 0:01
  • I understand RAID is not a backup method in and of itself. I should have said that I created this array as the disk to which I am backing up data with the idea that RAID-1 will decrease the odds that drive failure will result in loss of the backup. Please let me know if I am missing something! Commented Aug 19, 2015 at 0:19
  • 1
    @pablohonee: raid.wiki.kernel.org/index.php/Write-intent_bitmap "When an array has a write-intent bitmap, a spindle (a device, often a hard drive) can be removed and re-added, then only blocks changes since the removal (as recorded in the bitmap) will be resynced."
    – qasdfdsaq
    Commented Aug 19, 2015 at 14:07
  • @pablohonee: OK, I understand about the backup. Sorry. A lot of people think RAID is a substitute for a real backup, which it is not. Since you are using it as a place to store backups, that doesn't apply to you.
    – qasdfdsaq
    Commented Aug 19, 2015 at 14:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .