On Sat, Mar 18, 2017 at 5:14 AM, Neil Bothwick <n...@digimed.co.uk> wrote:
> On Sat, 18 Mar 2017 13:29:36 +1100, Adam Carter wrote:
>
>> IIRC when you add a device to a mirror say with;
>> mdadm --create --verbose /dev/md127 --level=mirror --raid-devices=1
>> --force /dev/sdb3
>>
>> I thought the filesystem is maintained and so /dev/md127 should be
>> immediately mountable, however, it doesnt mount.
>> mount: wrong fs type, bad option, bad superblock on /dev/md127,
>>        missing codepage or helper program, or other error
>
> You have created a block device at /dev/md127 but you haven't created a
> filesystem on it, there's nothing to mount.
>
> Unless you are trying to add a device to an existing array, in which case
> you shouldn't be using --create.
>

Yeah, if you are sticking "--force" on a command line you had better
know exactly what you're doing.  I suspect that mdadm was refusing to
wipe out the existing array and destroy all the data on it until this
was added.

mdadm is quite versatile.  You can add/remove individual disks from
any type of raid online without losing data (well, removing disks may
require resizing filesystems first as the device could get truncated
depending on what you're doing).

However, --create is not used to modify existing arrays, unless by
modify you mean delete-the-old-and-create-something-new.

Since you only specified one device, you might actually be able to
recover.  I'm not sure what your existing device was, but if it wasn't
/dev/sdb3 then what you might have done is create a second array with
the same device name.  Now, /dev/md127 at that moment will point to
the new empty array, but the old array may still be untouched on disk,
so you might be able to activate it and still have all the data.  Then
you could delete the new array (be VERY careful here that you're
deleting the right one), and then correctly add /dev/sdb3 to the old
array.

Can you spell out your configuration?  What devices constituted your
original array and what was it called?  What device did you intend to
add to it?  What happens when you run mdadm --query <device> and mdadm
--examine <device> on both your old and new devices?

I'll confess that it has been a few years since I've used mdadm but if
the actual disks are still intact then you should be able to
re-assemble everything correctly.

-- 
Rich

Reply via email to