Commit Graph

110 Commits

Author SHA1 Message Date
Neil Brown 17f25ca6fb Add 'container' level and ->validate_geometry method.
These will be used for ddf.
2008-05-15 16:47:41 +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 9a02c62af9 Make device-special files for partitions when using --incremental 2008-05-05 21:55:39 +10:00
Neil Brown 63152c1b33 Unify code into find_free_devnum.
Two places have code to find a free md device number.  Make this
a subroutine.
2008-05-05 21:55:36 +10:00
Neil Brown c2c9bb6fe0 diff -ru mdadm-2.6.4-orig/Query.c mdadm-2.6.4/Query.c 2008-04-29 17:13:55 +10:00
Neil Brown 7e0f69790c Replace sysarray with mdinfo
Sure, mdinfo is bigger, but having a uniform structure for lots of things
will make life easier.
2007-12-14 20:14:59 +11:00
Neil Brown 06c7f68e40 Use 'mdinfo' instead of special 'sysdev' structure.
there is needless duplicatiion between mdinfo and sysdev, so discard
the latter.
2007-12-14 20:14:57 +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 64557c3391 Fix compare_super to take supertype instead of a superblock.
As this function takes 2 superblocks, the change is a bit more subtle,
so is done separately.
2007-12-14 20:14:27 +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
maximilian attems e39b673e48 Add klibc support to mdadm.h
klibc still misses a lot functionality to let mdadm link against,
this small step helps to get to the real trouble.. :)

Signed-off-by: maximilian attems <max@stro.at>
Signed-off-by: Neil Brown <neilb@suse.de>
2007-09-24 13:21:38 +10:00
Doug Ledford 024768c465 Fix parsing of "-a" in various contexts.
From: Doug Ledford <dledford@redhat.com>

This one fixes a bug where once manage mode is set, the -a short option
is no longer parsed correctly (true of grow mode as well).  This happens
because when you switch the short opts to the bitmap_auto version, it
specifies that the argument must follow a, yet the loop expects to get
an undecorated option and parse it as the disk dev instead of trying to
parse optarg.  So, create a new short opt array that is used for manage
and grow that doesn't list a as having an argument.
2007-07-09 09:59:59 +10:00
Neil Brown fffdbe5ed0 Release 2.6.2 2007-05-21 14:25:53 +10:00
Neil Brown 1f48664b8e Add --auto-detect for in-kernel autodetect.
This is equivalent to raidautorun that some distros provide.
2007-05-21 14:25:44 +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 f783ca4fa1 Don't include uclibc as part of 'everything'
As I cannot compile in on x86-64.
Also, small dietlibc fix
2007-02-22 14:59:31 +11:00
Neil Brown 8382f19bdc Add new mode: --incremental
--incremental allows arrays to be assembled one device at a time.
This is expected to be used with udev.
2006-12-21 17:10:52 +11:00
Neil Brown 350f29f90d Centralise code for copying uuid
Rather than opencoding the byteswap all the time.
2006-12-14 17:33:14 +11:00
Neil Brown 3d3dd91e38 Support --uuid= with --create to choose your own UUID. 2006-12-14 17:33:10 +11: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 bf4fb153a4 Fix and test --update=uuid
A number of odd bugs here, but now we have a regression test as well.
2006-12-14 17:31:29 +11:00
Neil Brown 37dfc3d638 When resync finished, report the mismatch count if there is one.
This doesn't get mailed out, but will appear in syslog...
Maybe it should be mailed if it was a 'check' or 'repair' pass...
2006-12-14 17:31:25 +11:00
Neil Brown b90c0e9a12 --wait or -W will wait for resync activity to finish on the given devices. 2006-12-14 17:31:22 +11:00
Neil Brown 758d3a8e7d Increase raid456 stripe cache size if needed to --grow the array.
The setting used unfortunately requires intimate knowledge of the
kernel, and it not reset when the reshape finishes.
2006-12-14 17:31:16 +11:00
Neil Brown 583315d9c5 Give useful message if raid4/5/6 cannot be started because it is not clean and is also degraded. 2006-12-14 17:31:13 +11:00
Neil Brown 199171a297 Improve allocation and use of space for bitmaps in version1 metadata
Depending on the size of the array we reserve space for up to 128K
of bitmap, and we use it where possible.
When hot-adding to a version 1.0 we can still only use the 3K at the
end though - need a sysfs interface to improve that.

If a small chunksize is requested on Create, we don't auto-enlarge
the reserved space - this still needs to be fixed.
2006-12-14 17:31:00 +11:00
Neil Brown b5e3d1901f Remove some unused interfaces to the metadata handlers.
This stuff has never been used (at least as far as git history can
see).  I wonder why it was there...
2006-12-14 17:30:53 +11:00
Neil Brown 0430ed4868 Remove partitions from components of an md array
They do nothing but cause confusion.
2006-10-13 09:02:35 +10:00
Neil Brown 38098016ca Allow symlink creation to be disabled from command line or mdadm.conf 2006-08-11 18:00:05 +10:00
Neil Brown 8aec876d2e More consistent honoring of --configfile
Never use /etc/mdadm.conf if --config file is given (previously
some code used one, some used the other).
2006-06-26 15:11:01 +10:00
Neil Brown 45e878bba6 Improve ftw handling.
If not 'ftw' is available, still allow openning of devices by dev number.

More recent version of uclibc support nftw, so add support to check
for that.
2006-06-26 15:10:48 +10:00
Neil Brown 0ae03b8ad8 Yet another include file that someone doesn't like....
It seems byteswap.h isn't universally accepted, so
we do it by hand...

Signed-off-by: Neil Brown <neilb@suse.de>
2006-06-02 05:37:47 +00:00
Neil Brown 058574b1da Allow default metadata to be specified in mdadm.conf
CREATE metadata=1
in mdadm.conf will cause version-1 superblocks to be the default.

Signed-off-by: Neil Brown <neilb@suse.de>
2006-06-02 05:33:40 +00:00
Neil Brown efd441d17b Finally (I hope) get byteorder stuff portable.
/usr/include/endian.h and /usr/include/byteswap.h together
can give us almost what we need...

Signed-off-by: Neil Brown <neilb@suse.de>
2006-06-02 01:49:00 +00:00
Neil Brown 9fca7d6236 check return status of all write/fwrite functions as required by glibc 2.4
From: Luca Berra <bluca@vodka.it>

glibc 2.4 is pedantic on ignoring return values from fprintf, fwrite and
write, so now we check the rval and actually do something with it.
in the Grow.c case i only print a warning, since i don't think we can do
anything in case we fail invalidating those superblocks (is should never
happen, but then...)

Signed-off-by: Neil Brown <neilb@suse.de>
2006-05-29 02:06:32 +00:00
Neil Brown 280a927d3d Uclibc has deprecated 'random' so use 'rand' instead.
glibc says of rand

       Do not use this function in applications  intended  to  be
       portable when good randomness is needed.

Go figure...

Signed-off-by: Neil Brown <neilb@suse.de>
2006-05-29 02:06:32 +00:00
Neil Brown b56c363090 add CFLAGS to mdassemble build and fix a couple of non-returning functions
pass CFLAGS to mdassemble build, enabling -Wall -Werror showed some
issues also fixed by the patch.

From: Luca Berra <bluca@vodka.it>
Signed-off-by: Neil Brown <neilb@suse.de>
2006-05-29 02:06:32 +00:00
Neil Brown 589395d696 Support --auto-update-homehost
This can be used to bootstrape homehost tagging.

If no arrays are found that are tagged, we look for any array
and tag it.

Signed-off-by: Neil Brown <neilb@suse.de>
2006-05-26 04:16:07 +00:00
Neil Brown 83b6208e89 When assembly arrays using incomplete detail, prefer arrays built for this host.
i.e. if assembling with --name or --super-minor, then if we find two
different arrays with the same apparent identity, and one was built
for 'this' host, then prefer that one instead of giving up in disgust.

Signed-off-by: Neil Brown <neilb@suse.de>
2006-05-23 06:33:28 +00:00
Neil Brown 811e6cbed7 Reorganise Assemble code somewhat.
We make sure all devices can are consistent before doing any --update
This saves us from updating some but not all of an array, and then
aborting.

It also means we can backtrack on out decisions, which we might want to
do later.

Signed-off-by: Neil Brown <neilb@suse.de>
2006-05-23 06:12:40 +00:00
Neil Brown e5eac01f3d Make sure homehost is set correctly when --update=uuid
Signed-off-by: Neil Brown <neilb@suse.de>
2006-05-23 04:51:39 +00:00
Neil Brown a1cbd7d053 Include homehost information in --examine as appropriate
Signed-off-by: Neil Brown <neilb@suse.de>
2006-05-19 07:19:04 +00: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 05697ec1e2 Make homehost information appear in superblock.
When an array is created, if the homehost is know,
the superblock gets it, either in the uuid, (via sha1)
or in the name field.

Signed-off-by: Neil Brown <neilb@suse.de>
2006-05-19 06:56:06 +00:00
Neil Brown 997aed5dee Allow homehost to be set on command line or in config file
Signed-off-by: Neil Brown <neilb@suse.de>
2006-05-19 05:50:08 +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 f1ae21c411 Arrange the 'auto' setting in mdadm.conf can choose default type.
So when you say auto=md or auto=part in mdadm.conf, it give a preference
for type of array, but standard name will override.

But --auto=md is more insistant.

FIXME  I'm not at all happy about handling of names that already exist.
  I don't think that should be removed if the device is active.

Signed-off-by: Neil Brown <neilb@suse.de>
2006-05-16 07:35:06 +00:00