Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
mdadm, removing non-raid HDD. worries
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
vinboy
n00b
n00b


Joined: 18 Jun 2006
Posts: 69

PostPosted: Fri Feb 29, 2008 11:58 pm    Post subject: mdadm, removing non-raid HDD. worries Reply with quote

hi
consider I have 5 HDD, namely SDA, SDB, SDC, SDD, SDE.


Lets assume that SDC and SDD are raid. SDB and SDE are raid.
Summary:
SDB->SDE (raid0)
SDC->SDD (raid1)

The mdadm config file states the corresponding raid info.


Now if I remove SDB from the list. The SDC become SDB, SDD become SDC, SDE become SDD.

If I boot into linux with this setup, what is going to happen? mdadm will try to assemble an array on (from our ORIGINAL drive naming) SDC with non existing drive. Then assemble SDD with SDE.

unless mdadm have a clever mechanism to tell which HDD belong to which raid.

any ideas?
I'm feeling abit unsafe now!!
:lol:
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 46357
Location: 56N 3W

PostPosted: Sat Mar 01, 2008 12:10 am    Post subject: Reply with quote

vinboy,

Does mdadm start your raid sets or does the kernel do it?
If you have raided partitions and not whole drives, the kernel will start the raid sets before it can even run mdadm or read the config file. Look for
Code:
[   36.861319] md: Autodetecting RAID arrays.
[   37.060624] md: Scanned 14 and added 14 devices.
[   37.062911] md: autorun ...
[   37.065153] md: considering sdb10 ...
[   37.067368] md:  adding sdb10 ...
[   37.069514] md: sdb9 has different UUID to sdb10
...
[   37.329355] md: created md0
[   37.330938] md: bind<sda1>
[   37.332483] md: bind<sdb1>
[   37.333981] md: running: <sdb1><sda1>
[   37.335538] raid1: raid set md0 active with 2 out of 2 mirrors
[   37.337124] md: ... autorun DONE.
If you see that (or something like it), you can move things around and it will just work. That shows the kernel using the persistent superblocks to put the raid sets together. It also uses the partition type from the partition table, which is missing if you donated the whole drives to raid.
You can still have persistent superblocks but its no requred as you must use mdadm to start the raid sets.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
embobo
Guru
Guru


Joined: 19 May 2003
Posts: 311

PostPosted: Sat Mar 01, 2008 12:15 am    Post subject: Reply with quote

Yes, md assigns a UUID for each array and writes it to the end of the parition (or whole drive if you aren't using partitions). Here is an example from my PC:

Code:

md: Autodetecting RAID arrays.
md: Scanned 12 and added 12 devices.
md: autorun ...
md: considering sdd3 ...
md:  adding sdd3 ...
md: sdd2 has different UUID to sdd3
md: sdd1 has different UUID to sdd3
md:  adding sdc3 ...
md: sdc2 has different UUID to sdd3
md: sdc1 has different UUID to sdd3
md:  adding sdb3 ...
md: sdb2 has different UUID to sdd3
md: sdb1 has different UUID to sdd3
md:  adding sda3 ...
md: sda2 has different UUID to sdd3
md: sda1 has different UUID to sdd3
md: created md5
md: bind<sda3>
md: bind<sdb3>
md: bind<sdc3>
md: bind<sdd3>
md: running: <sdd3><sdc3><sdb3><sda3>
raid5: device sdd3 operational as raid disk 0
raid5: device sdc3 operational as raid disk 2
raid5: device sdb3 operational as raid disk 3
raid5: device sda3 operational as raid disk 1
raid5: allocated 4203kB for md5
raid5: raid level 5 set md5 active with 4 out of 4 devices, algorithm 2
RAID5 conf printout:
 --- rd:4 wd:4
 disk 0, o:1, dev:sdd3
 disk 1, o:1, dev:sda3
 disk 2, o:1, dev:sdc3
 disk 3, o:1, dev:sdb3
md5: bitmap initialized from disk: read 12/12 pages, set 0 bits


This assumes you use autodetection of md arrays. Your mileage may vary. If in doubt you may want to change mdadm.conf ahead of time or simply move it out of the way.
Back to top
View user's profile Send private message
vinboy
n00b
n00b


Joined: 18 Jun 2006
Posts: 69

PostPosted: Sat Mar 01, 2008 10:24 am    Post subject: Reply with quote

oh ic.
I haven't tried mixing my hdds around yet. So i wasn't sure about the UUID thing since i don't have UUID stated in mdadm.conf or fstab.

by the way, what is the difference between raid partions vs raid the whole disk? Currently I raid only the partitions.

thanks in advance.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 46357
Location: 56N 3W

PostPosted: Sat Mar 01, 2008 10:54 am    Post subject: Reply with quote

vinboy,

Since you raid partitions, it should all just work. The UUIDs are written when the raids are first created.

When you rad whole drives you get 32kB more space per drive but as you no longer have a partition table, you cannot set the the partition type to 0xfd and the kernel cannot auto start the raid. Thats useless for root on raid as you then need to mount root to read /etc/mdadm.conf to start the raid on which root resides.

As the kernel auto starts your raid sets, it does it without mdadm or reading /etc/mdadm.conf
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum