Commit Graph

175 Commits

Author SHA1 Message Date
NeilBrown 061f2c6abd Make --brief even briefer.
Because ---examine --brief, or --detail --brief are
often used to create mdadm.conf, and because people don't want to
have to update their mdadm.conf unnecessarily, we don't want to
include information that might change.
And now that level changing is supported, that is almost everything
but UUID.

So move some more fields into the "Only print with --verbose" class.

Signed-off-by: NeilBrown <neilb@suse.de>
2009-05-11 15:18:20 +10:00
NeilBrown 6c40598f59 Merge branch 'master' into devel-3.0 2009-02-02 11:09:09 +11:00
NeilBrown a123619211 Fix the used device size in mdadm -D output.
As get_component_size() returns the number of used sectors of a device
we need halve before pringing as K, and shift the value by 9, not 10,
before passing to human_size.

Thanks to Andre Noll <maan@systemlinux.org> for identifying problem
(and a slightly different version of this patch)

Signed-off-by: NeilBrown <neilb@suse.de>
2009-02-02 10:03:20 +11:00
Dan Williams 5615172f1d Create: warn when a metadata format's platform components are missing
If the metadata handler can not find its platform support components
then there is no way for it to verify that the raid configuration will
be supported by the option-rom.  Provide a generic method for metadata
handlers to warn the user that the array they are about to create may
not work as intended with a given platform.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2009-01-20 01:36:51 -07:00
Dan Williams 4cce406959 introduce --detail-platform to display platform raid capabilities
Metadata formats like imsm work in concert with platform firmware and
hardware, so provide a way for mdadm to display this info to the user.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2008-12-08 16:59:18 -07:00
NeilBrown 7e6c6cb267 Detail: support MD_DEVNAME in --export for metadata-less devices.
If there is no metadata (--build was used) then we need to lookup
by devnum, not by uuid, to get the map entry.

Signed-off-by: NeilBrown <neilb@suse.de>
2008-11-04 20:50:39 +11:00
NeilBrown f069dd29f0 detail: --export also provided MD_DEVNAME
MD_NAME is the name of the array extracted directly from the metadata.
MD_DEVNAME is the current working name of the array.  It should appear
in /dev/md.  It is possibly what the user gave when creating the
array.
We extract it from /var/run/mdadm/map.

Signed-off-by: NeilBrown <neilb@suse.de>
2008-11-04 20:50:39 +11:00
NeilBrown 9c3220067b Merge branch 'master' into devel-3.0 2008-10-30 17:02:49 +11:00
NeilBrown 4ebd323711 Adjust major number testing to allow for extended minor number in 2.6.28
From 2.6.28, normal md device will be able to have partitions.  These
partitions will have a different major number.  Sometimes mdadm tests
the major number and so can get confused.
Change these tests to test against get_mdp_major().  mdp does not use
extended minor number and so this test will always be accurate.

Also use /sys/dev links to map major/minor to devnum in sysfs.

Signed-off-by: NeilBrown <neilb@suse.de>
2008-10-30 16:37:29 +11:00
NeilBrown 6c766cf101 Merge branch 'master' into devel-3.0
Conflicts:

	Incremental.c
	super0.c
	super1.c
2008-10-30 13:59:11 +11:00
Doug Ledford d7ee65c960 Fix bad metadata formatting
Certain operations (Detail.c mainly) would print out the metadata of
an array in a format that the scan operation in super0.c and super1.c
would later reject as unknown when it was found in the mdadm.conf file.
Use a consistent format, but also modify the super0 and super1 match
methods to accept the other format without complaint.

Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2008-10-30 08:53:02 +11:00
NeilBrown 492350045c Merge branch 'master' into devel-3.0
Conflicts:

	Manage.c
2008-10-17 12:46:23 +11:00
NeilBrown e4965ef846 Improve reporting of layout for raid10.
Showing e.g.

   near=1, far=2

for the 'far2' layout of raid10 is confusing even though there is a
sense in which is it correct.

Make it less confusing by only printing whichever number is not 1.
If both are 1, make that clear too (i.e. no redundancy).
2008-10-13 16:15:18 +11:00
NeilBrown 35ddc76dcb Use common code to report MD_UUID for --detail --export
As we need to be able to extract a UUID from any superblock
for matching, use that as the MD_UUID as it will probably be
used for array matching too.
2008-09-18 16:12:28 +10:00
NeilBrown ff54de6e47 Report uuid in --detail --brief for ddf and intel
The uuid is slightly fictitious but needed for array matching.
2008-09-18 16:11:40 +10:00
NeilBrown c69b251bc7 Teach --detail about containers and members there-of.
Make --detail on a container more useful by suppressing irrelevant
detail and adding useful detail like a list of member arrays.

Ditto for members of a container: report the name of the container
array.

Signed-off-by: NeilBrown <neilb@suse.de>
2008-09-18 15:05:20 +10:00
Doug Ledford fb97b4d691 Clean up usage of open()
Fix on call that passed an invalid mode to open
	Don't pass a third arg unless we also pass O_CREAT
	Use symbolic args for 2nd and 3rd args

Signed-off-by: Doug Ledford <dledford@redhat.com>
2008-07-24 18:35:11 -04:00
Neil Brown e8eb8763b4 Add "bitmap=" to "--detail --brief" output when relevant.
Thanks to "Jon Nelson" <jnelson-linux-raid@jamponi.net> for the suggestion.

Signed-off-by: Neil Brown <neilb@suse.de>
2008-06-26 09:33:37 +10:00
Kay Sievers 0d726f17e1 add --export option to --examine
From: Kay Sievers <kay.sievers@vrfy.org>

Cc: David Zeuthen <david@fubar.dk>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
2008-05-06 10:02:38 +10:00
Neil Brown 7a3be72fc6 Fix problems with array.size overflowing on large arrays.
array.size is 32bits and counts K.  So for arrays with
more than 4Terrabytes, it can overflow.
The correct number can be read from sysfs, but there are still
a few places that use array.size and risk truncation.  What is worse.
they compare a number of kilobytes with a number of sectors !!

So use get_component_size() to read the sysfs information, and be
more consistent about units.
2008-04-28 16:29:37 +10:00
Neil Brown 142cb9e181 Use sysfs info for metadata version info in Detail and elsewhere. 2007-12-14 20:15:21 +11:00
Neil Brown 1686dc25ec Find super from fd on an array.
We used to use the major/minor numbers, but that isn't sufficient
any more, so pass the fd, and possibly check 'text' version.
2007-12-14 20:14:38 +11:00
Neil Brown 3da92f272d Drop the superblock arg from all metadata methods.
It is now in the 'supertype'
2007-12-14 20:14:33 +11:00
Neil Brown 68c7d6d790 Add 'supertype' arg to almost all metadata methods.
The 'superblock' will be moved into this structure soon.
2007-12-14 20:14:16 +11:00
Neil Brown df37ffc039 Allow metadata handlers to free their own superblock.
As the metadata handler allocates the superblock, it should free it
too.  DDF will have a more complex 'superblock' which needs more complex
freeing.
2007-12-14 20:14:00 +11:00
Neil Brown aba69144fd Remove spaces/tabs from ends of lines. 2007-12-14 20:13:43 +11:00
Neil Brown 7615d98913 Add metadata version information to "--detail --brief" output. 2007-11-13 09:55:29 +11:00
Tim Woods 9bbcc5f7c4 "--export" segfaults with non-persistent super blocks
From: Tim Woods <timwoods@uklinux.net>

	This patch fixes a NULL pointer dereference in Detail.c when running
'mdadm --detail --export' on a device with non-persistent super blocks.
2007-07-23 17:15:52 +10:00
Neil Brown a328c097ff Fix compile error in Detail.c
'avail' is undefined if '--export', so make sure we don't try to use
it.
2007-05-22 09:46:29 +10:00
Neil Brown a77be58672 Make return code for "--detail --test" more reliable.
Missing devices as well as failed devices cause an error.
2007-05-21 14:25:50 +10:00
Kay Sievers 54bad3644f Add --export option to --detail to use key=value pairs.
udev likes to get information about a device as key=value pairs so it
can create disk/by-id links etc.  So add --export flag which causes
the output of --detail to easily parsable.

From: Kay Sievers <kay.sievers@novell.com>
2007-05-08 17:17:33 +10:00
Neil Brown beae1dfe2e Central calls to ioctl BLKGETSIZE
Instead of opencoding the same thing everywhere.
2006-12-14 17:32:57 +11:00
Neil Brown e336254463 Change 'Device Size' to 'Used Dev Size'
because it only shows how much of each device is actually used, not
how big they are.
2006-12-14 17:31:19 +11:00
Neil Brown b6750aa8da Include homehost information in --detail where appropriate.
Signed-off-by: Neil Brown <neilb@suse.de>
2006-05-19 07:13:03 +00:00
Neil Brown 4f589ad0c5 Just updaqte copyright dates and email address
Signed-off-by: Neil Brown <neilb@suse.de>
2006-05-19 05:25:11 +00:00
Neil Brown 120230a4fc Detail checks if array has been started or not and includes that in report.
Signed-off-by: Neil Brown <neilb@suse.de>
2006-05-15 06:03:05 +00:00
Neil Brown b578481ca3 Support new offset layout for raid10
Requires 2.6.18.

Signed-off-by: Neil Brown <neilb@suse.de>
2006-05-15 02:46:54 +00:00
Neil Brown e27d562bcc Reduce dependance on MD_SB_DISKS
--monitor should now work with arrays larger than 28 devices.

Signed-off-by: Neil Brown <neilb@suse.de>
2006-03-28 23:02:45 +00:00
Neil Brown bed256c241 Add information about reshape to --detail
Also fix problems with dev names and symlinks

Signed-off-by: Neil Brown <neilb@suse.de>
2006-03-28 22:44:05 +00:00
Neil Brown 4027ddcaa4 Don't try to get bitmap info on old kernels.
.. this causes silly warnings.
Unfortuantely there are 2.6 kernels which will still produce
warnings.  We cannot reliable detect those.

Signed-off-by: Neil Brown <neilb@suse.de>
2006-03-28 06:39:29 +00:00
Neil Brown 16c6fa807c Create missing /dev files where needed.
Whenever we need a device file to open, if one cannot be found in /dev,
create a temporary one.

Signed-off-by: Neil Brown <neilb@suse.de>
2006-03-28 06:26:53 +00:00
Neil Brown 8352ab3e2c Fix messy --detail output when there is a failed device.
The missing devices show as garbage.

Signed-off-by: Neil Brown <neilb@suse.de>
2006-03-28 05:51:50 +00:00
Neil Brown 313176636e Remove ident arg from getinfo_super;
Add a 'name' field to 'info' to compensate.

Signed-off-by: Neil Brown <neilb@suse.de>
2006-03-27 04:34:38 +00:00
Neil Brown 22a8899586 Sort mdstat entries so that composites are well-ordered.
This means that "-Ds" lists arrays in an approprate order
for assembly.

Signed-off-by: Neil Brown <neilb@suse.de>
2006-01-31 00:39:50 +00:00
Neil Brown 6ee5c05a11 Report device size correctly in --detail for Large devices.
Signed-off-by: Neil Brown <neilb@suse.de>
2006-01-30 23:42:53 +00:00
Neil Brown 8fac0577f0 Stuff like..
- report Intent Bitmap in --detail
- report internal bitmap in --examine
- pass' --force through to --grow --bitmap
- support v.large arrays in --grow --bitmap

Signed-off-by: Neil Brown <neilb@suse.de>
2006-01-30 23:23:45 +00:00
Neil Brown 3d4064cc9b Support --help --assemble etc.
i.e. allow '--help' to be first and still give
context sensitive help.

Also don't print truncated device-size of very large arrays.

Signed-off-by: Neil Brown <neilb@suse.de>
2006-01-30 00:13:26 +00:00
Neil Brown 67687afe7a Fix bug on new --detail code
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
2005-08-16 07:11:15 +00:00
Neil Brown b0c63f3203 Fix --detail output for version 1 superblocks.
As raid_disk no longer matches number, we do things differently.

Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
2005-08-15 06:54:20 +00:00
Neil Brown 947fd4ddb5 Support nameing of version-1 arrays.
--name is recognised in --create and --assemble
name= is recognised in config file.

Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
2005-08-09 05:23:20 +00:00
Neil Brown dfd4d8ee42 Add write-behind support
Currently this includes
  --write-behind  to set level of write-behind supported
  --write-mostly  to flag devices as write-mostly.

Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
2005-08-09 04:25:47 +00:00
Neil Brown 22892d5632 Don't list device= in --examine --scan output.
As the device list isn't stable, recording it should be avoided.
The device= list is still available if --verbose is given (once).

Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
2005-06-14 06:34:23 +00:00
Neil Brown ea32955930 Increase max-devs on type-1 superblocks
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
2005-06-07 23:03:46 +00:00
Neil Brown 82d9eba687 super1
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
Fix raid5 creation with new code.

Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
2005-05-03 23:44:40 +00:00
Neil Brown f9ce90ba50 Add a 'super-switch' so that different format superblocks can be used.
This includes:
  adding --metadata= option to choose metadata format
  adding metadata= word to config file.

Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
2005-05-03 23:44:32 +00:00
Neil Brown 4b1ac34b51 Separate sueprblock handling into separate file
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
2005-05-03 23:44:18 +00:00
Neil Brown 0df46c2ad8 Change MAJOR() etc to major() etc
This allows for larger device number if glibc supports
it (requires 2.3.3).
Also fail before creating larger device number if glibc
support isn't present.

Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
2005-04-04 05:16:13 +00:00
Neil Brown 182661f409 Change "dirty" to "active" in array status
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
2005-04-04 05:16:07 +00:00
Neil Brown e5329c3747 mdadm-1.7.0 2004-08-11 02:16:01 +00:00
Neil Brown dd0781e505 mdadm-1.6.0 2004-06-04 12:03:19 +00:00
Neil Brown 98c6faba80 mdadm-1.5.0 2004-01-22 02:10:29 +00:00
Neil Brown feb716e9c3 mdadm-1.4.0 2003-10-28 23:20:01 +00:00
Neil Brown aa88f531b4 mdadm-1.3.0 2003-07-28 23:59:00 +00:00
Neil Brown d013a55e94 mdadm-1.1.0 2003-03-02 23:11:38 +00:00
Neil Brown 5787fa4906 mdadm-1.0.9 2003-02-12 00:17:26 +00:00
Neil Brown b83d95f362 mdadm-0.8.2 2002-04-11 01:36:14 +00:00
Neil Brown e0d1903663 mdadm-0.8 2002-04-04 01:58:32 +00:00
Neil Brown 11a3e71da4 mdadm-0.7.2 2002-03-20 22:39:50 +00:00
Neil Brown 56eb10c0b6 mdadm-0.7.1 2002-03-15 05:21:36 +00:00
Neil Brown 9a9dab3670 mdadm-0.7 2002-03-08 00:03:52 +00:00
Neil Brown cd29a5c835 mdctl-0.6 2002-03-06 23:17:40 +00:00
Neil Brown 5282684628 mdctl-0.5 2001-08-23 02:33:20 +00:00
Neil Brown 82b27616de mdctl-v0.4 2001-07-26 07:00:09 +00:00
Neil Brown 682c705194 mdctl-v0.3 2001-06-14 05:33:53 +00:00
Neil Brown 64c4757e27 mdctl-v0.2 2001-06-08 02:36:23 +00:00