+++ /dev/null
-\f
-Assemble.c,22
-int Assemble(\7f34,1176
-\f
-Build.c,100
-#define REGISTER_DEV \7f32,1140
-#define START_MD \7f33,1181
-#define STOP_MD \7f34,1222
-int Build(\7f36,1264
-\f
-COPYING,99
-program will \7fwill\ 152,2561
-program proprietary.\7fproprietary\ 153,2632
-PROGRAM PROVE \7fPROVE\ 1267,14397
-\f
-ChangeLog,294
- - When --assemble --force,\7f13,443
- - When marking drives as not-failed in the superblock,\7f16,627
- are passed as unsigned lock,\7f23,1044
- - If HOT_ADD_DISK failes for -a,\7f24,1100
- if we cannot read from the array,\7f25,1166
- and mdctl.conf compatible description with uuid=\7f31,1443
-\f
-Create.c,20
-int Create(\7f34,1176
-\f
-Detail.c,20
-int Detail(\7f34,1176
-\f
-Examine.c,21
-int Examine(\7f38,1285
-\f
-Kill.c,18
-int Kill(\7f37,1237
-\f
-Makefile,12
-CC \7f30,1091
-\f
-Manage.c,161
-#define REGISTER_DEV \7f34,1176
-#define START_MD \7f35,1217
-#define STOP_MD \7f36,1258
-int Manage_ro(\7f38,1300
-int Manage_runstop(\7f75,2154
-int Manage_subdevs(\7f118,3161
-\f
-Monitor.c,49
-int Monitor(\7f37,1283
-static void alert(\7f175,4727
-\f
-ReadMe.c,266
-char Version[\7f32,1140
-char short_options[\7f81,3226
-struct option long_options[\7f82,3290
-char Usage[\7f140,4885
-char Help[\7f145,4942
-char Help_create[\7f218,8393
-char Help_build[\7f245,9615
-char Help_assemble[\7f258,10155
-mapping_t r5layout[\7f317,13101
-mapping_t pers[\7f331,13317
-\f
-TODO,590
-* write proc.c to parse /proc/mdstat file,\7f5,65
- Build list of arrays: name,\7f6,140
-* --detail --scan to read mdctl.conf,\7f8,189
-* --detail --scan to read mdctl.conf, and then iterate over these,\7f8,189
-- set md_minor,\7f34,933
-- for create raid5,\7f35,976
- all working,\7f36,1019
- one missing,\7f37,1050
- one missing, one spare,\7f37,1050
-- when RUN_ARRAY,\7f40,1152
-- get --detail to extract extra stuff from superblock,\7f42,1206
-- when --assemble --scan,\7f48,1368
-- when --assemble --scan, if an underlying device is an md device,\7f48,1368
-ARRAY lines in config file to have super_minor=\7f62,1797
-\f
-config.c,479
-char DefaultConfFile[\7f68,2401
-char *keywords[\7f70,2446
-int match_keyword(\7f77,2645
-char *conf_word(\7f97,3153
-char *conf_line(\7f163,4744
-void free_line(\7f184,5046
-struct conf_dev \7fconf_dev\ 1195,5188
-} *cdevlist \7f198,5249
-int devline(\7f202,5272
-mddev_ident_t mddevlist \7f220,5595
-mddev_ident_t *mddevlp \7f221,5627
-void arrayline(\7f223,5665
-int loaded \7f303,7978
-void load_conffile(\7f305,7995
-mddev_ident_t conf_get_ident(\7f338,8486
-mddev_dev_t conf_get_devs(\7f348,8688
-int match_oneof(\7f383,9316
-\f
-dlink.c,177
-void *dl_head(\7f11,180
-void dl_free(\7f20,289
-void dl_init(\7f26,363
-void dl_insert(\7f32,430
-void dl_add(\7f40,598
-void dl_del(\7f48,763
-char *dl_strndup(\7f57,969
-char *dl_strdup(\7f73,1176
-\f
-dlink.h,193
-struct __dl_head\7f__dl_head\ 15,100
-#define dl_alloc(\7fdl_alloc\ 111,187
-#define dl_new(\7fdl_new\ 112,297
-#define dl_newv(\7fdl_newv\ 113,341
-#define dl_next(\7fdl_next\ 115,391
-#define dl_prev(\7fdl_prev\ 116,461
-\f
-makedist,127
-target=\7f3,11
-( cd .. ; ln -s mdctl mdctl-$version \7f19,352
-( cd .. ; ln -s mdctl mdctl-$version ; tar czhvf - --exclude=\7f19,352
-\f
-md_p.h,1316
-#define _MD_P_H\7f16,582
-#define MD_RESERVED_BYTES \7f44,1414
-#define MD_RESERVED_SECTORS \7f45,1453
-#define MD_RESERVED_BLOCKS \7f46,1508
-#define MD_NEW_SIZE_SECTORS(\7fMD_NEW_SIZE_SECTORS\ 148,1570
-#define MD_NEW_SIZE_BLOCKS(\7fMD_NEW_SIZE_BLOCKS\ 149,1659
-#define MD_SB_BYTES \7f51,1746
-#define MD_SB_WORDS \7f52,1773
-#define MD_SB_BLOCKS \7f53,1813
-#define MD_SB_SECTORS \7f54,1863
-#define MD_SB_GENERIC_OFFSET \7f59,1960
-#define MD_SB_PERSONALITY_OFFSET \7f60,1992
-#define MD_SB_DISKS_OFFSET \7f61,2028
-#define MD_SB_DESCRIPTOR_OFFSET \7f62,2060
-#define MD_SB_GENERIC_CONSTANT_WORDS \7f64,2098
-#define MD_SB_GENERIC_STATE_WORDS \7f65,2138
-#define MD_SB_GENERIC_WORDS \7f66,2175
-#define MD_SB_PERSONALITY_WORDS \7f67,2263
-#define MD_SB_DESCRIPTOR_WORDS \7f68,2299
-#define MD_SB_DISKS \7f69,2334
-#define MD_SB_DISKS_WORDS \7f70,2359
-#define MD_SB_RESERVED_WORDS \7f71,2423
-#define MD_SB_EQUAL_WORDS \7f72,2553
-#define MD_DISK_FAULTY \7f77,2691
-#define MD_DISK_ACTIVE \7f78,2752
-#define MD_DISK_SYNC \7f79,2814
-#define MD_DISK_REMOVED \7f80,2878
-typedef struct mdp_device_descriptor_s \7fmdp_device_descriptor_s\ 182,2946
-} mdp_disk_t;\7fmdp_disk_t\ 189,3310
-#define MD_SB_MAGIC \7f91,3325
-#define MD_SB_CLEAN \7f96,3390
-#define MD_SB_ERRORS \7f97,3413
-typedef struct mdp_superblock_s \7fmdp_superblock_s\ 199,3438
-} mdp_super_t;\7fmdp_super_t\ 1164,5835
-static inline __u64 md_event(\7f166,5851
-\f
-md_u.h,1118
-#define _MD_U_H\7f16,590
-#define RAID_VERSION \7f21,634
-#define GET_ARRAY_INFO \7f22,693
-#define GET_DISK_INFO \7f23,757
-#define PRINT_RAID_DEBUG \7f24,819
-#define RAID_AUTORUN \7f25,865
-#define CLEAR_ARRAY \7f28,929
-#define ADD_NEW_DISK \7f29,971
-#define HOT_REMOVE_DISK \7f30,1032
-#define SET_ARRAY_INFO \7f31,1078
-#define SET_DISK_INFO \7f32,1142
-#define WRITE_RAID_INFO \7f33,1186
-#define UNPROTECT_ARRAY \7f34,1232
-#define PROTECT_ARRAY \7f35,1278
-#define HOT_ADD_DISK \7f36,1322
-#define SET_DISK_FAULTY \7f37,1365
-#define RUN_ARRAY \7f40,1424
-#define START_ARRAY \7f41,1478
-#define STOP_ARRAY \7f42,1520
-#define STOP_ARRAY_RO \7f43,1561
-#define RESTART_ARRAY_RW \7f44,1605
-typedef struct mdu_version_s \7fmdu_version_s\ 146,1652
-} mdu_version_t;\7fmdu_version_t\ 150,1724
-typedef struct mdu_array_info_s \7fmdu_array_info_s\ 152,1742
-} mdu_array_info_t;\7fmdu_array_info_t\ 183,2516
-typedef struct mdu_disk_info_s \7fmdu_disk_info_s\ 185,2537
-} mdu_disk_info_t;\7fmdu_disk_info_t\ 195,2693
-typedef struct mdu_start_info_s \7fmdu_start_info_s\ 197,2713
-} mdu_start_info_t;\7fmdu_start_info_t\ 1106,2857
-typedef struct mdu_param_s\7fmdu_param_s\ 1108,2878
-} mdu_param_t;\7fmdu_param_t\ 1113,3014
-\f
-mdctl.8,252
-real block devices. This allows multiple devices \7f14,241
-{left,right}-{,a}symmetric,\7f185,4006
-{left,right}-{,a}symmetric, la,\7f185,4006
-{left,right}-{,a}symmetric, la, ra,\7f185,4006
-{left,right}-{,a}symmetric, la, ra, ls,\7f185,4006
-.BR --layout=\7f188,4087
-\f
-mdctl.c,64
-int open_mddev(\7f33,1158
-int main(\7f50,1477
-#define O(\7fO\ 1177,4288
-\f
-mdctl.h,855
-#define __USE_LARGEFILE64\7f30,1120
-#define MD_MAJOR \7f47,1496
-#define Name \7f52,1536
-extern char short_options[\7f54,1558
-extern struct option long_options[\7f55,1587
-extern char Version[\7f56,1624
-extern char Version[], Usage[\7f56,1624
-extern char Version[], Usage[], Help[\7f56,1624
-extern char Version[], Usage[], Help[], Help_create[\7f56,1624
-extern char Version[], Usage[], Help[], Help_create[], Help_build[\7f56,1624
-extern char Version[], Usage[], Help[], Help_create[], Help_build[], Help_assemble[\7f56,1624
-typedef struct mddev_ident_s \7fmddev_ident_s\ 168,2060
-} *mddev_ident_t;\7fmddev_ident_t\ 183,2389
-typedef struct mddev_dev_s \7fmddev_dev_s\ 186,2456
-} *mddev_dev_t;\7fmddev_dev_t\ 192,2644
-typedef struct mapping \7fmapping\ 194,2661
-} mapping_t;\7fmapping_t\ 197,2709
-#define Sendmail \7f100,2740
-extern mapping_t r5layout[\7f105,2884
-extern mapping_t r5layout[], pers[\7f105,2884
-\f
-mdctl.spec,235
-Summary: mdctl is used for controlling Linux md devices \7f1,0
-option of using a configuration file,\7f18,630
-raidtools uses a configuration file to describe how to create a RAID array,\7f21,718
-Further,\7f23,871
-stopping a raid array,\7f24,941
-\f
-raid5extend.c,39
-int phys2log(\7f2,1
-raid5_extend(\7f46,902
-\f
-util.c,600
-int parse_uuid(\7f40,1359
-int md_get_version(\7f82,2122
-int get_linux_version(\7f101,2481
-int enough(\7f113,2678
-int same_uuid(\7f129,2928
-void uuid_from_super(\7f139,3057
-int compare_super(\7f153,3334
-int load_super(\7f187,4297
-int store_super(\7f227,4955
-int check_ext2(\7f253,5326
-int check_reiser(\7f284,6089
-int check_raid(\7f308,6645
-int ask(\7f324,7008
-char *map_num(\7f344,7373
-int map_name(\7f354,7508
-struct devmap \7fdevmap\ 1369,7837
-} *devlist \7f373,7916
-int devlist_ready \7f374,7935
-#define __USE_XOPEN_EXTENDED\7f376,7959
-int add_dev(\7f380,8008
-char *map_dev(\7f396,8375
-int calc_sb_csum(\7f412,8650
-char *human_size(\7f428,9046
.\" -*- nroff -*-
-.TH MDADM 8
+.TH MDADM 8 "" v1.1.0
.SH NAME
mdadm \- manage MD devices
.I aka
(striping),
.B RAID1
(mirroring),
-.B RAID4
+.BR RAID4 ,
+.BR RAID5 ,
and
-.B RAID5.
-
-Recent kernels (2002) also support a mode known as
.BR MULTIPATH .
-.B mdadm
-only provides limited support for MULTIPATH as yet.
+
+.B MULTIPATH is not a Software RAID mechanism, but does involve
+multiple devices. For
+.B MULTIPATH
+each device is a path to one common physical storage device.
+
.B mdadm
is a program that can be used to create, manage, and monitor
and will read
.B /proc/partitions
to find a list of devices to scan.
+If the word
+.B none
+is given for the config file, then
+.I mdadm
+will act as though the config file were empty.
.TP
.BR -s ", " --scan
Specify the number of active devices in the array. This, plus the
number of spare devices (see below) must equal the number of
.I component-devices
-(including
-.B missing
-devices) that are listed on the command line.
+(including "\fBmissing\fP" devices)
+that are listed on the command line.
.TP
.BR -x ", " --spare-devices=
/dev/md1, then all superblocks will contain the minor number 1, even if
the array is later assembled as /dev/md2.
+Giving the literal word "dev" for
+.B --super-minor
+will cause
+.I mdadm
+to use the minor number of the md device that is being assembled.
+e.g. when assembling
+.BR /dev/md0 ,
+.M --super-minor=dev
+will look for super blocks with a minor number of 0.
+
.TP
.BR -f ", " --force
Assemble the array even if some superblocks appear out-of-date
polls the md arrays and then waits this many seconds before polling
again. The default is 60 seconds.
+.TP
+.BR -f ", " --daemonise
+Tell
+.B mdadm
+to run as a background daemon if it decides to monitor anything. This
+causes it to fork and run in the child, and to disconnect form the
+terminal. The process id of the child is written to stdout.
+This is useful with
+.B --scan
+which will only continue monitoring if a mail address or alert program
+is found in the config file.
+
.SH ASSEMBLE MODE
.HP 12
In the third (where no devices are listed) all md devices that are
listed in the configuration file are assembled.
+If precisely one device is listed, but
+.B --scan
+is not given, that
+.I mdadm
+acts as though
+.B --scan
+was given and identify information is extracted from the configuration file.
+
The identity can be given with the
.B --uuid
option, with the
The config file is only used if explicitly named with
.B --config
-or requested with
+or requested with (a possibly implicit)
.B --scan.
In the later case,
.B /etc/mdadm.conf
can override this caution.
To create a "degraded" array in which some devices are missing, simply
-give the word
-.B missing
+give the word "\fBmissing\fP"
in place of a device name. This will cause
.B mdadm
to leave the corresponding slot in the array empty.
For a RAID4 or RAID5 array at most one slot can be
-.BR missing .
+"\fBmissing\fP".
For a RAID1 array, only one real device needs to be given. All of the
others can be
-.BR missing .
+"\fBmissing\fP".
'''If the
'''.B --size
.B /dev/md0
out of all such devices with a RAID superblock with a minor number of 0.
+.B " mdadm --monitor --scan --daemonise > /var/run/mdadm"
+.br
+If config file contains a mail address or alert program, run mdadm in
+the background in monitor mode monitoring all md devices. Also write
+pid of mdadm daemon to
+.BR /var/run/mdadm .
+
.B " mdadm --create --help"
.br
Providew help about the Create mode.
char *mailaddr = NULL;
char *program = NULL;
int delay = 0;
+ int daemonise = 0;
int mdfd = -1;
continue;
case O(ASSEMBLE,'m'): /* super-minor for array */
- if (ident.super_minor >= 0) {
+ if (ident.super_minor != -1) {
fprintf(stderr, Name ": super-minor cannot be set twice. "
"Second value: %s.\n", optarg);
exit(2);
}
- ident.super_minor = strtoul(optarg, &cp, 10);
- if (!optarg[0] || *cp) {
- fprintf(stderr, Name ": Bad super-minor number: %s.\n", optarg);
- exit(2);
+ if (strcmp(optarg, "dev")==0)
+ ident.super_minor = -2;
+ else {
+ ident.super_minor = strtoul(optarg, &cp, 10);
+ if (!optarg[0] || *cp) {
+ fprintf(stderr, Name ": Bad super-minor number: %s.\n", optarg);
+ exit(2);
+ }
}
continue;
}
}
continue;
+ case O(MONITOR,'f'): /* daemonise */
+ daemonise = 1;
+ continue;
/* now the general management options. Some are applicable
mdfd = open_mddev(devlist->devname);
if (mdfd < 0)
exit(1);
+ if (ident.super_minor == -2) {
+ struct stat stb;
+ fstat(mdfd, &stb);
+ ident.super_minor = MINOR(stb.st_rdev);
+ }
}
rv = 0;
rv = Manage_runstop(devlist->devname, mdfd, runstop);
break;
case ASSEMBLE:
- if (!scan)
+ if (devs_found == 1 && ident.uuid_set == 0 &&
+ ident.super_minor == -1 && !scan ) {
+ /* Only a device has been given, so get details from config file */
+ mddev_ident_t array_ident = conf_get_ident(configfile, devlist->devname);
+ mdfd = open_mddev(devlist->devname);
+ if (mdfd < 0)
+ rv |= 1;
+ else {
+ if (array_ident == NULL) {
+ fprintf(stderr, Name ": %s not identified in config file.\n",
+ devlist->devname);
+ rv |= 1;
+ }
+ else
+ rv |= Assemble(devlist->devname, mdfd, array_ident, configfile,
+ NULL,
+ readonly, runstop, update, verbose, force);
+ }
+ } else if (!scan)
rv = Assemble(devlist->devname, mdfd, &ident, configfile,
devlist->next,
readonly, runstop, update, verbose, force);
}
break;
case MONITOR:
-/*
if (!devlist && !scan) {
fprintf(stderr, Name ": Cannot monitor: need --scan or at least one device\n");
rv = 1;
break;
}
-*/ rv= Monitor(devlist, mailaddr, program,
- delay?delay:60, scan, configfile);
+ rv= Monitor(devlist, mailaddr, program,
+ delay?delay:60, daemonise, scan, configfile);
break;
}
exit(rv);