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

 

 

 

[SOLVED]Debian raid1 reconstruction

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
Norbii
Posts: 6
Joined: 2017-09-23 17:55

[SOLVED]Debian raid1 reconstruction

#1 Post by Norbii »

Hello guys!

First of all i want to say sorry for my english.

We started to learn linux. We needed to install debian netinst in virtual box and for raid 1 i set 2 hard disc. After the installation to have some practice i needed to remove one harddisc. For that raid 1 dont work well and i need to rebuild the arrays.

first of all i added a new hard disk in virtual box: https://i.imgur.com/2iO1Vbv.jpg

i tried to follow this: https://www.howtoforge.com/replacing_ha ... aid1_array
so i wrote

mdadm --manage /dev/md0 --fail /dev/sdb1 but i got error. mdadm cannot find it. same with sda

after research i read something about that i need to copy the partitions to the new disk

oke. so i used this command: sfdisk -d /dev/sda | sfdisk /dev/sdb --force after that i got some warning https://i.imgur.com/6kVacfE.jpg

what can i do? I spent few hour to figure it out but nothing. the another problem is that i have no idea which one i need to copy to the new disk + to set fail and remove and blabla..(sda,sdb).

i whould be rly pleased if someone can help me. thank you.
Last edited by Norbii on 2017-09-24 12:45, edited 1 time in total.

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

Re: Debian raid1 reconstruction

#2 Post by p.H »

More information about your RAID setup is needed. First, what is the output of

Code: Select all

cat /etc/mdadm/mdadm.conf
cat /proc/mdstat
mdadm --verbose --examine --scan
fdisk -l

Norbii
Posts: 6
Joined: 2017-09-23 17:55

Re: Debian raid1 reconstruction

#3 Post by Norbii »

cat /etc/mdadm/mdadm.conf https://i.imgur.com/3KHqS0u.png
cat /proc/mdstat https://i.imgur.com/TVisb6j.png
mdadm --verbose --examine --scan https://i.imgur.com/a1CWdUX.png
fdisk -l https://i.imgur.com/rpAarQu.png

thank you.

if i use cat /proc/mdstat then i see that the raid is fine or not. so if i see UU everything is fine. The first U is the sda and the second is sdb?

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

Re: Debian raid1 reconstruction

#4 Post by p.H »

Err, can't you just copy and paste the outputs as plain text in your post ?

It is not convenient to have to
- view documents on another website
- view plain text as a graphical picture with no possible interaction (text search, copy and paste)

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

Re: Debian raid1 reconstruction

#5 Post by p.H »

Norbii wrote:cat /etc/mdadm/mdadm.conf https://i.imgur.com/3KHqS0u.png
cat /proc/mdstat https://i.imgur.com/TVisb6j.png
mdadm --verbose --examine --scan https://i.imgur.com/a1CWdUX.png
fdisk -l https://i.imgur.com/rpAarQu.png

thank you.

if i use cat /proc/mdstat then i see that the raid is fine or not. so if i see UU everything is fine. The first U is the sda and the second is sdb?
There is no second U nor mention of sdb in your /proc/mdstat. It means that one member is missing.

You created partitions for each array, so all you have to do now is add them to the arrays.

Code: Select all

mdadm --add /dev/md0 /dev/sdb1
mdadm --add /dev/md1 /dev/sdb2
mdadm --add /dev/md2 /dev/sdb3
mdadm --add /dev/md3 /dev/sdb4

Norbii
Posts: 6
Joined: 2017-09-23 17:55

Re: Debian raid1 reconstruction

#6 Post by Norbii »

i tried what u suggested and it seemed fine, but then i tried going on but i made some errors so i deleted the debian from the virtualbox and loaded it again. then i added the sbd and got this:mdadm: cannot find /dev/sdb1: no such file or directory.:(

i thought i was an expert on this process but it turned out i am not. i thought we first set the faulty hard drive partitions to "fail" and then delete them, after that we create an sda copy to sdb with sfdisk to make the sizes matched. and in the end we use adding md0 - sbd1..

i dont know what is the cause of the errors

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

Re: Debian raid1 reconstruction

#7 Post by p.H »

Norbii wrote:i thought we first set the faulty hard drive partitions to "fail" and then delete them, after that we create an sda copy to sdb with sfdisk to make the sizes matched. and in the end we use adding md0 - sbd1
What do mean by "delete" ? Remove them from the arrays with mdadm --remove ?

Overall, this is correct - except for the typos. Didn't you miss some step ? After creating the new partition table, did you check that it was properly loaded into the kernel (in /proc/partitions) ?

Norbii
Posts: 6
Joined: 2017-09-23 17:55

Re: Debian raid1 reconstruction

#8 Post by Norbii »

p.H wrote: What do mean by "delete" ? Remove them from the arrays with mdadm --remove ?
Yes.
p.H wrote: Othewise this is correct - except for the typos. Didn't you miss some step ? After creating the new partition table, did you check that it was properly loaded into the kernel (in /proc/partitions) ?
now i cant even start it.

so i loaded back the debian. i set one more harddisk (now i have 2).
I login and start with --fail but mdadm cannot find sdb same with --add

is it possible to send you the ovi file and if u have time check it?

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

Re: Debian raid1 reconstruction

#9 Post by p.H »

I don't know what an ovi file is.

Before issuing commands, did you check the device names assigned to the disks ?
Anyway, you must not add the whole disk /dev/sdb (or whatever name it has) but the partitions /dev/sdb1,2...

Norbii
Posts: 6
Joined: 2017-09-23 17:55

Re: Debian raid1 reconstruction

#10 Post by Norbii »

ah duude.

I MADE IT.:D Cant belive it. thank you very much for your help (L).

Post Reply