Muhammad Yousuf Khan wrote:
> one of our server's drive failed due to power cord issue.
> however i plug it back and due to less experience with "parted" i messed
> the whole thing.

If it was a power cord issue, and you plugged it back in, then there
should be no need to use parted.  Simply mdadm re-add the drive to the
raid array.  If the drive was running correctly before then the
partitions on the drive would have been correct.  There should be no
need to make any changes to the partition table.

> i have 2tbx2 RAID 1 mirror

Nice box.

> and have 4x500GB partitions.

And understand that each of those partitions are set up as RAID 1 mirror.

> even i selected the right drive by "select command" and deleted the right
> partition but parted did something worst though, i take it as my own
> mistake as i am not that experience with parted i am usually using fdisk.

Why were you trying to delete, add, or modify any partition?  You said
you had a power cord issue.  Did you replace the disk with a different
disk?  If you replaced the disk with a different disk then you will
need to clone the partition table.  If you are using the same disk as
before then do not modify the partition table.

> so the case is. i destroyed 1 partition data. and 3 are still save and
> accessible.

Good.

> though i do had a backup of the first drive that way things are
> still in my hand taking all the 3 partitions backup on another drive fore
> safe side.

Good.

> now the problem part is i can not re attach the fail drive partition with
> RAID /dev/md[2,3,4] devices.
> 
> Personalities : [raid1]
> md1 : active (auto-read-only) raid1 sdc1[0]
>       488147776 blocks super 1.2 [2/1] [U_]
> 
> md4 : active raid1 sdb4[0]
>       488670072 blocks super 1.2 [2/1] [U_]
> 
> md3 : active raid1 sdb3[0]
>       488279928 blocks super 1.2 [2/1] [U_]
> 
> md2 : active raid1 sdb2[0]
>       488279928 blocks super 1.2 [2/1] [U_]

This shows two devices.  It shows /dev/sdb and /dev/sdc.  All four
raid partitions are operating in degraded mode using only one device.
Note that the sizes are not quite identical.

But that is only part of the data.  You need to use mdadm to display
the data that you need.  Please show the output of each of the following
commands:

  mdadm --detail /dev/md1
  mdadm --detail /dev/md2
  mdadm --detail /dev/md3
  mdadm --detail /dev/md4

The critical information is at the bottom of each of the output.  On
my system it shows this for an example:

    Number   Major   Minor   RaidDevice State
       0       8        1        0      active sync   /dev/sda1
       1       8       17        1      active sync   /dev/sdb1

You will need to know that information in order to proceed successfully.

> when i pass this command.
> 
> root@nasbox:~# mdadm --manage /dev/md2 --add /dev/sdc2
> mdadm: add new device failed for /dev/sdc2 as 2: Invalid argument

I don't know.  I have never had this problem.  Searching the web shows
me many other people who have had similar problems but none with any
explanation that I could find.

I would like to see the output of:

  mdadm --examine /dev/sdc2

I am hoping that would show something useful.  I would also like to
see the exact sizes of the partitions.  Please show the output of the
following which will show the exact sizes.  I worry that sdc2 is not
large enough and is smaller than sdb2.

  sfdisk -d /dev/sdb
  sfdisk -d /dev/sdc

It is possible that the partition table on the disk and the operating
system's view of it are out of sync with each other.  You may need to
poke at the OS and have it scan the disk.

  partprobe /dev/sdc

Hope that helps.
Bob

Attachment: signature.asc
Description: Digital signature

Reply via email to