[SOLVED]Debian raid1 reconstruction

New to Debian (Or Linux in general)? Ask your questions here!

[SOLVED]Debian raid1 reconstruction

Postby Norbii » 2017-09-23 20:51

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.
Norbii
 
Posts: 6
Joined: 2017-09-23 17:55

Re: Debian raid1 reconstruction

Postby p.H » 2017-09-24 07:11

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

Re: Debian raid1 reconstruction

Postby Norbii » 2017-09-24 07:54

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?
Norbii
 
Posts: 6
Joined: 2017-09-23 17:55

Re: Debian raid1 reconstruction

Postby p.H » 2017-09-24 08:27

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
 
Posts: 177
Joined: 2017-09-17 07:12

Re: Debian raid1 reconstruction

Postby p.H » 2017-09-24 08:35

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

Re: Debian raid1 reconstruction

Postby Norbii » 2017-09-24 11:00

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
Norbii
 
Posts: 6
Joined: 2017-09-23 17:55

Re: Debian raid1 reconstruction

Postby p.H » 2017-09-24 11:09

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

Re: Debian raid1 reconstruction

Postby Norbii » 2017-09-24 11:22

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?
Norbii
 
Posts: 6
Joined: 2017-09-23 17:55

Re: Debian raid1 reconstruction

Postby p.H » 2017-09-24 12:12

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

Re: Debian raid1 reconstruction

Postby Norbii » 2017-09-24 12:25

ah duude.

I MADE IT.:D Cant belive it. thank you very much for your help (L).
Norbii
 
Posts: 6
Joined: 2017-09-23 17:55


Return to Beginners Questions

Who is online

Users browsing this forum: wizard10000 and 6 guests

fashionable