summaryrefslogtreecommitdiffstats
path: root/Create.c
Commit message (Collapse)AuthorAgeFilesLines
* Allow creation of a RAID6 with a single missing device.Neil Brown2008-04-281-2/+18
| | | | | | | | This did not work before as we couldn't mark it clean as there would be some parity blocks out of sync, and raid6 will not assemble a dirty degraded array. So make such arrays doubly degraded (the last device becomes a spare) and clean.
* Use 'mdinfo' instead of special 'sysdev' structure.Neil Brown2007-12-141-38/+38
| | | | | there is needless duplicatiion between mdinfo and sysdev, so discard the latter.
* Drop the superblock arg from all metadata methods.Neil Brown2007-12-141-8/+8
| | | | It is now in the 'supertype'
* Add 'supertype' arg to almost all metadata methods.Neil Brown2007-12-141-4/+4
| | | | The 'superblock' will be moved into this structure soon.
* Allow metadata handlers to free their own superblock.Neil Brown2007-12-141-2/+2
| | | | | | As the metadata handler allocates the superblock, it should free it too. DDF will have a more complex 'superblock' which needs more complex freeing.
* Remove spaces/tabs from ends of lines.Neil Brown2007-12-141-3/+3
|
* A recent patch broke --create --level=faulty - fix it.Neil Brown2007-11-291-0/+1
| | | | Thanks to Martin Bene.
* Add some extra consistency checks based on level.Neil Brown2007-10-171-2/+17
| | | | Also use LEVEL_LINEAR, LEVEL_MULTIPATH in place of -1 or -4 in a few places.
* Create.c s/major/major_num/maximilian attems2007-09-241-4/+4
| | | | | | | don't shadow the major() function by int major. Signed-off-by: maximilian attems <max@stro.at> Signed-off-by: Neil Brown <neilb@suse.de>
* Enhance raid4 support: --assemble and --monitor wasn't quite happy with it.Doug Ledford2007-07-091-2/+3
| | | | | | | | | | | | | | | | | | | | | | | From: Doug Ledford <dledford@redhat.com> This one actually does a couple things. Mainly related to raid4, but kinda touches other raid levels some. When creating a raid4 array, treat it like a raid5 array in that we create it in degraded mode by default and add the last disk as a spare. Besides speeding things up, this has a second effect that it makes mdadm more consistent. In order to create a degraded raid5 array, you need only passing missing as one of the devices. For a degraded raid4 array, prior to this patch, you must pass assume-clean or else it refuses to create the array. Even force won't make it work without assume-clean. With the patch, raid4 behaves identical to raid5. Separate from that, the monitor functionality completely ignores raid4 arrays. That seems to stem from the code that checks to see if the array is part of a long list of types. It seems easier to check which array types *aren't* redundant instead of listing the ones that are redundant and missing some of them. This makes the monitor service actually watch raid4 arrays.
* Improve error message when trying to create an array that already exists.Doug Ledford2007-07-091-1/+11
| | | | | | | | | From: Doug Ledford <dledford@redhat.com> Simple bugfix. If an array already exists and we are asked to create this array, error out with an error message that makes sense to people instead of an error that the SET_ARRAY_INFO ioctl had an invalid argument. Plus a typo correction.
* Improve error message for adding bitmap to a level that cannot support it.Neil Brown2007-05-211-5/+5
| | | | Also give error on --build if no devices given.
* Support --uuid= with --create to choose your own UUID.Neil Brown2006-12-141-2/+2
|
* Central calls to ioctl BLKGETSIZENeil Brown2006-12-141-13/+1
| | | | Instead of opencoding the same thing everywhere.
* Improve allocation and use of space for bitmaps in version1 metadataNeil Brown2006-12-141-1/+2
| | | | | | | | | | 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.
* Fix bugs related to raid10 and the new offset layout.Neil Brown2006-10-191-1/+1
| | | | | Need to mask of bits above the bottom 16 when calculating number of copies.
* Remove partitions from components of an md arrayNeil Brown2006-10-131-0/+1
| | | | They do nothing but cause confusion.
* Minor improvement in name auto-chosen for version-1 superblocks.Neil Brown2006-08-111-1/+8
| | | | | /dev/md_d0 should have name 'd0' by default to make /dev/md/d0.
* Tidyup automatic name choice for v-1 arraysNeil Brown2006-08-071-2/+9
| | | | /dev/md_d0 now becomes '0', not '_d0'.
* More consistent honoring of --configfileNeil Brown2006-06-261-1/+1
| | | | | Never use /etc/mdadm.conf if --config file is given (previously some code used one, some used the other).
* Allow default metadata to be specified in mdadm.confNeil Brown2006-06-021-0/+5
| | | | | | | CREATE metadata=1 in mdadm.conf will cause version-1 superblocks to be the default. Signed-off-by: Neil Brown <neilb@suse.de>
* Set default name for v1 array based on device name.Neil Brown2006-05-261-0/+11
| | | | Signed-off-by: Neil Brown <neilb@suse.de>
* Make homehost information appear in superblock.Neil Brown2006-05-191-2/+2
| | | | | | | | 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>
* Just updaqte copyright dates and email addressNeil Brown2006-05-191-1/+1
| | | | Signed-off-by: Neil Brown <neilb@suse.de>
* Limit size of bitmap to 2million chunks.Neil Brown2006-05-151-3/+0
| | | | | | | | When creating a file bitmap, choose a default size that results in fewer than 2^21 chunks. Without this kmalloc failure in the kernel becomes likely. Signed-off-by: Neil Brown <neilb@suse.de>
* Kill old superblocks on create.Neil Brown2006-03-281-0/+2
| | | | | | | Make sure old-version superblocks are not around to confuse anything when a new array is created. Signed-off-by: Neil Brown <neilb@suse.de>
* Prefer version-1 superblocks for v.large devices.Neil Brown2006-01-311-0/+21
| | | | Signed-off-by: Neil Brown <neilb@suse.de>
* Enable support for v.large raid1.Neil Brown2006-01-271-10/+10
| | | | | | | clean up 'long long' usage for size of array, so that with v-1 superblocks a raid1 larger than 2TB is possible. Signed-off-by: Neil Brown <neilb@suse.de>
* Minor fixesNeil Brown2006-01-271-0/+2
| | | | Signed-off-by: Neil Brown <neilb@suse.de>
* Assorted fixes...Neil Brown2006-01-271-1/+1
| | | | Signed-off-by: Neil Brown <neilb@suse.de>
* uhm.. assort fixes, particularly for recovery offset...Neil Brown2005-12-161-0/+4
| | | | Signed-off-by: Neil Brown <neilb@suse.de>
* Support --assume-clean for --createNeil Brown2005-12-051-2/+4
| | | | Signed-off-by: Neil Brown <neilb@suse.de>
* Support bitmaps with raid10Neil Brown2005-11-221-2/+14
| | | | | | And a couple of other little things Signed-off-by: Neil Brown <neilb@suse.de>
* Create version-4 bitmaps if kernel supports it.Neil Brown2005-10-111-5/+15
| | | | | | | Version-3 bitmaps are host-endian. Version-4 are little-endian and so more portable. Signed-off-by: Neil Brown <neilb@suse.de>
* Passes all tests, nearly ready for release.Neil Brown2005-08-261-3/+3
| | | | Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
* Support internal bitmaps with format-1 superblocks.Neil Brown2005-08-251-3/+3
| | | | Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
* Add test for multipath and make it work.Neil Brown2005-08-161-1/+1
| | | | Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
* Add 'quite' option and tidy up some tests.Neil Brown2005-08-151-13/+17
| | | | Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
* Support nameing of version-1 arrays.Neil Brown2005-08-091-1/+2
| | | | | | | --name is recognised in --create and --assemble name= is recognised in config file. Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
* Add write-behind supportNeil Brown2005-08-091-5/+10
| | | | | | | | 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>
* Retry --stop --scan until all stoppable devices have been stoppedNeil Brown2005-06-141-1/+1
| | | | | | This is needed to reliably stop stacked arrays Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
* Make --zero-superblock work for version 1 superblocks.Neil Brown2005-06-071-1/+1
| | | | | | This requires passing the supertype to store_super Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
* Add support for internal bitmapsNeil Brown2005-06-071-1/+20
| | | | | | For version 0.90 superblocks, an internal bitmap can be specified at create. Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
* Fix create bug which initialised superblocks wrongly.Neil Brown2005-06-071-1/+1
| | | | | | Description... Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
* Initial bitmap supportNeil Brown2005-06-071-1/+23
| | | | Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
* Release 1.8.1 after some man page updates and other fixes.mdadm-1.11.1Neil Brown2005-06-071-2/+2
| | | | Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
* super1Neil Brown2005-05-031-19/+28
| | | | | | | 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>
* Add a 'super-switch' so that different format superblocks can be used.Neil Brown2005-05-031-4/+4
| | | | | | | | 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>
* Separate sueprblock handling into separate fileNeil Brown2005-05-031-37/+58
| | | | Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
* Use O_EXCL when opening component devices to be assembled into an arrayNeil Brown2005-04-041-2/+2
| | | | | | | In 2.6, this will fail if the device is already in use, so we can detect this error more easily. Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>