* mdadm - comments on command layout
@ 2004-08-13 20:25 John Stoffel
2004-08-14 2:28 ` berk walker
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: John Stoffel @ 2004-08-13 20:25 UTC (permalink / raw)
To: linux-raid
Hi Neil,
I've been using mdadm recently to work with some arrays and I really
have to say I dislike how the commands are laid out and used. First
off, they're not consistent from one usage to another. Of course, I'm
going to be jerk and not give good examples since my personal box at
home is down and I'm at work. But the idea is that when you assemble
a RAID device, it should look similiar to how you manage that raid
device.
I'd also love it if there was an mdadm shell, so I could just type
'mdadm' and get back a shell prompt like:
mdadm>
which I could then use to manage my arrays.
For example, I think all the commands should be of the format:
mdadm <comand> [options] <array> [devices...]
as much as possible. I'm basing my thoughts on both the Vertias VxVM
command set, as well as the ClearCase 'cleartool' command shell. So
ideally I could do either:
> mdadm assemble md0 /dev/hda1 /dev/hda2 ...
or
> mdadm
madam> assemble md0 /dev/hda1 /dev/hda2 ...
depending on my mood. Currently, the mdadm commands use various
formats for their arguement layouts and it's a pain to figure out what
to use.
So before I get all worked up on this issue, and spend a bunch of time
mapping out how I think the commands should work, do people agree with
my observation?
Thanks,
John
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: mdadm - comments on command layout
2004-08-13 20:25 mdadm - comments on command layout John Stoffel
@ 2004-08-14 2:28 ` berk walker
2004-08-14 9:56 ` Frank van Maarseveen
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: berk walker @ 2004-08-14 2:28 UTC (permalink / raw)
To: John Stoffel; +Cc: linux-raid
hear hear (also, here here)
b-
John Stoffel wrote:
>Hi Neil,
>
>I've been using mdadm recently to work with some arrays and I really
>have to say I dislike how the commands are laid out and used. First
>off, they're not consistent from one usage to another. Of course, I'm
>going to be jerk and not give good examples since my personal box at
>home is down and I'm at work. But the idea is that when you assemble
>a RAID device, it should look similiar to how you manage that raid
>device.
>
>I'd also love it if there was an mdadm shell, so I could just type
>'mdadm' and get back a shell prompt like:
>
> mdadm>
>
>which I could then use to manage my arrays.
>
>For example, I think all the commands should be of the format:
>
> mdadm <comand> [options] <array> [devices...]
>
>as much as possible. I'm basing my thoughts on both the Vertias VxVM
>command set, as well as the ClearCase 'cleartool' command shell. So
>ideally I could do either:
>
> > mdadm assemble md0 /dev/hda1 /dev/hda2 ...
>
>or
>
> > mdadm
> madam> assemble md0 /dev/hda1 /dev/hda2 ...
>
>depending on my mood. Currently, the mdadm commands use various
>formats for their arguement layouts and it's a pain to figure out what
>to use.
>
>So before I get all worked up on this issue, and spend a bunch of time
>mapping out how I think the commands should work, do people agree with
>my observation?
>
>Thanks,
>John
>-
>To unsubscribe from this list: send the line "unsubscribe linux-raid" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: mdadm - comments on command layout
2004-08-13 20:25 mdadm - comments on command layout John Stoffel
2004-08-14 2:28 ` berk walker
@ 2004-08-14 9:56 ` Frank van Maarseveen
2004-08-14 12:33 ` Neil Brown
2004-08-14 14:13 ` Mark Hahn
3 siblings, 0 replies; 7+ messages in thread
From: Frank van Maarseveen @ 2004-08-14 9:56 UTC (permalink / raw)
To: John Stoffel; +Cc: linux-raid
On Fri, Aug 13, 2004 at 04:25:47PM -0400, John Stoffel wrote:
> ideally I could do either:
>
> > mdadm assemble md0 /dev/hda1 /dev/hda2 ...
>
> or
>
> > mdadm
> madam> assemble md0 /dev/hda1 /dev/hda2 ...
>
Both should have an identical command/argument syntax. The "shell"
mode would allow for context sensitive argument completion and help (can
mostly be done in bash as well but that's a bit clumsy).
This might be useful for tools which aren't used on daily basis.
On the other hand you have to figure it out anyway and better prepare
the cookbooks/scripts to handle drive failure in advance.
--
Frank
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: mdadm - comments on command layout
2004-08-13 20:25 mdadm - comments on command layout John Stoffel
2004-08-14 2:28 ` berk walker
2004-08-14 9:56 ` Frank van Maarseveen
@ 2004-08-14 12:33 ` Neil Brown
2004-08-14 14:46 ` maarten van den Berg
2004-08-14 14:13 ` Mark Hahn
3 siblings, 1 reply; 7+ messages in thread
From: Neil Brown @ 2004-08-14 12:33 UTC (permalink / raw)
To: John Stoffel; +Cc: linux-raid
On Friday August 13, stoffel@lucent.com wrote:
>
> Hi Neil,
>
> I've been using mdadm recently to work with some arrays and I really
> have to say I dislike how the commands are laid out and used. First
> off, they're not consistent from one usage to another. Of course, I'm
> going to be jerk and not give good examples since my personal box at
> home is down and I'm at work. But the idea is that when you assemble
> a RAID device, it should look similiar to how you manage that raid
> device.
Examples would really help. In my mind it is very regular. There is
some room for flexibility, but generally, the usage is
mdadm --mode --option... /dev/md-device [ component devices ... ]
>
> I'd also love it if there was an mdadm shell, so I could just type
> 'mdadm' and get back a shell prompt like:
>
> mdadm>
>
> which I could then use to manage my arrays.
>
> For example, I think all the commands should be of the format:
>
> mdadm <comand> [options] <array> [devices...]
Except that I follow the Unix norms of --command, that is (to me)
exactly what usage is like.
>
> as much as possible. I'm basing my thoughts on both the Vertias VxVM
> command set, as well as the ClearCase 'cleartool' command shell. So
> ideally I could do either:
>
> > mdadm assemble md0 /dev/hda1 /dev/hda2 ...
>
> or
>
> > mdadm
> madam> assemble md0 /dev/hda1 /dev/hda2 ...
>
> depending on my mood. Currently, the mdadm commands use various
> formats for their arguement layouts and it's a pain to figure out what
> to use.
Well, if you really want a shell mode, I recommend writing one using a
popular shell, such as bash. I have included a code fragment below.
If you store it in a file named, e.g., 'mdsh', then it will do
essentially what you seem to be asking.
>
> So before I get all worked up on this issue, and spend a bunch of time
> mapping out how I think the commands should work, do people agree with
> my observation?
I don't, but I'm obviously biased. Maybe if you could (as I said
above) show me where the irregularities are, that would help.
Possibly it's just a case of needing improved documentation.
Anyway, here is a code fragment which implements a command called
"mdsh". If you type "mdsh" with no args, you get a shell prompt. All
normal shell commands work as well as a new command "assemble" which
adds "/dev/" to it's first argument and passes the whole lot to "mdadm
--assemble". Alternately, you can run
mdsh assemble md0 ....
and get a similar effect. Extensions are left as an exercise for the
reader. :-)
NeilBrown
#!/bin/bash
if [ $# -eq 0 -a " $mdsh_running" != " yes" ]
then
export mdsh_running=yes
exec bash --rcfile `which $0`
exit 1
fi
assemble()
{
mdev=$1; shift
if [ ! -b "$mdev" -a -b /dev/"$mdev" ]
then mdev=/dev/"$mdev"
fi
mdadm --assemble $mdev "$@"
}
case $# in
0 )
PS1='mdsh > ' PS2='mdsh.. '
;;
* ) eval "$@"
esac
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: mdadm - comments on command layout
2004-08-13 20:25 mdadm - comments on command layout John Stoffel
` (2 preceding siblings ...)
2004-08-14 12:33 ` Neil Brown
@ 2004-08-14 14:13 ` Mark Hahn
3 siblings, 0 replies; 7+ messages in thread
From: Mark Hahn @ 2004-08-14 14:13 UTC (permalink / raw)
To: John Stoffel; +Cc: linux-raid
> mapping out how I think the commands should work, do people agree with
> my observation?
no. I find mdadm commandlines reasonably intuitive and consistent;
having a shell-like mode would not hurt, but then again, the
interactive commands would necessarily look almost the same as
normal, discrete mdadm commands (and you do have a shell with
history and editing, no?)
forgive me if this sounds insulting, but is the problem that you're
not comfortable with the unixy emphasis on commandline arguments
and switches?
regards, mark hahn.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: mdadm - comments on command layout
2004-08-14 12:33 ` Neil Brown
@ 2004-08-14 14:46 ` maarten van den Berg
2004-08-14 16:26 ` Guy
0 siblings, 1 reply; 7+ messages in thread
From: maarten van den Berg @ 2004-08-14 14:46 UTC (permalink / raw)
To: linux-raid
On Saturday 14 August 2004 14:33, Neil Brown wrote:
> On Friday August 13, stoffel@lucent.com wrote:
> > Hi Neil,
> >
> > I've been using mdadm recently to work with some arrays and I really
> > have to say I dislike how the commands are laid out and used. First
> > off, they're not consistent from one usage to another. Of course, I'm
> > going to be jerk and not give good examples since my personal box at
> > home is down and I'm at work. But the idea is that when you assemble
> > a RAID device, it should look similiar to how you manage that raid
> > device.
>
> Examples would really help. In my mind it is very regular. There is
> some room for flexibility, but generally, the usage is
>
> mdadm --mode --option... /dev/md-device [ component devices ... ]
Hi Neil,
In my mind, either the manpage is somewhat confusing, or the program is.
From the exact syntax above I would assume that to (hot)add a device I need to
type 'mdadm --manage -a ...'. But just 'mdadm -a ...' is enough. So is the
case for some other modes. The syntax given isn't mdadm [--mode] --option ,
so one would assume just omitting --manage would lead to an error.
This was, I mean still is, indeed confusing to me.
There is another bit. Quoting from the manpage you first have MODES, then the
6 modi are explained, and directly thereafter comes OPTIONS, but some of them
seem to list modes, not options:
-A, --assemble
-B, --build
-C, --create
etc.
So that leaves a big question; is it a mode, an option...?
The whole mode thing is either not clear to _me_, or it is somewhat confusing
in general. I wouldn't really suggest that typing 'mdadm -a' instead of
'mdadm --manage -a' should lead to an error, but the concept of the modi now
makes little sense (to me personally). But maybe I just misunderstood things.
.
So moving the -A, -B etc. "options" to the section "modes" above, adding a -M
--manage mode there as well might make everything clearer. (That's just MHO.)
But anyhow, the program does what it's supposed to do, so... :-)
Respectfully,
Maarten
--
When I answered where I wanted to go today, they just hung up -- Unknown
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: mdadm - comments on command layout
2004-08-14 14:46 ` maarten van den Berg
@ 2004-08-14 16:26 ` Guy
0 siblings, 0 replies; 7+ messages in thread
From: Guy @ 2004-08-14 16:26 UTC (permalink / raw)
To: 'maarten van den Berg', linux-raid
I have never had any problems using mdadm's command syntax, but...
From the man page:
SYNOPSIS
mdadm [mode] <raiddevice> [options] <component-devices>
Mode is optional. Since some options are the same or similar (-b -B, -f -F,
-c -C, -r -R, -m --mail -m --super-minor) maybe the mode should not be
optional. Over time even more options will be added, this will increase the
risk of mdadm not doing what I intended when I make a typo, or maybe
miss-understand the options. It is common for me to forget the case of an
option, when this has happened I got errors, but there is a chance it was a
valid option but not what I intended. It would suck to lose my BIG :) 200G
array due to a typo. But, this is Unix, many commands could trash the
system with a simple 1 byte typo. I use mode when I use mdadm, maybe I
never noticed it was optional, not sure.
In short...
1. To make mdadm safer to use, make mode not optional.
2. I am fine with it, as it is.
3. Neil, spend your spare time adding new feature!
Guy
-----Original Message-----
From: linux-raid-owner@vger.kernel.org
[mailto:linux-raid-owner@vger.kernel.org] On Behalf Of maarten van den Berg
Sent: Saturday, August 14, 2004 10:47 AM
To: linux-raid@vger.kernel.org
Subject: Re: mdadm - comments on command layout
On Saturday 14 August 2004 14:33, Neil Brown wrote:
> On Friday August 13, stoffel@lucent.com wrote:
> > Hi Neil,
> >
> > I've been using mdadm recently to work with some arrays and I really
> > have to say I dislike how the commands are laid out and used. First
> > off, they're not consistent from one usage to another. Of course, I'm
> > going to be jerk and not give good examples since my personal box at
> > home is down and I'm at work. But the idea is that when you assemble
> > a RAID device, it should look similiar to how you manage that raid
> > device.
>
> Examples would really help. In my mind it is very regular. There is
> some room for flexibility, but generally, the usage is
>
> mdadm --mode --option... /dev/md-device [ component devices ... ]
Hi Neil,
In my mind, either the manpage is somewhat confusing, or the program is.
From the exact syntax above I would assume that to (hot)add a device I need
to
type 'mdadm --manage -a ...'. But just 'mdadm -a ...' is enough. So is the
case for some other modes. The syntax given isn't mdadm [--mode] --option ,
so one would assume just omitting --manage would lead to an error.
This was, I mean still is, indeed confusing to me.
There is another bit. Quoting from the manpage you first have MODES, then
the
6 modi are explained, and directly thereafter comes OPTIONS, but some of
them
seem to list modes, not options:
-A, --assemble
-B, --build
-C, --create
etc.
So that leaves a big question; is it a mode, an option...?
The whole mode thing is either not clear to _me_, or it is somewhat
confusing
in general. I wouldn't really suggest that typing 'mdadm -a' instead of
'mdadm --manage -a' should lead to an error, but the concept of the modi
now
makes little sense (to me personally). But maybe I just misunderstood
things.
.
So moving the -A, -B etc. "options" to the section "modes" above, adding a
-M
--manage mode there as well might make everything clearer. (That's just
MHO.)
But anyhow, the program does what it's supposed to do, so... :-)
Respectfully,
Maarten
--
When I answered where I wanted to go today, they just hung up -- Unknown
-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2004-08-14 16:26 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-13 20:25 mdadm - comments on command layout John Stoffel
2004-08-14 2:28 ` berk walker
2004-08-14 9:56 ` Frank van Maarseveen
2004-08-14 12:33 ` Neil Brown
2004-08-14 14:46 ` maarten van den Berg
2004-08-14 16:26 ` Guy
2004-08-14 14:13 ` Mark Hahn
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).