Skip to contentSkip to conversation

from raidtools2 to mdadm

DISCUSSION Clemens Schwaighofer 4 participants 8 messages Jun 21, 2005 – Jun 24, 2005 MD RAID

lore
Share & tools
lore
#0 lore raw

Hi,

as debian changed their package from raidtools2 to mdadm and left us users out in the cold (no mdadm.conf craeted, lsraid commands left in crontab, etc), I am now a bit worried if the command

#> mdadm --detail --scan>> mdadm.conf

is enought to get the raid started the next time I have to reboot the box.

Until now I used only the raidtools (raidhotadd, lsraid, etc). Is there somehwere a reference like what raidhotadd would be in mdadm command?

Signature · 5 lines
[ Clemens Schwaighofer                      -----=====:::::~ ]
[ TEQUILA\ Japan IT Group                                    ]
[                6-17-2 Ginza Chuo-ku, Tokyo 104-8167, JAPAN ]
[ Tel: +81-(0)3-3545-7703            Fax: +81-(0)3-3545-7343 ]
[ http://www.tequila.co.jp                                   ]
#1 lore raw
Quoted 5 lines · On Tuesday June 21, [email protected] wrote:

Hi,

as debian changed their package from raidtools2 to mdadm and left us users out in the cold (no mdadm.conf craeted, lsraid commands left in crontab, etc), I am now a bit worried if the command

Unfortunate...

Quoted 5 lines

#> mdadm --detail --scan>> mdadm.conf

is enought to get the raid started the next time I have to reboot the box.

1/ remove the 'devices=' parts. Then it should be ok, providing there
is a suitable DEVICES line at the top.
2/ If you were depending on 'raidstart' to start your arrays before,
mdadm will definitely be more reliable (which is to say that it should still work if you lose the first drive of your array...)
3/ Best way to find out is to try it!

Quoted 4 lines

Until now I used only the raidtools (raidhotadd, lsraid, etc). Is there somehwere a reference like what raidhotadd would be in mdadm command?

Well, there is the man-page for mdadm. An understanding is always better than a cheat-sheet...

But raidhotadd /dev/mdX /dev/hdY -> mdaddm /dev/mdX --add /dev/hdy

    s/add/remove/
    raidstop -> mdadm --stop

There is no real equivalent for mkraid. mdadm --create does the same thing in a very different way.

NeilBrown

#2 lore raw
Quoted 8 lines · Neil Brown
Quoted 4 lines

#> mdadm --detail --scan>> mdadm.conf

is enought to get the raid started the next time I have to reboot the box.

1/ remove the 'devices=' parts. Then it should be ok, providing there
is a suitable DEVICES line at the top.

yeah I have a devices line on the top. If I don't have, I will need the devices lines I guess.

Quoted 3 lines

2/ If you were depending on 'raidstart' to start your arrays before,
mdadm will definitely be more reliable (which is to say that it should still work if you lose the first drive of your array...)

no, it should be now called via the mdadm start

Quoted 1 line

3/ Best way to find out is to try it!

well :) not if you have production boxes with sw raid :D

Quoted 7 lines
Quoted 3 lines

Until now I used only the raidtools (raidhotadd, lsraid, etc). Is there somehwere a reference like what raidhotadd would be in mdadm command?

Well, there is the man-page for mdadm. An understanding is always better than a cheat-sheet...

yeah, I am crawling through the docs, and man pages to get a thinking of it.

Quoted 6 lines

But raidhotadd /dev/mdX /dev/hdY -> mdaddm /dev/mdX --add /dev/hdy

    s/add/remove/
    raidstop -> mdadm --stop

There is no real equivalent for mkraid. mdadm --create does the same thing in a very different way.

yeah, but I more often have to add/remove a device than I have to create a new raid, so its fine :)

Signature · 5 lines
[ Clemens Schwaighofer                      -----=====:::::~ ]
[ TEQUILA\ Japan IT Group                                    ]
[                6-17-2 Ginza Chuo-ku, Tokyo 104-8167, JAPAN ]
[ Tel: +81-(0)3-3545-7703            Fax: +81-(0)3-3545-7343 ]
[ http://www.tequila.co.jp                                   ]
#3 lore raw
Quoted 8 lines · On Tuesday June 21, [email protected] wrote:
Quoted 6 lines · Neil Brown
Quoted 4 lines

#> mdadm --detail --scan>> mdadm.conf

is enought to get the raid started the next time I have to reboot the box.

Quoted 5 lines
Quoted 2 lines

1/ remove the 'devices=' parts. Then it should be ok, providing there
is a suitable DEVICES line at the top.

yeah I have a devices line on the top. If I don't have, I will need the devices lines I guess.

No..
The 'devices=' bits by themselves aren't enough, and are rarely wanted.
If a device isn't listed in the DEVICES lines, then it won't be considered for use in an array.

The 'devices=' words are quite different. They say "this is how you recognise a device that is in this array. All the devices in it are on this list".
This is reported by "mdadm --detail --scan" largely for interest. It should rarely be included in mdadm.conf. The very latest version ofn mdadm does not report them unless --verbose is given.

NeilBrown

#4 lore raw
Quoted 5 lines · Neil Brown

No..
The 'devices=' bits by themselves aren't enough, and are rarely wanted.
If a device isn't listed in the DEVICES lines, then it won't be considered for use in an array.

okay

Quoted 6 lines

The 'devices=' words are quite different. They say "this is how you recognise a device that is in this array. All the devices in it are on this list".
This is reported by "mdadm --detail --scan" largely for interest. It should rarely be included in mdadm.conf. The very latest version ofn mdadm does not report them unless --verbose is given.

okay, then I have an old one, because mine gives it to me, thats why I had it in my conf file.

thanks for all the help

Signature · 5 lines
[ Clemens Schwaighofer                      -----=====:::::~ ]
[ TEQUILA\ Japan IT Group                                    ]
[                6-17-2 Ginza Chuo-ku, Tokyo 104-8167, JAPAN ]
[ Tel: +81-(0)3-3545-7703            Fax: +81-(0)3-3545-7343 ]
[ http://www.tequila.co.jp                                   ]
#7 lore raw
In reply to Clemens Schwaighofer
Quoted 8 lines · Clemens Schwaighofer

Hi,

as debian changed their package from raidtools2 to mdadm and left us users out in the cold (no mdadm.conf craeted, lsraid commands left in crontab, etc), I am now a bit worried if the command

#> mdadm --detail --scan>> mdadm.conf

i use this script to convert from old raidtab to mdadm.con
http://cvs.mandriva.com/cgi-bin/cvsweb.cgi/SPECS/mdadm/raidtabtomdadm.sh

Signature · 6 lines
Luca Berra -- [email protected]
       Communication Media & Services S.r.l.
/"\
\ /     ASCII RIBBON CAMPAIGN
 X        AGAINST HTML MAIL
/ \
#5 lore raw
In reply to Neil Brown
Quoted 28 lines · Neil Brown
Quoted 10 lines · On Tuesday June 21, [email protected] wrote:
Quoted 6 lines · Neil Brown
Quoted 6 lines

#> mdadm --detail --scan>> mdadm.conf

is enought to get the raid started the next time I have to reboot the box.

Quoted 8 lines
Quoted 4 lines

1/ remove the 'devices=' parts. Then it should be ok, providing there
is a suitable DEVICES line at the top.

yeah I have a devices line on the top. If I don't have, I will need the devices lines I guess.

No..
The 'devices=' bits by themselves aren't enough, and are rarely wanted.
If a device isn't listed in the DEVICES lines, then it won't be considered for use in an array.

Quoted 7 lines

The 'devices=' words are quite different. They say "this is how you recognise a device that is in this array. All the devices in it are on this list".
This is reported by "mdadm --detail --scan" largely for interest. It should rarely be included in mdadm.conf. The very latest version ofn mdadm does not report them unless --verbose is given.

So is there no way to ask mdadm to take what's running and create a config to make it happen again? Telling people to cread the man pages for a utility they did not use by choice and create a config file which could result in losing their data if it's wrong is a deterent to an upgrade, I suspect.

It would be desirable to follow the example of iptables, to allow rules to be configured by hand (more or less) and then have a tool to create a config file from what's there. A human readable editable file at that.

Signature · 3 lines
bill davidsen <[email protected]>
 CTO TMR Associates, Inc
 Doing interesting things with small computers since 1979
#6 lore raw
Quoted 6 lines · On Wednesday June 22, [email protected] wrote:

So is there no way to ask mdadm to take what's running and create a config to make it happen again? Telling people to cread the man pages for a utility they did not use by choice and create a config file which could result in losing their data if it's wrong is a deterent to an upgrade, I suspect.

There is a complexity in that devices can change there names across reboot, and mdadm has no way to know a minimal set of possible new names.

You could:
echo DEVICES partitions > /etc/mdadm.conf
mdadm -Ds | grep -v devices >> /etc/mdadm.conf

and then
mdadm -As

should re-assemble everything properly at boot time. However this might not handle stacked devices (raid0 comprised for raid1s) very well (maybe an enhancement for the next mdadm?).

A bad config file is unlikely to cause data loss. It might result it data not being visible until the problem is fixed.

I'm working towards making auto-assembly more bullet-proof, but it is not trivial, and I would rather it not give the appearance of working correctly until it really does (in contrast to 'raidstart' which gives the appearance of working correctly until a drive fails. Then it fails too :-( )

NeilBrown