diff options
163 files changed, 5700 insertions, 5349 deletions
diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 5d425843..00000000 --- a/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -debian/changelog merge=dpkg-mergechangelogs diff --git a/ANNOUNCE-3.3.3 b/ANNOUNCE-3.3.3 new file mode 100644 index 00000000..ac1b2173 --- /dev/null +++ b/ANNOUNCE-3.3.3 @@ -0,0 +1,18 @@ +Subject: ANNOUNCE: mdadm 3.3.3 - A tool for managing md Soft RAID under Linux + +I am pleased to announce the availability of + mdadm version 3.3.3 + +It is available at the usual places: + http://www.kernel.org/pub/linux/utils/raid/mdadm/ +and via git at + git://github.com/neilbrown/mdadm + git://neil.brown.name/mdadm + http://git.neil.brown.name/git/mdadm.git + +The 100 changes since 3.3.3 are mostly little bugfixes and some improvements +to the selftests. +raid6check now handle all RAID6 layouts including DDF correctly. +See git log for the rest. + +NeilBrown 24th July 2015 diff --git a/ANNOUNCE-3.3.4 b/ANNOUNCE-3.3.4 new file mode 100644 index 00000000..52b94562 --- /dev/null +++ b/ANNOUNCE-3.3.4 @@ -0,0 +1,37 @@ +Subject: ANNOUNCE: mdadm 3.3.4 - A tool for managing md Soft RAID under Linux + +I am somewhat disappointed to have to announce the availability of + mdadm version 3.3.4 + +It is available at the usual places: + http://www.kernel.org/pub/linux/utils/raid/mdadm/ +and via git at + git://github.com/neilbrown/mdadm + git://neil.brown.name/mdadm + http://git.neil.brown.name/git/mdadm.git + +In mdadm-3.3 a change was made to how IMSM (Intel Matrix Storage +Manager) metadata was handled. Previously an IMSM array would only +be assembled if it was attached to an IMSM controller. + +In 3.3 this was relaxed as there are circumstances where the +controller is not properly detected. Unfortunately this has negative +consequences which have only just come to light. + +If you have an IMSM RAID1 configured and then disable RAID in the +BIOS, the metadata will remain on the devices. If you then install +some other OS on one device and then install Linux on the other, Linux +might eventually start noticing the IMSM metadata (depending a bit on whether +mdadm is included in the initramfs) and might start up the RAID1. This could +copy one device over the other, thus trashing one of the installations. + +Not good. + +So with this release IMSM arrays will only be assembled if attached to +an IMSM controller, or if "--force" is given to --assemble, or if the +environment variable IMSM_NO_PLATFORM is set (used primarily for +testing). + +I strongly recommend upgrading to 3.3.4 if you are using 3.3 or later. + +NeilBrown 3rd August 2015. diff --git a/ANNOUNCE-3.4 b/ANNOUNCE-3.4 new file mode 100644 index 00000000..2689732d --- /dev/null +++ b/ANNOUNCE-3.4 @@ -0,0 +1,24 @@ +Subject: ANNOUNCE: mdadm 3.4 - A tool for managing md Soft RAID under Linux + +I am pleased to announce the availability of + mdadm version 3.4 + +It is available at the usual places: + http://www.kernel.org/pub/linux/utils/raid/mdadm/ +and via git at + git://github.com/neilbrown/mdadm + git://neil.brown.name/mdadm + http://git.neil.brown.name/git/mdadm + +The new second-level version number reflects significant new +functionality, particular support for journalled RAID5/6 and clustered +RAID1. This new support is probably still buggy. Please report bugs. + +There are also a number of fixes for Intel's IMSM metadata support, +and an assortment of minor bug fixes. + +I plan for this to be the last release of mdadm that I provide as I am +retiring from MD and mdadm maintenance. Jes Sorensen has volunteered +to oversee mdadm for the next while. Thanks Jes! + +NeilBrown 28th January 2016 @@ -1,7 +1,7 @@ /* * mdadm - manage Linux "md" devices aka RAID arrays. * - * Copyright (C) 2001-2013 Neil Brown <neilb@suse.de> + * Copyright (C) 2001-2016 Neil Brown <neilb@suse.com> * * * This program is free software; you can redistribute it and/or modify @@ -25,21 +25,27 @@ #include "mdadm.h" #include <ctype.h> -static int name_matches(char *found, char *required, char *homehost) +static int name_matches(char *found, char *required, char *homehost, int require_homehost) { /* See if the name found matches the required name, possibly * prefixed with 'homehost' */ - char fnd[33]; + char *sep; + unsigned int l; - strncpy(fnd, found, 32); - fnd[32] = 0; if (strcmp(found, required)==0) return 1; - if (homehost) { - int l = strlen(homehost); - if (l < 32 && fnd[l] == ':' && - strcmp(fnd+l+1, required)==0) + sep = strchr(found, ':'); + if (!sep) + return 0; + l = sep - found; + if (strncmp(found, "any:", 4) == 0 || + (homehost && strcmp(homehost, "any") == 0) || + !require_homehost || + (homehost && strlen(homehost) == l && + strncmp(found, homehost, l) == 0)) { + /* matching homehost */ + if (strcmp(sep+1, required) == 0) return 1; } return 0; @@ -73,7 +79,7 @@ static int is_member_busy(char *metadata_version) static int ident_matches(struct mddev_ident *ident, struct mdinfo *content, struct supertype *tst, - char *homehost, + char *homehost, int require_homehost, char *update, char *devname) { @@ -85,7 +91,7 @@ static int ident_matches(struct mddev_ident *ident, return 0; } if (ident->name[0] && (!update || strcmp(update, "name")!= 0) && - name_matches(content->name, ident->name, homehost)==0) { + name_matches(content->name, ident->name, homehost, require_homehost)==0) { if (devname) pr_err("%s has wrong name.\n", devname); return 0; @@ -233,8 +239,7 @@ static int select_devices(struct mddev_dev *devlist, !conf_test_metadata(tst->ss->name, (pol = devid_policy(stb.st_rdev)), tst->ss->match_home(tst, c->homehost) == 1)) { if (report_mismatch) - pr_err("%s has metadata type %s for which " - "auto-assembly is disabled\n", + pr_err("%s has metadata type %s for which auto-assembly is disabled\n", devname, tst->ss->name); tmpdev->used = 2; } else @@ -245,7 +250,9 @@ static int select_devices(struct mddev_dev *devlist, pr_err("no recogniseable superblock on %s\n", devname); tmpdev->used = 2; - } else if (tst->ss->load_super(tst,dfd, NULL)) { + } else if ((tst->ignore_hw_compat = 0), + tst->ss->load_super(tst, dfd, + report_mismatch ? devname : NULL)) { if (report_mismatch) pr_err("no RAID superblock on %s\n", devname); @@ -259,8 +266,7 @@ static int select_devices(struct mddev_dev *devlist, !conf_test_metadata(tst->ss->name, (pol = devid_policy(stb.st_rdev)), tst->ss->match_home(tst, c->homehost) == 1)) { if (report_mismatch) - pr_err("%s has metadata type %s for which " - "auto-assembly is disabled\n", + pr_err("%s has metadata type %s for which auto-assembly is disabled\n", devname, tst->ss->name); tmpdev->used = 2; } @@ -327,7 +333,8 @@ static int select_devices(struct mddev_dev *devlist, content = content->next) { if (!ident_matches(ident, content, tst, - c->homehost, c->update, + c->homehost, c->require_homehost, + c->update, report_mismatch ? devname : NULL)) /* message already printed */; else if (is_member_busy(content->text_version)) { @@ -350,8 +357,7 @@ static int select_devices(struct mddev_dev *devlist, st = tst; tst = NULL; if (!auto_assem && inargv && tmpdev->next != NULL) { - pr_err("%s is a container, but is not " - "only device given: confused and aborting\n", + pr_err("%s is a container, but is not only device given: confused and aborting\n", devname); st->ss->free_super(st); dev_policy_free(pol); @@ -370,7 +376,8 @@ static int select_devices(struct mddev_dev *devlist, tst->ss->getinfo_super(tst, content, NULL); if (!ident_matches(ident, content, tst, - c->homehost, c->update, + c->homehost, c->require_homehost, + c->update, report_mismatch ? devname : NULL)) goto loop; @@ -394,7 +401,8 @@ static int select_devices(struct mddev_dev *devlist, goto loop; } if (match && !ident_matches(match, content, tst, - c->homehost, c->update, + c->homehost, c->require_homehost, + c->update, report_mismatch ? devname : NULL)) /* Array exists in mdadm.conf but some * details don't match, so reject it @@ -579,13 +587,13 @@ static int load_devices(struct devs *devices, char *devmap, struct stat stb; struct supertype *tst; int i; + int dfd; if (tmpdev->used != 1) continue; /* looks like a good enough match to update the super block if needed */ #ifndef MDASSEMBLE if (c->update) { - int dfd; /* prepare useful information in info structures */ struct stat stb2; int err; @@ -629,6 +637,19 @@ static int load_devices(struct devs *devices, char *devmap, if (strcmp(c->update, "byteorder") == 0) err = 0; + else if (strcmp(c->update, "home-cluster") == 0) { + tst->cluster_name = c->homecluster; + err = tst->ss->write_bitmap(tst, dfd, NameUpdate); + } else if (strcmp(c->update, "nodes") == 0) { + tst->nodes = c->nodes; + err = tst->ss->write_bitmap(tst, dfd, NodeNumUpdate); + } else if (strcmp(c->update, "revert-reshape") == 0 && + c->invalid_backup) + err = tst->ss->update_super(tst, content, + "revert-reshape-nobackup", + devname, c->verbose, + ident->uuid_set, + c->homehost); else err = tst->ss->update_super(tst, content, c->update, devname, c->verbose, @@ -636,8 +657,7 @@ static int load_devices(struct devs *devices, char *devmap, c->homehost); if (err < 0) { if (err == -1) - pr_err("--update=%s not understood" - " for %s metadata\n", + pr_err("--update=%s not understood for %s metadata\n", c->update, tst->ss->name); tst->ss->free_super(tst); free(tst); @@ -656,7 +676,6 @@ static int load_devices(struct devs *devices, char *devmap, if (tst->ss->store_super(tst, dfd)) pr_err("Could not re-write superblock on %s.\n", devname); - close(dfd); if (strcmp(c->update, "uuid")==0 && ident->bitmap_fd >= 0 && !bitmap_done) { @@ -670,9 +689,9 @@ static int load_devices(struct devs *devices, char *devmap, } else #endif { - int dfd = dev_open(devname, - tmpdev->disposition == 'I' - ? O_RDWR : (O_RDWR|O_EXCL)); + dfd = dev_open(devname, + tmpdev->disposition == 'I' + ? O_RDWR : (O_RDWR|O_EXCL)); tst = dup_super(st); if (dfd < 0 || tst->ss->load_super(tst, dfd, NULL) != 0) { @@ -689,10 +708,10 @@ static int load_devices(struct devs *devices, char *devmap, return -1; } tst->ss->getinfo_super(tst, content, devmap + devcnt * content->array.raid_disks); - close(dfd); } - stat(devname, &stb); + fstat(dfd, &stb); + close(dfd); if (c->verbose > 0) pr_err("%s is identified as a member of %s, slot %d%s.\n", @@ -723,7 +742,7 @@ static int load_devices(struct devs *devices, char *devmap, i = devcnt; else i = devices[devcnt].i.disk.raid_disk; - if (i+1 == 0) { + if (i+1 == 0 || i == MD_DISK_ROLE_JOURNAL) { if (nextspare < content->array.raid_disks*2) nextspare = content->array.raid_disks*2; i = nextspare++; @@ -762,12 +781,9 @@ static int load_devices(struct devs *devices, char *devmap, * Could be a mis-detection caused by overlapping * partitions. fail-safe. */ - pr_err("WARNING %s and %s appear" - " to have very similar superblocks.\n" - " If they are really different, " - "please --zero the superblock on one\n" - " If they are the same or overlap," - " please remove one from %s.\n", + pr_err("WARNING %s and %s appear to have very similar superblocks.\n" + " If they are really different, please --zero the superblock on one\n" + " If they are the same or overlap, please remove one from %s.\n", devices[best[i]].devname, devname, inargv ? "the list" : "the\n DEVICE list in mdadm.conf" @@ -825,12 +841,37 @@ static int force_array(struct mdinfo *content, i < content->array.raid_disks * 2 && i < bestcnt; i += 2) { int j = best[i]; - if (j>=0 && - !devices[j].uptodate && - devices[j].i.recovery_start == MaxSector && - (chosen_drive < 0 || + if (j < 0) + continue; + if (devices[j].uptodate) + continue; + if (devices[j].i.recovery_start != MaxSector) { + int delta; + if (!devices[j].i.reshape_active || + devices[j].i.delta_disks <= 0) + continue; + /* When increasing number of devices, an + * added device also appears to be + * recovering. It is safe to include it + * as long as it won't be a source of + * data. + * For now, just allow for last data + * devices in RAID4 or last devices in RAID4/5/6. + */ + delta = devices[j].i.delta_disks; + if (devices[j].i.array.level >= 4 && + devices[j].i.array.level <= 6 && + i/2 >= content->array.raid_disks - delta) + /* OK */; + else if (devices[j].i.array.level == 4 && + i/2 >= content->array.raid_disks - delta - 1) + /* OK */; + else + continue; + } + if (chosen_drive < 0 || devices[j].i.events - > devices[chosen_drive].i.events)) + > devices[chosen_drive].i.events) chosen_drive = j; } if (chosen_drive < 0) @@ -879,7 +920,6 @@ static int force_array(struct mdinfo *content, avail[chosen_drive] = 1; okcnt++; tst->ss->free_super(tst); - /* If there are any other drives of the same vintage, * add them in as well. We can't lose and we might gain */ @@ -910,6 +950,7 @@ static int start_array(int mdfd, unsigned int okcnt, unsigned int sparecnt, unsigned int rebuilding_cnt, + unsigned int journalcnt, struct context *c, int clean, char *avail, int start_partial_ok, @@ -921,6 +962,15 @@ static int start_array(int mdfd, int i; unsigned int req_cnt; + if (content->journal_device_required && (content->journal_clean == 0)) { + if (!c->force) { + pr_err("Not safe to assemble with missing or stale journal device, consider --force.\n"); + return 1; + } + pr_err("Journal is missing or stale, starting array read only.\n"); + c->readonly = 1; + } + rv = set_array_info(mdfd, st, content); if (rv && !err_ok) { pr_err("failed to set array info for %s: %s\n", @@ -968,8 +1018,7 @@ static int start_array(int mdfd, rv = add_disk(mdfd, st, content, &devices[j].i); if (rv) { - pr_err("failed to add " - "%s to %s: %s\n", + pr_err("failed to add %s to %s: %s\n", devices[j].devname, mddev, strerror(errno)); @@ -993,14 +1042,14 @@ static int start_array(int mdfd, } else if (c->verbose > 0 && i < content->array.raid_disks*2 && (i&1) == 0) pr_err("no uptodate device for slot %d of %s\n", - i, mddev); + i/2, mddev); } if (content->array.level == LEVEL_CONTAINER) { if (c->verbose >= 0) { - pr_err("Container %s has been " - "assembled with %d drive%s", - mddev, okcnt+sparecnt, okcnt+sparecnt==1?"":"s"); + pr_err("Container %s has been assembled with %d drive%s", + mddev, okcnt+sparecnt+journalcnt, + okcnt+sparecnt+journalcnt==1?"":"s"); if (okcnt < (unsigned)content->array.raid_disks) fprintf(stderr, " (out of %d)", content->array.raid_disks); @@ -1086,6 +1135,8 @@ static int start_array(int mdfd, fprintf(stderr, "%s %d rebuilding", sparecnt?",":" and", rebuilding_cnt); if (sparecnt) fprintf(stderr, " and %d spare%s", sparecnt, sparecnt==1?"":"s"); + if (content->journal_clean) + fprintf(stderr, " and %d journal", journalcnt); fprintf(stderr, ".\n"); } if (content->reshape_active && @@ -1094,12 +1145,16 @@ static int start_array(int mdfd, /* might need to increase the size * of the stripe cache - default is 256 */ - if (256 < 4 * (content->array.chunk_size/4096)) { + int chunk_size = content->array.chunk_size; + if (content->reshape_active && + content->new_chunk > chunk_size) + chunk_size = content->new_chunk; + if (256 < 4 * ((chunk_size+4065)/4096)) { struct mdinfo *sra = sysfs_read(mdfd, NULL, 0); if (sra) sysfs_set_num(sra, NULL, "stripe_cache_size", - (4 * content->array.chunk_size / 4096) + 1); + (4 * chunk_size / 4096) + 1); sysfs_free(sra); } } @@ -1141,15 +1196,12 @@ static int start_array(int mdfd, if (!enough(content->array.level, content->array.raid_disks, content->array.layout, 1, avail)) - pr_err("Not enough devices to " - "start the array.\n"); + pr_err("Not enough devices to start the array.\n"); else if (!enough(content->array.level, content->array.raid_disks, content->array.layout, clean, avail)) - pr_err("Not enough devices to " - "start the array while not clean " - "- consider --force.\n"); + pr_err("Not enough devices to start the array while not clean - consider --force.\n"); return 1; } @@ -1174,9 +1226,7 @@ static int start_array(int mdfd, content->array.raid_disks, content->array.layout, clean, avail)) - fprintf(stderr, " - not enough to start the " - "array while not clean - consider " - "--force.\n"); + fprintf(stderr, " - not enough to start the array while not clean - consider --force.\n"); else { if (req_cnt == (unsigned)content->array.raid_disks) fprintf(stderr, " - need all %d to start it", req_cnt); @@ -1258,7 +1308,8 @@ int Assemble(struct supertype *st, char *mddev, int *best = NULL; /* indexed by raid_disk */ int bestcnt = 0; int devcnt; - unsigned int okcnt, sparecnt, rebuilding_cnt, replcnt; + unsigned int okcnt, sparecnt, rebuilding_cnt, replcnt, journalcnt; + int journal_clean = 0; int i; int was_forced = 0; int most_recent = 0; @@ -1314,7 +1365,7 @@ try_again: mddev ? mddev : "further assembly"); content = &info; - if (st) + if (st && c->force) st->ignore_hw_compat = 1; num_devs = select_devices(devlist, ident, &st, &content, c, inargv, auto_assem); @@ -1338,7 +1389,10 @@ try_again: */ if (map_lock(&map)) pr_err("failed to get exclusive lock on mapfile - continue anyway...\n"); - mp = map_by_uuid(&map, content->uuid); + if (c->update && strcmp(c->update,"uuid") == 0) + mp = NULL; + else + mp = map_by_uuid(&map, content->uuid); if (mp) { struct mdinfo *dv; /* array already exists. */ @@ -1496,6 +1550,7 @@ try_again: okcnt = 0; replcnt = 0; sparecnt=0; + journalcnt=0; rebuilding_cnt=0; for (i=0; i< bestcnt; i++) { int j = best[i]; @@ -1506,8 +1561,13 @@ try_again: /* note: we ignore error flags in multipath arrays * as they don't make sense */ - if (content->array.level != LEVEL_MULTIPATH) - if (!(devices[j].i.disk.state & (1<<MD_DISK_ACTIVE))) { + if (content->array.level != LEVEL_MULTIPATH) { + if (devices[j].i.disk.state & (1<<MD_DISK_JOURNAL)) { + if (content->journal_device_required) + journalcnt++; + else /* unexpected journal, mark as faulty */ + devices[j].i.disk.state |= (1<<MD_DISK_FAULTY); + } else if (!(devices[j].i.disk.state & (1<<MD_DISK_ACTIVE))) { if (!(devices[j].i.disk.state & (1<<MD_DISK_FAULTY))) { devices[j].uptodate = 1; @@ -1515,6 +1575,7 @@ try_again: } continue; } + } /* If this device thinks that 'most_recent' has failed, then * we must reject this device. */ @@ -1538,12 +1599,12 @@ try_again: devices[most_recent].i.events ) { devices[j].uptodate = 1; + if (devices[j].i.disk.state & (1<<MD_DISK_JOURNAL)) + journal_clean = 1; if (i < content->array.raid_disks * 2) { if (devices[j].i.recovery_start == MaxSector || (content->reshape_active && - ((i >= content->array.raid_disks - content->delta_disks) || - (i >= content->array.raid_disks - content->delta_disks - 1 - && content->array.level == 4)))) { + i >= content->array.raid_disks - content->delta_disks)) { if (!avail[i/2]) { okcnt++; avail[i/2]=1; @@ -1551,7 +1612,7 @@ try_again: replcnt++; } else rebuilding_cnt++; - } else + } else if (devices[j].i.disk.raid_disk != MD_DISK_ROLE_JOURNAL) sparecnt++; } } @@ -1611,11 +1672,15 @@ try_again: #ifndef MDASSEMBLE sysfs_init(content, mdfd, NULL); #endif + /* after reload context, store journal_clean in context */ + content->journal_clean = journal_clean; for (i=0; i<bestcnt; i++) { int j = best[i]; unsigned int desired_state; - if (i >= content->array.raid_disks * 2) + if (devices[j].i.disk.raid_disk == MD_DISK_ROLE_JOURNAL) + desired_state = (1<<MD_DISK_JOURNAL); + else if (i >= content->array.raid_disks * 2) desired_state = 0; else if (i & 1) desired_state = (1<<MD_DISK_ACTIVE) | (1<<MD_DISK_REPLACEMENT); @@ -1698,8 +1763,7 @@ try_again: int err = 0; int *fdlist = xmalloc(sizeof(int)* bestcnt); if (c->verbose > 0) - pr_err(":%s has an active reshape - checking " - "if critical section needs to be restored\n", + pr_err("%s has an active reshape - checking if critical section needs to be restored\n", chosen_name); if (!c->backup_file) c->backup_file = locate_backup(content->sys_name); @@ -1727,8 +1791,7 @@ try_again: c->backup_file, c->verbose > 0); if (err && c->invalid_backup) { if (c->verbose > 0) - pr_err("continuing" - " without restoring backup\n"); + pr_err("continuing without restoring backup\n"); err = 0; } } @@ -1764,7 +1827,7 @@ try_again: rv = start_array(mdfd, mddev, content, st, ident, best, bestcnt, chosen_drive, devices, okcnt, sparecnt, - rebuilding_cnt, + rebuilding_cnt, journalcnt, c, clean, avail, start_partial_ok, pre_exist != NULL, @@ -254,8 +254,7 @@ int Build(char *mddev, struct mddev_dev *devlist, pr_err("RUN_ARRAY failed: %s\n", strerror(errno)); if (s->chunk & (s->chunk-1)) { - cont_err("Problem may be that chunk size" - " is not a power of 2\n"); + cont_err("Problem may be that chunk size is not a power of 2\n"); } goto abort; } @@ -87,7 +87,7 @@ int Create(struct supertype *st, char *mddev, unsigned long long minsize=0, maxsize=0; char *mindisc = NULL; char *maxdisc = NULL; - int dnum; + int dnum, raid_disk_num; struct mddev_dev *dv; int fail=0, warn=0; struct stat stb; @@ -114,6 +114,8 @@ int Create(struct supertype *st, char *mddev, unsigned long long newsize; int major_num = BITMAP_MAJOR_HI; + if (s->bitmap_file && strcmp(s->bitmap_file, "clustered") == 0) + major_num = BITMAP_MAJOR_CLUSTERED; memset(&info, 0, sizeof(info)); if (s->level == UnSet && st && st->ss->default_geometry) @@ -177,15 +179,14 @@ int Create(struct supertype *st, char *mddev, close(fd); } if (st && st->ss->external && s->sparedisks) { - pr_err("This metadata type does not support " - "spare disks at create time\n"); + pr_err("This metadata type does not support spare disks at create time\n"); return 1; } - if (subdevs > s->raiddisks+s->sparedisks) { + if (subdevs > s->raiddisks+s->sparedisks+s->journaldisks) { pr_err("You have listed more devices (%d) than are in the array(%d)!\n", subdevs, s->raiddisks+s->sparedisks); return 1; } - if (!have_container && subdevs < s->raiddisks+s->sparedisks) { + if (!have_container && subdevs < s->raiddisks+s->sparedisks+s->journaldisks) { pr_err("You haven't given enough devices (real or missing) to create this array\n"); return 1; } @@ -261,8 +262,7 @@ int Create(struct supertype *st, char *mddev, if (do_default_chunk) { /* default chunk was just set */ if (c->verbose > 0) - pr_err("chunk size " - "defaults to %dK\n", s->chunk); + pr_err("chunk size defaults to %dK\n", s->chunk); s->size &= ~(unsigned long long)(s->chunk - 1); do_default_chunk = 0; } @@ -330,7 +330,7 @@ int Create(struct supertype *st, char *mddev, } close(dfd); info.array.working_disks++; - if (dnum < s->raiddisks) + if (dnum < s->raiddisks && dv->disposition != 'j') info.array.active_disks++; if (st == NULL) { struct createinfo *ci = conf_get_create_info(); @@ -375,8 +375,7 @@ int Create(struct supertype *st, char *mddev, dname, strerror(errno)); exit(2); } - pr_err("device %s not suitable " - "for any style of array\n", + pr_err("device %s not suitable for any style of array\n", dname); exit(2); } @@ -393,14 +392,16 @@ int Create(struct supertype *st, char *mddev, dname, &freesize, c->verbose >= 0)) { - pr_err("%s is not suitable for " - "this array.\n", + pr_err("%s is not suitable for this array.\n", dname); fail = 1; continue; } } + if (dv->disposition == 'j') + goto skip_size_check; /* skip write journal for size check */ + freesize /= 2; /* convert to K */ if (s->chunk && s->chunk != UnSet) { /* round to chunk size */ @@ -408,8 +409,7 @@ int Create(struct supertype *st, char *mddev, if (do_default_chunk) { /* default chunk was just set */ if (c->verbose > 0) - pr_err("chunk size " - "defaults to %dK\n", s->chunk); + pr_err("chunk size defaults to %dK\n", s->chunk); s->size &= ~(unsigned long long)(s->chunk - 1); do_default_chunk = 0; } @@ -421,8 +421,7 @@ int Create(struct supertype *st, char *mddev, } if (s->size && freesize < s->size) { - pr_err("%s is smaller than given size." - " %lluK < %lluK + metadata\n", + pr_err("%s is smaller than given size. %lluK < %lluK + metadata\n", dname, freesize, s->size); fail = 1; continue; @@ -435,6 +434,7 @@ int Create(struct supertype *st, char *mddev, mindisc = dname; minsize = freesize; } + skip_size_check: if (c->runstop != 1 || c->verbose >= 0) { int fd = open(dname, O_RDONLY); if (fd <0 ) { @@ -473,8 +473,7 @@ int Create(struct supertype *st, char *mddev, } } if (s->raiddisks + s->sparedisks > st->max_devs) { - pr_err("Too many devices:" - " %s metadata only supports %d\n", + pr_err("Too many devices: %s metadata only supports %d\n", st->ss->name, st->max_devs); return 1; } @@ -538,6 +537,8 @@ int Create(struct supertype *st, char *mddev, st->ss->name); warn = 1; } + st->nodes = c->nodes; + st->cluster_name = c->homecluster; if (warn) { if (c->runstop!= 1) { @@ -618,8 +619,7 @@ int Create(struct supertype *st, char *mddev, memset(&inf, 0, sizeof(inf)); ioctl(mdfd, GET_ARRAY_INFO, &inf); if (inf.working_disks != 0) { - pr_err("another array by this name" - " is already running.\n"); + pr_err("another array by this name is already running.\n"); goto abort_locked; } } @@ -741,8 +741,7 @@ int Create(struct supertype *st, char *mddev, mdi?mdi->text_version:"managed", devnm); sysfs_free(mdi); } else - pr_err("Defaulting to version" - " %s metadata\n", info.text_version); + pr_err("Defaulting to version %s metadata\n", info.text_version); } map_update(&map, fd2devnm(mdfd), info.text_version, @@ -759,7 +758,8 @@ int Create(struct supertype *st, char *mddev, #endif } - if (s->bitmap_file && strcmp(s->bitmap_file, "internal")==0) { + if (s->bitmap_file && (strcmp(s->bitmap_file, "internal")==0 || + strcmp(s->bitmap_file, "clustered")==0)) { if ((vers%100) < 2) { pr_err("internal bitmaps not supported by this kernel.\n"); goto abort_locked; @@ -797,14 +797,12 @@ int Create(struct supertype *st, char *mddev, */ container_fd = open_dev_excl(st->container_devnm); if (container_fd < 0) { - pr_err("Cannot get exclusive " - "open on container - weird.\n"); + pr_err("Cannot get exclusive open on container - weird.\n"); goto abort_locked; } if (mdmon_running(st->container_devnm)) { if (c->verbose) - pr_err("reusing mdmon " - "for %s.\n", + pr_err("reusing mdmon for %s.\n", st->container_devnm); st->update_tail = &st->updates; } else @@ -845,7 +843,7 @@ int Create(struct supertype *st, char *mddev, for (pass=1; pass <=2 ; pass++) { struct mddev_dev *moved_disk = NULL; /* the disk that was moved out of the insert point */ - for (dnum=0, dv = devlist ; dv ; + for (dnum=0, raid_disk_num=0, dv = devlist ; dv ; dv=(dv->next)?(dv->next):moved_disk, dnum++) { int fd; struct stat stb; @@ -854,11 +852,14 @@ int Create(struct supertype *st, char *mddev, if (dnum >= total_slots) abort(); if (dnum == insert_point) { + raid_disk_num += 1; moved_disk = dv; continue; } - if (strcasecmp(dv->devname, "missing")==0) + if (strcasecmp(dv->devname, "missing")==0) { + raid_disk_num += 1; continue; + } if (have_container) moved_disk = NULL; if (have_container && dnum < info.array.raid_disks - 1) @@ -870,8 +871,13 @@ int Create(struct supertype *st, char *mddev, *inf = info; inf->disk.number = dnum; - inf->disk.raid_disk = dnum; - if (inf->disk.raid_disk < s->raiddisks) + inf->disk.raid_disk = raid_disk_num++; + + if (dv->disposition == 'j') { + inf->disk.raid_disk = MD_DISK_ROLE_JOURNAL; + inf->disk.state = (1<<MD_DISK_JOURNAL); + raid_disk_num--; + } else if (inf->disk.raid_disk < s->raiddisks) inf->disk.state = (1<<MD_DISK_ACTIVE) | (1<<MD_DISK_SYNC); else @@ -890,8 +896,7 @@ int Create(struct supertype *st, char *mddev, fd = open(dv->devname, O_RDWR|O_EXCL); if (fd < 0) { - pr_err("failed to open %s " - "after earlier success - aborting\n", + pr_err("failed to open %s after earlier success - aborting\n", dv->devname); goto abort_locked; } @@ -928,8 +933,7 @@ int Create(struct supertype *st, char *mddev, rv = add_disk(mdfd, st, &info, inf); if (rv) { - pr_err("ADD_NEW_DISK for %s " - "failed: %s\n", + pr_err("ADD_NEW_DISK for %s failed: %s\n", dv->devname, strerror(errno)); goto abort_locked; } @@ -1007,8 +1011,7 @@ int Create(struct supertype *st, char *mddev, } sysfs_set_safemode(&info, safe_mode_delay); if (err) { - pr_err("failed to" - " activate array.\n"); + pr_err("failed to activate array.\n"); ioctl(mdfd, STOP_ARRAY, NULL); goto abort; } @@ -1029,8 +1032,7 @@ int Create(struct supertype *st, char *mddev, pr_err("RUN_ARRAY failed: %s\n", strerror(errno)); if (info.array.chunk_size & (info.array.chunk_size-1)) { - cont_err("Problem may be that " - "chunk size is not a power of 2\n"); + cont_err("Problem may be that chunk size is not a power of 2\n"); } ioctl(mdfd, STOP_ARRAY, NULL); goto abort; @@ -295,11 +295,12 @@ int Detail(char *dev, struct context *c) goto out; } - disks = xmalloc(max_disks * sizeof(mdu_disk_info_t)); - for (d = 0; d < max_disks; d++) { + disks = xmalloc(max_disks * 2 * sizeof(mdu_disk_info_t)); + for (d = 0; d < max_disks * 2; d++) { disks[d].state = (1<<MD_DISK_REMOVED); disks[d].major = disks[d].minor = 0; - disks[d].number = disks[d].raid_disk = d; + disks[d].number = -1; + disks[d].raid_disk = d/2; } next = array.raid_disks*2; @@ -325,9 +326,10 @@ int Detail(char *dev, struct context *c) && disks[disk.raid_disk*2].state == (1<<MD_DISK_REMOVED)) disks[disk.raid_disk*2] = disk; else if (disk.raid_disk >= 0 && disk.raid_disk < array.raid_disks - && disks[disk.raid_disk*2+1].state == (1<<MD_DISK_REMOVED)) + && disks[disk.raid_disk*2+1].state == (1<<MD_DISK_REMOVED) + && !(disk.state & (1<<MD_DISK_JOURNAL))) disks[disk.raid_disk*2+1] = disk; - else if (next < max_disks) + else if (next < max_disks*2) disks[next++] = disk; } @@ -339,7 +341,8 @@ int Detail(char *dev, struct context *c) (disks[d*2+1].state & (1<<MD_DISK_SYNC))) { avail_disks ++; avail[d] = 1; - } + } else + rv |= !! c->test; } if (c->brief) { @@ -422,8 +425,9 @@ int Detail(char *dev, struct context *c) else printf(" Used Dev Size : unknown\n"); } else - printf(" Used Dev Size : %d%s\n", array.size, - human_size((long long)array.size<<10)); + printf(" Used Dev Size : %lu%s\n", + (unsigned long)array.size, + human_size((unsigned long long)array.size<<10)); } if (array.raid_disks) printf(" Raid Devices : %d\n", array.raid_disks); @@ -602,7 +606,7 @@ This is pretty boring } free(info); - for (d= 0; d < max_disks; d++) { + for (d= 0; d < max_disks * 2; d++) { char *dv; mdu_disk_info_t disk = disks[d]; @@ -616,12 +620,15 @@ This is pretty boring continue; if (!c->brief) { if (d == array.raid_disks*2) printf("\n"); - if (disk.number < 0) + if (disk.number < 0 && disk.raid_disk < 0) printf(" - %5d %5d - ", disk.major, disk.minor); - else if (disk.raid_disk < 0) + else if (disk.raid_disk < 0 || disk.state & (1<<MD_DISK_JOURNAL)) printf(" %5d %5d %5d - ", disk.number, disk.major, disk.minor); + else if (disk.number < 0) + printf(" - %5d %5d %5d ", + disk.major, disk.minor, disk.raid_disk); else printf(" %5d %5d %5d %5d ", disk.number, disk.major, disk.minor, disk.raid_disk); @@ -650,9 +657,10 @@ This is pretty boring } if (disk.state & (1<<MD_DISK_REMOVED)) printf(" removed"); if (disk.state & (1<<MD_DISK_WRITEMOSTLY)) printf(" writemostly"); + if (disk.state & (1<<MD_DISK_JOURNAL)) printf(" journal"); if ((disk.state & ((1<<MD_DISK_ACTIVE)|(1<<MD_DISK_SYNC) - |(1<<MD_DISK_REMOVED)|(1<<MD_DISK_FAULTY))) + |(1<<MD_DISK_REMOVED)|(1<<MD_DISK_FAULTY)|(1<<MD_DISK_JOURNAL))) == 0) { printf(" spare"); if (is_26) { @@ -671,9 +679,6 @@ This is pretty boring } } if (disk.state == 0) spares++; - if (c->test && d < array.raid_disks - && !(disk.state & (1<<MD_DISK_SYNC))) - rv |= 1; dv=map_dev_preferred(disk.major, disk.minor, 0, c->prefer); if (dv != NULL) { if (c->brief) @@ -87,11 +87,9 @@ int restore_backup(struct supertype *st, } free(fdlist); if (err) { - pr_err("Failed to restore critical" - " section for reshape - sorry.\n"); + pr_err("Failed to restore critical section for reshape - sorry.\n"); if (!backup_file) - pr_err("Possibly you need" - " to specify a --backup-file\n"); + pr_err("Possibly you need to specify a --backup-file\n"); return 1; } @@ -295,12 +293,13 @@ int Grow_addbitmap(char *devname, int fd, struct context *c, struct shape *s) if (vers < 9003) { major = BITMAP_MAJOR_HOSTENDIAN; - pr_err("Warning - bitmaps created on this kernel" - " are not portable\n" - " between different architectures. Consider upgrading" - " the Linux kernel.\n"); + pr_err("Warning - bitmaps created on this kernel are not portable\n" + " between different architectures. Consider upgrading the Linux kernel.\n"); } + if (s->bitmap_file && strcmp(s->bitmap_file, "clustered") == 0) + major = BITMAP_MAJOR_CLUSTERED; + if (ioctl(fd, GET_BITMAP_FILE, &bmf) != 0) { if (errno == ENOMEM) pr_err("Memory allocation failure.\n"); @@ -329,13 +328,15 @@ int Grow_addbitmap(char *devname, int fd, struct context *c, struct shape *s) if (strcmp(s->bitmap_file, "none")==0) { array.state &= ~(1<<MD_SB_BITMAP_PRESENT); if (ioctl(fd, SET_ARRAY_INFO, &array)!= 0) { - pr_err("failed to remove internal bitmap.\n"); + if (array.state & (1<<MD_SB_CLUSTERED)) + pr_err("failed to remove clustered bitmap.\n"); + else + pr_err("failed to remove internal bitmap.\n"); return 1; } return 0; } - pr_err("Internal bitmap already present on %s\n", - devname); + pr_err("bitmap already present on %s\n", devname); return 1; } @@ -379,16 +380,18 @@ int Grow_addbitmap(char *devname, int fd, struct context *c, struct shape *s) free(st); return 1; } - if (strcmp(s->bitmap_file, "internal") == 0) { + if (strcmp(s->bitmap_file, "internal") == 0 || + strcmp(s->bitmap_file, "clustered") == 0) { int rv; int d; int offset_setable = 0; struct mdinfo *mdi; if (st->ss->add_internal_bitmap == NULL) { - pr_err("Internal bitmaps not supported " - "with %s metadata\n", st->ss->name); + pr_err("Internal bitmaps not supported with %s metadata\n", st->ss->name); return 1; } + st->nodes = c->nodes; + st->cluster_name = c->homecluster; mdi = sysfs_read(fd, NULL, GET_BITMAP_LOCATION); if (mdi) offset_setable = 1; @@ -415,10 +418,9 @@ int Grow_addbitmap(char *devname, int fd, struct context *c, struct shape *s) bitmapsize, offset_setable, major) ) - st->ss->write_bitmap(st, fd2); + st->ss->write_bitmap(st, fd2, NoUpdate); else { - pr_err("failed to create internal bitmap" - " - chunksize problem.\n"); + pr_err("failed to create internal bitmap - chunksize problem.\n"); close(fd2); return 1; } @@ -432,13 +434,14 @@ int Grow_addbitmap(char *devname, int fd, struct context *c, struct shape *s) rv = sysfs_set_num_signed(mdi, NULL, "bitmap/location", mdi->bitmap_offset); } else { + if (strcmp(s->bitmap_file, "clustered") == 0) + array.state |= (1<<MD_SB_CLUSTERED); array.state |= (1<<MD_SB_BITMAP_PRESENT); rv = ioctl(fd, SET_ARRAY_INFO, &array); } if (rv < 0) { if (errno == EBUSY) - pr_err("Cannot add bitmap while array is" - " resyncing or reshaping etc.\n"); + pr_err("Cannot add bitmap while array is resyncing or reshaping etc.\n"); pr_err("failed to set internal bitmap.\n"); return 1; } @@ -489,8 +492,7 @@ int Grow_addbitmap(char *devname, int fd, struct context *c, struct shape *s) if (ioctl(fd, SET_BITMAP_FILE, bitmap_fd) < 0) { int err = errno; if (errno == EBUSY) - pr_err("Cannot add bitmap while array is" - " resyncing or reshaping etc.\n"); + pr_err("Cannot add bitmap while array is resyncing or reshaping etc.\n"); pr_err("Cannot set bitmap file for %s: %s\n", devname, strerror(err)); return 1; @@ -620,10 +622,8 @@ static void unfreeze(struct supertype *st) if (sra && sysfs_get_str(sra, NULL, "sync_action", buf, 20) > 0 - && strcmp(buf, "frozen\n") == 0) { - printf("unfreeze\n"); + && strcmp(buf, "frozen\n") == 0) sysfs_set_str(sra, NULL, "sync_action", "idle"); - } sysfs_free(sra); } } @@ -726,9 +726,14 @@ int start_reshape(struct mdinfo *sra, int already_running, if (!already_running) sysfs_set_num(sra, NULL, "sync_min", sync_max_to_set); err = err ?: sysfs_set_num(sra, NULL, "sync_max", sync_max_to_set); - if (!already_running) - err = err ?: sysfs_set_str(sra, NULL, "sync_action", "reshape"); - + if (!already_running && err == 0) { + int cnt = 5; + do { + err = sysfs_set_str(sra, NULL, "sync_action", "reshape"); + if (err) + sleep(1); + } while (err && errno == EBUSY && cnt-- > 0); + } return err; } @@ -853,7 +858,8 @@ int reshape_prepare_fdlist(char *devname, for (sd = sra->devs; sd; sd = sd->next) { if (sd->disk.state & (1<<MD_DISK_FAULTY)) continue; - if (sd->disk.state & (1<<MD_DISK_SYNC)) { + if (sd->disk.state & (1<<MD_DISK_SYNC) && + sd->disk.raid_disk < raid_disks) { char *dn = map_dev(sd->disk.major, sd->disk.minor, 1); fdlist[sd->disk.raid_disk] @@ -917,8 +923,7 @@ int reshape_open_backup_file(char *backup_file, dev = stb.st_dev; fstat(fd, &stb); if (stb.st_rdev == dev) { - pr_err("backup file must NOT be" - " on the array being reshaped.\n"); + pr_err("backup file must NOT be on the array being reshaped.\n"); close(*fdlist); return 0; } @@ -926,8 +931,7 @@ int reshape_open_backup_file(char *backup_file, memset(buf, 0, 512); for (i=0; i < blocks + 8 ; i++) { if (write(*fdlist, buf, 512) != 512) { - pr_err("%s: cannot create" - " backup file %s: %s\n", + pr_err("%s: cannot create backup file %s: %s\n", devname, backup_file, strerror(errno)); return 0; } @@ -941,7 +945,7 @@ int reshape_open_backup_file(char *backup_file, if (!restart && strncmp(backup_file, MAP_DIR, strlen(MAP_DIR)) != 0) { char *bu = make_backup(sys_name); if (symlink(backup_file, bu)) - pr_err("Recording backup file in " MAP_DIR "failed: %s\n", + pr_err("Recording backup file in " MAP_DIR " failed: %s\n", strerror(errno)); free(bu); } @@ -1041,13 +1045,11 @@ char *analyse_change(char *devname, struct mdinfo *info, struct reshape *re) */ if (info->new_level > 1 && (info->component_size & 7)) - return "Cannot convert RAID1 of this size - " - "reduce size to multiple of 4K first."; + return "Cannot convert RAID1 of this size - reduce size to multiple of 4K first."; if (info->new_level == 0) { if (info->delta_disks != UnSet && info->delta_disks != 0) - return "Cannot change number of disks " - "with RAID1->RAID0 conversion"; + return "Cannot change number of disks with RAID1->RAID0 conversion"; re->level = 0; re->before.data_disks = 1; re->after.data_disks = 1; @@ -1133,8 +1135,7 @@ char *analyse_change(char *devname, struct mdinfo *info, struct reshape *re) if (far > 1 && !offset) return "Cannot reshape RAID10 to far-mode"; if (near * far != copies) - return "Cannot change number of copies" - " when reshaping RAID10"; + return "Cannot change number of copies when reshaping RAID10"; } if (info->delta_disks == UnSet) info->delta_disks = 0; @@ -1184,15 +1185,13 @@ char *analyse_change(char *devname, struct mdinfo *info, struct reshape *re) / info->array.raid_disks); if (info->array.raid_disks * (copies-1) != info->delta_disks) - return "Impossible number of devices" - " for RAID0->RAID10"; + return "Impossible number of devices for RAID0->RAID10"; info->new_layout = 0x100 + copies; } if (info->delta_disks == UnSet) { int copies = info->new_layout & 0xff; if (info->new_layout != 0x100 + copies) - return "New layout impossible" - " for RAID0->RAID10";; + return "New layout impossible for RAID0->RAID10";; info->delta_disks = (copies - 1) * info->array.raid_disks; } @@ -1287,8 +1286,7 @@ char *analyse_change(char *devname, struct mdinfo *info, struct reshape *re) return "Can only convert a 2-device array to RAID1"; if (info->delta_disks != UnSet && info->delta_disks != 0) - return "Cannot set raid_disk when " - "converting RAID5->RAID1"; + return "Cannot set raid_disk when converting RAID5->RAID1"; re->level = 1; info->new_chunk = 0; return NULL; @@ -1383,8 +1381,7 @@ char *analyse_change(char *devname, struct mdinfo *info, struct reshape *re) strcat(strcpy(layout, ls), "-6"); l = map_name(r6layout, layout); if (l == UnSet) - return "Cannot find RAID6 layout" - " to convert to"; + return "Cannot find RAID6 layout to convert to"; } else { /* Current RAID6 has no equivalent. * If it is already a '-6' layout we @@ -1496,8 +1493,8 @@ static int set_array_size(struct supertype *st, struct mdinfo *sra, ret_val = 0; dprintf("Array size changed"); } - dprintf(" from %llu to %llu.\n", - current_size, new_size); + dprintf_cont(" from %llu to %llu.\n", + current_size, new_size); } sysfs_free(info); } else @@ -1571,10 +1568,8 @@ int Grow_reshape(char *devname, int fd, if (s->size > 0 && (s->chunk || s->level!= UnSet || s->layout_str || s->raiddisks)) { - pr_err("cannot change component size at the same time " - "as other changes.\n" - " Change size first, then check data is intact before " - "making other changes.\n"); + pr_err("cannot change component size at the same time as other changes.\n" + " Change size first, then check data is intact before making other changes.\n"); return 1; } @@ -1592,10 +1587,18 @@ int Grow_reshape(char *devname, int fd, return 1; } if (s->raiddisks > st->max_devs) { - pr_err("Cannot increase raid-disks on this array" - " beyond %d\n", st->max_devs); + pr_err("Cannot increase raid-disks on this array beyond %d\n", st->max_devs); return 1; } + if (s->level == 0 && + (array.state & (1<<MD_SB_BITMAP_PRESENT)) && + !(array.state & (1<<MD_SB_CLUSTERED))) { + array.state &= ~(1<<MD_SB_BITMAP_PRESENT); + if (ioctl(fd, SET_ARRAY_INFO, &array)!= 0) { + pr_err("failed to remove internal bitmap.\n"); + return 1; + } + } /* in the external case we need to check that the requested reshape is * supported, and perform an initial check that the container holds the @@ -1647,9 +1650,7 @@ int Grow_reshape(char *devname, int fd, & (1<<MD_SB_BLOCK_CONTAINER_RESHAPE)) allow_reshape = 0; if (!allow_reshape) { - pr_err("cannot reshape arrays in" - " container with unsupported" - " metadata: %s(%s)\n", + pr_err("cannot reshape arrays in container with unsupported metadata: %s(%s)\n", devname, container); sysfs_free(cc); free(subarray); @@ -1668,8 +1669,7 @@ int Grow_reshape(char *devname, int fd, if (s->raiddisks > array.raid_disks && array.spare_disks +added_disks < (s->raiddisks - array.raid_disks) && !c->force) { - pr_err("Need %d spare%s to avoid degraded array," - " and only have %d.\n" + pr_err("Need %d spare%s to avoid degraded array, and only have %d.\n" " Use --force to over-ride this check.\n", s->raiddisks - array.raid_disks, s->raiddisks - array.raid_disks == 1 ? "" : "s", @@ -1695,8 +1695,7 @@ int Grow_reshape(char *devname, int fd, sysfs_free(sra); return 1; } else if (frozen < 0) { - pr_err("%s is performing resync/recovery and cannot" - " be reshaped\n", devname); + pr_err("%s is performing resync/recovery and cannot be reshaped\n", devname); sysfs_free(sra); return 1; } @@ -1737,8 +1736,7 @@ int Grow_reshape(char *devname, int fd, sizeinfo->array.layout, sizeinfo->array.raid_disks); new_size /= data_disks; - dprintf("Metadata size correction from %llu to " - "%llu (%llu)\n", orig_size, new_size, + dprintf("Metadata size correction from %llu to %llu (%llu)\n", orig_size, new_size, new_size * data_disks); s->size = new_size; sysfs_free(sizeinfo); @@ -1775,13 +1773,11 @@ int Grow_reshape(char *devname, int fd, } } if (rv) { - pr_err("Cannot set size on " - "array members.\n"); + pr_err("Cannot set size on array members.\n"); goto size_change_error; } if (min_csize && s->size > min_csize) { - pr_err("Cannot safely make this array " - "use more than 2TB per device on this kernel.\n"); + pr_err("Cannot safely make this array use more than 2TB per device on this kernel.\n"); rv = 1; goto size_change_error; } @@ -1789,8 +1785,7 @@ int Grow_reshape(char *devname, int fd, /* Don't let the kernel choose a size - it will get * it wrong */ - pr_err("Limited v0.90 array to " - "2TB per device\n"); + pr_err("Limited v0.90 array to 2TB per device\n"); s->size = min_csize; } if (st->ss->external) { @@ -1799,8 +1794,8 @@ int Grow_reshape(char *devname, int fd, "raid5"); if (!rv) { raid0_takeover = 1; - /* get array parametes after takeover - * to chane one parameter at time only + /* get array parameters after takeover + * to change one parameter at time only */ rv = ioctl(fd, GET_ARRAY_INFO, &array); } @@ -1818,7 +1813,7 @@ int Grow_reshape(char *devname, int fd, if (s->size == MAX_SIZE) s->size = 0; array.size = s->size; - if (array.size != (signed)s->size) { + if (s->size & ~INT32_MAX) { /* got truncated to 32bit, write to * component_size instead */ @@ -1879,12 +1874,10 @@ size_change_error: s->size = array.size; if (c->verbose >= 0) { if (s->size == orig_size) - pr_err("component size of %s " - "unchanged at %lluK\n", + pr_err("component size of %s unchanged at %lluK\n", devname, s->size); else - pr_err("component size of %s " - "has been set to %lluK\n", + pr_err("component size of %s has been set to %lluK\n", devname, s->size); } changed = 1; @@ -1919,7 +1912,7 @@ size_change_error: int err; err = remove_disks_for_takeover(st, sra, array.layout); if (err) { - dprintf(Name": Array cannot be reshaped\n"); + dprintf("Array cannot be reshaped\n"); if (cfd > -1) close(cfd); rv = 1; @@ -1952,12 +1945,9 @@ size_change_error: if (info.array.level == 6 && (info.new_level == 6 || info.new_level == UnSet) && info.array.layout >= 16) { - pr_err("%s has a non-standard layout. If you" - " wish to preserve this\n", devname); - cont_err("during the reshape, please specify" - " --layout=preserve\n"); - cont_err("If you want to change it, specify a" - " layout or use --layout=normalise\n"); + pr_err("%s has a non-standard layout. If you wish to preserve this\n", devname); + cont_err("during the reshape, please specify --layout=preserve\n"); + cont_err("If you want to change it, specify a layout or use --layout=normalise\n"); rv = 1; goto release; } @@ -1974,8 +1964,7 @@ size_change_error: info.new_layout = map_name(r6layout, l); } } else { - pr_err("%s is only meaningful when reshaping" - " a RAID6 array.\n", s->layout_str); + pr_err("%s is only meaningful when reshaping a RAID6 array.\n", s->layout_str); rv = 1; goto release; } @@ -1997,8 +1986,7 @@ size_change_error: strcat(l, "-6"); info.new_layout = map_name(r6layout, l); } else { - pr_err("%s in only meaningful when reshaping" - " to RAID6\n", s->layout_str); + pr_err("%s in only meaningful when reshaping to RAID6\n", s->layout_str); rv = 1; goto release; } @@ -2020,14 +2008,12 @@ size_change_error: info.new_layout = parse_layout_faulty(s->layout_str); break; default: - pr_err("layout not meaningful" - " with this level\n"); + pr_err("layout not meaningful with this level\n"); rv = 1; goto release; } if (info.new_layout == UnSet) { - pr_err("layout %s not understood" - " for this level\n", + pr_err("layout %s not understood for this level\n", s->layout_str); rv = 1; goto release; @@ -2133,27 +2119,22 @@ static int verify_reshape_position(struct mdinfo *info, int level) char *ep; unsigned long long position = strtoull(buf, &ep, 0); - dprintf(Name": Read sync_max sysfs entry is: %s\n", buf); + dprintf("Read sync_max sysfs entry is: %s\n", buf); if (!(ep == buf || (*ep != 0 && *ep != '\n' && *ep != ' '))) { position *= get_data_disks(level, info->new_layout, info->array.raid_disks); if (info->reshape_progress < position) { - dprintf("Corrected reshape progress (%llu) to " - "md position (%llu)\n", + dprintf("Corrected reshape progress (%llu) to md position (%llu)\n", info->reshape_progress, position); info->reshape_progress = position; ret_val = 1; } else if (info->reshape_progress > position) { - pr_err("Fatal error: array " - "reshape was not properly frozen " - "(expected reshape position is %llu, " - "but reshape progress is %llu.\n", + pr_err("Fatal error: array reshape was not properly frozen (expected reshape position is %llu, but reshape progress is %llu.\n", position, info->reshape_progress); ret_val = -1; } else { - dprintf("Reshape position in md and metadata " - "are the same;"); + dprintf("Reshape position in md and metadata are the same;"); ret_val = 1; } } @@ -2255,7 +2236,10 @@ static int set_new_data_offset(struct mdinfo *sra, struct supertype *st, if (info2.space_before == 0 && info2.space_after == 0) { /* Metadata doesn't support data_offset changes */ - return 1; + if (!can_fallback) + pr_err("%s: Metadata version doesn't support data_offset changes\n", + devname); + goto fallback; } if (before > info2.space_before) before = info2.space_before; @@ -2500,8 +2484,7 @@ static int raid10_reshape(char *container, int fd, char *devname, devname); if (err == EBUSY && (info->array.state & (1<<MD_SB_BITMAP_PRESENT))) - cont_err(" Bitmap must be removed before" - " shape can be changed\n"); + cont_err(" Bitmap must be removed before shape can be changed\n"); goto release; } sysfs_free(sra); @@ -2574,7 +2557,7 @@ static void update_cache_size(char *container, struct mdinfo *sra, /* make sure there is room for 'blocks' with a bit to spare */ if (cache < 16 + blocks / disks) cache = 16 + blocks / disks; - cache /= (4096/512); /* Covert from sectors to pages */ + cache /= (4096/512); /* Convert from sectors to pages */ if (sra->cache_size < cache) subarray_set_num(container, sra, "stripe_cache_size", @@ -2625,8 +2608,7 @@ static int impose_reshape(struct mdinfo *sra, if (err == EBUSY && (array.state & (1<<MD_SB_BITMAP_PRESENT))) - cont_err("Bitmap must be removed before" - " shape can be changed\n"); + cont_err("Bitmap must be removed before shape can be changed\n"); goto release; } @@ -2650,8 +2632,7 @@ static int impose_reshape(struct mdinfo *sra, if (err == EBUSY && (array.state & (1<<MD_SB_BITMAP_PRESENT))) - cont_err("Bitmap must be removed before" - " shape can be changed\n"); + cont_err("Bitmap must be removed before shape can be changed\n"); goto release; } } @@ -2739,8 +2720,7 @@ static int impose_level(int fd, int level, char *devname, int verbose) devname, c); if (err == EBUSY && (array.state & (1<<MD_SB_BITMAP_PRESENT))) - cont_err("Bitmap must be removed" - " before level can be changed\n"); + cont_err("Bitmap must be removed before level can be changed\n"); return err; } if (verbose >= 0) @@ -2870,8 +2850,7 @@ static int reshape_array(char *container, int fd, char *devname, reshape.before.layout != info->array.layout || reshape.before.data_disks + reshape.parity != info->array.raid_disks - max(0, info->delta_disks))) { - pr_err("reshape info is not in native format -" - " cannot continue.\n"); + pr_err("reshape info is not in native format - cannot continue.\n"); goto release; } @@ -2928,8 +2907,7 @@ static int reshape_array(char *container, int fd, char *devname, if (!force && info->new_level > 1 && info->array.level > 1 && spares_needed > info->array.spare_disks + added_disks) { - pr_err("Need %d spare%s to avoid degraded array," - " and only have %d.\n" + pr_err("Need %d spare%s to avoid degraded array, and only have %d.\n" " Use --force to over-ride this check.\n", spares_needed, spares_needed == 1 ? "" : "s", @@ -2942,8 +2920,7 @@ static int reshape_array(char *container, int fd, char *devname, - array.raid_disks; if ((info->new_level > 1 || info->new_level == 0) && spares_needed > info->array.spare_disks +added_disks) { - pr_err("Need %d spare%s to create working array," - " and only have %d.\n", + pr_err("Need %d spare%s to create working array, and only have %d.\n", spares_needed, spares_needed == 1 ? "" : "s", info->array.spare_disks + added_disks); @@ -3150,8 +3127,19 @@ static int reshape_array(char *container, int fd, char *devname, devname, container, &reshape) < 0) goto release; if (sysfs_set_str(sra, NULL, "sync_action", "reshape") < 0) { - pr_err("Failed to initiate reshape!\n"); - goto release; + struct mdinfo *sd; + if (errno != EINVAL) { + pr_err("Failed to initiate reshape!\n"); + goto release; + } + /* revert data_offset and try the old way */ + for (sd = sra->devs; sd; sd = sd->next) { + sysfs_set_num(sra, sd, "new_offset", + sd->data_offset); + sysfs_set_str(sra, NULL, "reshape_direction", + "forwards"); + } + break; } if (info->new_level == reshape.level) return 0; @@ -3194,12 +3182,10 @@ started: blocks < 16*1024*2) blocks *= 2; } else - pr_err("Need to backup %luK of critical " - "section..\n", blocks/2); + pr_err("Need to backup %luK of critical section..\n", blocks/2); if (blocks >= sra->component_size/2) { - pr_err("%s: Something wrong" - " - reshape aborted\n", + pr_err("%s: Something wrong - reshape aborted\n", devname); goto release; } @@ -3216,7 +3202,7 @@ started: d = reshape_prepare_fdlist(devname, sra, odisks, nrdisks, blocks, backup_file, fdlist, offsets); - if (d < 0) { + if (d < odisks) { goto release; } if ((st->ss->manage_reshape == NULL) || @@ -3228,10 +3214,8 @@ started: devname); pr_err(" Please provide one with \"--backup=...\"\n"); goto release; - } else if (sra->array.spare_disks == 0) { - pr_err("%s: Cannot grow - " - "need a spare or backup-file to backup " - "critical section\n", devname); + } else if (d == odisks) { + pr_err("%s: Cannot grow - need a spare or backup-file to backup critical section\n", devname); goto release; } } else { @@ -3274,8 +3258,7 @@ started: free(fdlist); free(offsets); sysfs_free(sra); - pr_err("Reshape has to be continued from" - " location %llu when root filesystem has been mounted.\n", + pr_err("Reshape has to be continued from location %llu when root filesystem has been mounted.\n", sra->reshape_progress); return 1; } @@ -3372,7 +3355,7 @@ started: bul = make_backup(sra->sys_name); if (bul) { char buf[1024]; - int l = readlink(bul, buf, sizeof(buf)); + int l = readlink(bul, buf, sizeof(buf) - 1); if (l > 0) { buf[l]=0; unlink(buf); @@ -3492,8 +3475,7 @@ int reshape_container(char *container, char *devname, return 1; default: /* parent */ if (!freeze_reshape) - printf(Name ": multi-array reshape continues" - " in background\n"); + printf("%s: multi-array reshape continues in background\n", Name); return 0; case 0: /* child */ map_fork(); @@ -3555,8 +3537,7 @@ int reshape_container(char *container, char *devname, fd = open_dev(mdstat->devnm); if (fd < 0) { - printf(Name ": Device %s cannot be opened for reshape.", - adev); + pr_err("Device %s cannot be opened for reshape.\n", adev); break; } @@ -3571,8 +3552,7 @@ int reshape_container(char *container, char *devname, * This is possibly interim until the behaviour of * reshape_array is resolved(). */ - printf(Name ": Multiple reshape execution detected for " - "device %s.", adev); + printf("%s: Multiple reshape execution detected for device %s.\n", Name, adev); close(fd); break; } @@ -3882,9 +3862,11 @@ int progress_reshape(struct mdinfo *info, struct reshape *reshape, * So we need these extra tests. */ if (completed == 0 && advancing + && strncmp(action, "idle", 4) == 0 && info->reshape_progress > 0) break; if (completed == 0 && !advancing + && strncmp(action, "idle", 4) == 0 && info->reshape_progress < (info->component_size * reshape->after.data_disks)) break; @@ -3893,21 +3875,31 @@ int progress_reshape(struct mdinfo *info, struct reshape *reshape, goto check_progress; } /* Some kernels reset 'sync_completed' to zero, - * we need to have real point we are in md + * we need to have real point we are in md. + * So in that case, read 'reshape_position' from sysfs. */ - if (completed == 0) - completed = max_progress; - - /* some kernels can give an incorrectly high 'completed' number */ - completed /= (info->new_chunk/512); - completed *= (info->new_chunk/512); - /* Convert 'completed' back in to a 'progress' number */ - completed *= reshape->after.data_disks; - if (!advancing) { - completed = info->component_size * reshape->after.data_disks - - completed; + if (completed == 0) { + unsigned long long reshapep; + char action[20]; + if (sysfs_get_str(info, NULL, "sync_action", + action, 20) > 0 && + strncmp(action, "idle", 4) == 0 && + sysfs_get_ll(info, NULL, + "reshape_position", &reshapep) == 0) + *reshape_completed = reshapep; + } else { + /* some kernels can give an incorrectly high + * 'completed' number, so round down */ + completed /= (info->new_chunk/512); + completed *= (info->new_chunk/512); + /* Convert 'completed' back in to a 'progress' number */ + completed *= reshape->after.data_disks; + if (!advancing) + completed = (info->component_size + * reshape->after.data_disks + - completed); + *reshape_completed = completed; } - *reshape_completed = completed; close(fd); @@ -3927,7 +3919,6 @@ check_progress: * it was just a device failure that leaves us degraded but * functioning. */ - strcpy(buf, "hi"); if (sysfs_get_str(info, NULL, "reshape_position", buf, sizeof(buf)) < 0 || strncmp(buf, "none", 4) != 0) { /* The abort might only be temporary. Wait up to 10 @@ -4524,11 +4515,10 @@ int Grow_restart(struct supertype *st, struct mdinfo *info, int *fdlist, int cnt * sometimes they aren't... So allow considerable flexability in matching, and allow * this test to be overridden by an environment variable. */ - if (info->array.utime > (int)__le64_to_cpu(bsb.mtime) + 2*60*60 || - info->array.utime < (int)__le64_to_cpu(bsb.mtime) - 10*60) { + if(time_after(info->array.utime, (unsigned int)__le64_to_cpu(bsb.mtime) + 2*60*60) || + time_before(info->array.utime, (unsigned int)__le64_to_cpu(bsb.mtime) - 10*60)) { if (check_env("MDADM_GROW_ALLOW_OLD")) { - pr_err("accepting backup with timestamp %lu " - "for array with timestamp %lu\n", + pr_err("accepting backup with timestamp %lu for array with timestamp %lu\n", (unsigned long)__le64_to_cpu(bsb.mtime), (unsigned long)info->array.utime); } else { @@ -4609,7 +4599,7 @@ int Grow_restart(struct supertype *st, struct mdinfo *info, int *fdlist, int cnt st->ss->free_super(st); offsets[j] = dinfo.data_offset * 512; } - printf(Name ": restoring critical section\n"); + printf("%s: restoring critical section\n", Name); if (restore_stripes(fdlist, offsets, info->array.raid_disks, @@ -4768,10 +4758,9 @@ int Grow_continue_command(char *devname, int fd, dprintf("Grow continue is run for "); if (st->ss->external == 0) { int d; - dprintf("native array (%s)\n", devname); + dprintf_cont("native array (%s)\n", devname); if (ioctl(fd, GET_ARRAY_INFO, &array.array) < 0) { - pr_err("%s is not an active md array -" - " aborting\n", devname); + pr_err("%s is not an active md array - aborting\n", devname); ret_val = 1; goto Grow_continue_command_exit; } @@ -4816,19 +4805,18 @@ int Grow_continue_command(char *devname, int fd, char *container; if (subarray) { - dprintf("subarray (%s)\n", subarray); + dprintf_cont("subarray (%s)\n", subarray); container = st->container_devnm; cfd = open_dev_excl(st->container_devnm); } else { container = st->devnm; close(fd); cfd = open_dev_excl(st->devnm); - dprintf("container (%s)\n", container); + dprintf_cont("container (%s)\n", container); fd = cfd; } if (cfd < 0) { - pr_err("Unable to open container " - "for %s\n", devname); + pr_err("Unable to open container for %s\n", devname); ret_val = 1; goto Grow_continue_command_exit; } @@ -4864,9 +4852,7 @@ int Grow_continue_command(char *devname, int fd, allow_reshape = 0; if (!allow_reshape) { - pr_err("cannot continue reshape of an array" - " in container with unsupported" - " metadata: %s(%s)\n", + pr_err("cannot continue reshape of an array in container with unsupported metadata: %s(%s)\n", devname, container); ret_val = 1; goto Grow_continue_command_exit; @@ -4886,8 +4872,7 @@ int Grow_continue_command(char *devname, int fd, break; } if (!content) { - pr_err("Unable to determine reshaped " - "array for %s\n", devname); + pr_err("Unable to determine reshaped array for %s\n", devname); ret_val = 1; goto Grow_continue_command_exit; } @@ -4900,6 +4885,9 @@ int Grow_continue_command(char *devname, int fd, sysfs_init(content, fd2, mdstat->devnm); + close(fd2); + fd2 = -1; + /* start mdmon in case it is not running */ if (!mdmon_running(container)) @@ -4909,8 +4897,7 @@ int Grow_continue_command(char *devname, int fd, if (mdmon_running(container)) st->update_tail = &st->updates; else { - pr_err("No mdmon found. " - "Grow cannot continue.\n"); + pr_err("No mdmon found. Grow cannot continue.\n"); ret_val = 1; goto Grow_continue_command_exit; } diff --git a/Incremental.c b/Incremental.c index c9372587..24fd8276 100644 --- a/Incremental.c +++ b/Incremental.c @@ -104,6 +104,7 @@ int Incremental(struct mddev_dev *devlist, struct context *c, struct map_ent target_array; int have_target; char *devname = devlist->devname; + int journal_device_missing = 0; struct createinfo *ci = conf_get_create_info(); @@ -130,16 +131,13 @@ int Incremental(struct mddev_dev *devlist, struct context *c, if (must_be_container(dfd)) { if (!st) st = super_by_fd(dfd, NULL); - if (st) - st->ignore_hw_compat = 1; if (st && st->ss->load_container) rv = st->ss->load_container(st, dfd, NULL); close(dfd); if (!rv && st->ss->container_content) { if (map_lock(&map)) - pr_err("failed to get " - "exclusive lock on mapfile\n"); + pr_err("failed to get exclusive lock on mapfile\n"); if (c->export) printf("MD_DEVNAME=%s\n", devname); rv = Incremental_container(st, devname, c, NULL); @@ -196,18 +194,19 @@ int Incremental(struct mddev_dev *devlist, struct context *c, policy = disk_policy(&dinfo); have_target = policy_check_path(&dinfo, &target_array); - if (st == NULL && (st = guess_super(dfd)) == NULL) { + if (st == NULL && (st = guess_super_type(dfd, guess_array)) == NULL) { if (c->verbose >= 0) pr_err("no recognisable superblock on %s.\n", devname); rv = try_spare(devname, &dfd, policy, have_target ? &target_array : NULL, - st, c->verbose); + NULL, c->verbose); goto out; } - st->ignore_hw_compat = 1; + st->ignore_hw_compat = 0; + if (st->ss->compare_super == NULL || - st->ss->load_super(st, dfd, NULL)) { + st->ss->load_super(st, dfd, c->verbose >= 0 ? devname : NULL)) { if (c->verbose >= 0) pr_err("no RAID superblock on %s.\n", devname); @@ -229,8 +228,7 @@ int Incremental(struct mddev_dev *devlist, struct context *c, if (match && match->devname && strcasecmp(match->devname, "<ignore>") == 0) { if (c->verbose >= 0) - pr_err("array containing %s is explicitly" - " ignored by mdadm.conf\n", + pr_err("array containing %s is explicitly ignored by mdadm.conf\n", devname); goto out; } @@ -251,8 +249,7 @@ int Incremental(struct mddev_dev *devlist, struct context *c, if (!match && !conf_test_metadata(st->ss->name, policy, (trustworthy == LOCAL))) { if (c->verbose >= 1) - pr_err("%s has metadata type %s for which " - "auto-assembly is disabled\n", + pr_err("%s has metadata type %s for which auto-assembly is disabled\n", devname, st->ss->name); goto out; } @@ -289,8 +286,7 @@ int Incremental(struct mddev_dev *devlist, struct context *c, /* 4/ Check if array exists. */ if (map_lock(&map)) - pr_err("failed to get exclusive lock on " - "mapfile\n"); + pr_err("failed to get exclusive lock on mapfile\n"); /* Now check we can get O_EXCL. If not, probably "mdadm -A" has * taken over */ @@ -317,6 +313,12 @@ int Incremental(struct mddev_dev *devlist, struct context *c, if (mdfd < 0) { + /* Skip the clustered ones. This should be started by + * clustering resource agents + */ + if (info.array.state & (1 << MD_SB_CLUSTERED)) + goto out; + /* Couldn't find an existing array, maybe make a new one */ mdfd = create_mddev(match ? match->devname : NULL, name_to_use, c->autof, trustworthy, chosen_name); @@ -352,8 +354,7 @@ int Incremental(struct mddev_dev *devlist, struct context *c, * So reject it. */ ioctl(mdfd, STOP_ARRAY, NULL); - pr_err("You have an old buggy kernel which cannot support\n" - " --incremental reliably. Aborting.\n"); + pr_err("You have an old buggy kernel which cannot support\n --incremental reliably. Aborting.\n"); rv = 2; goto out_unlock; } @@ -420,8 +421,7 @@ int Incremental(struct mddev_dev *devlist, struct context *c, st2 = dup_super(st); if (st2->ss->load_super(st2, dfd2, NULL) || st->ss->compare_super(st, st2) != 0) { - pr_err("metadata mismatch between %s and " - "chosen array %s\n", + pr_err("metadata mismatch between %s and chosen array %s\n", devname, chosen_name); close(dfd2); rv = 2; @@ -444,6 +444,10 @@ int Incremental(struct mddev_dev *devlist, struct context *c, /* add disk needs to know about containers */ if (st->ss->external) sra->array.level = LEVEL_CONTAINER; + + if (info.array.state & (1 << MD_SB_CLUSTERED)) + info.disk.state |= (1 << MD_DISK_CLUSTER_ADD); + err = add_disk(mdfd, st, sra, &info); if (err < 0 && errno == EBUSY) { /* could be another device present with the same @@ -521,6 +525,9 @@ int Incremental(struct mddev_dev *devlist, struct context *c, sra = sysfs_read(mdfd, NULL, (GET_DEVS | GET_STATE | GET_OFFSET | GET_SIZE)); active_disks = count_active(st, sra, mdfd, &avail, &info); + + journal_device_missing = (info.journal_device_required) && (info.journal_clean == 0); + if (enough(info.array.level, info.array.raid_disks, info.array.layout, info.array.state & 1, avail) == 0) { @@ -550,10 +557,12 @@ int Incremental(struct mddev_dev *devlist, struct context *c, } map_unlock(&map); - if (c->runstop > 0 || active_disks >= info.array.working_disks) { + if (c->runstop > 0 || (!journal_device_missing && active_disks >= info.array.working_disks)) { struct mdinfo *dsk; /* Let's try to start it */ + if (journal_device_missing) + pr_err("Trying to run with missing journal device\n"); if (info.reshape_active && !(info.reshape_active & RESHAPE_NO_BACKUP)) { pr_err("%s: This array is being reshaped and cannot be started\n", chosen_name); @@ -620,6 +629,8 @@ int Incremental(struct mddev_dev *devlist, struct context *c, } else { if (c->export) { printf("MD_STARTED=unsafe\n"); + } else if (journal_device_missing) { + pr_err("Journal device is missing, not safe to start yet.\n"); } else if (c->verbose >= 0) pr_err("%s attached to %s, not enough to start safely.\n", devname, chosen_name); @@ -656,7 +667,7 @@ static void find_reject(int mdfd, struct supertype *st, struct mdinfo *sra, * without thinking more */ for (d = sra->devs; d ; d = d->next) { - char dn[10]; + char dn[24]; // 2*11 bytes for ints (including sign) + colon + null byte int dfd; struct mdinfo info; sprintf(dn, "%d:%d", d->disk.major, d->disk.minor); @@ -720,8 +731,11 @@ static int count_active(struct supertype *st, struct mdinfo *sra, close(dfd); if (ok != 0) continue; + info.array.raid_disks = raid_disks; st->ss->getinfo_super(st, &info, devmap + raid_disks * devnum); + if (info.disk.raid_disk == MD_DISK_ROLE_JOURNAL) + bestinfo->journal_clean = 1; if (!avail) { raid_disks = info.array.raid_disks; avail = xcalloc(raid_disks, 1); @@ -771,6 +785,7 @@ static int count_active(struct supertype *st, struct mdinfo *sra, replcnt++; st->ss->free_super(st); } + if (!avail) return 0; /* We need to reject any device that thinks the best device is @@ -864,8 +879,7 @@ static int array_try_spare(char *devname, int *dfdp, struct dev_policy *pol, */ if (map_lock(&map)) { - pr_err("failed to get exclusive lock on " - "mapfile\n"); + pr_err("failed to get exclusive lock on mapfile\n"); return 1; } for (mp = map ; mp ; mp = mp->next) { @@ -911,8 +925,7 @@ static int array_try_spare(char *devname, int *dfdp, struct dev_policy *pol, sra->text_version); if (!st2) { if (verbose > 1) - pr_err("not adding %s to %s" - " as metadata not recognised.\n", + pr_err("not adding %s to %s as metadata not recognised.\n", devname, mp->path); goto next; } @@ -994,8 +1007,7 @@ static int array_try_spare(char *devname, int *dfdp, struct dev_policy *pol, if (domain_test(dl, pol, st2->ss->name) != 1) { /* domain test fails */ if (verbose > 1) - pr_err("not adding %s to %s as" - " it is not in a compatible domain\n", + pr_err("not adding %s to %s as it is not in a compatible domain\n", devname, mp->path); goto next; @@ -1022,12 +1034,12 @@ static int array_try_spare(char *devname, int *dfdp, struct dev_policy *pol, int mdfd = open_dev(chosen->sys_name); if (mdfd >= 0) { struct mddev_dev devlist; - char devname[20]; + char chosen_devname[24]; // 2*11 for int (including signs) + colon + null devlist.next = NULL; devlist.used = 0; devlist.writemostly = 0; - devlist.devname = devname; - sprintf(devname, "%d:%d", major(stb.st_rdev), + devlist.devname = chosen_devname; + sprintf(chosen_devname, "%d:%d", major(stb.st_rdev), minor(stb.st_rdev)); devlist.disposition = 'a'; close(dfd); @@ -1132,6 +1144,7 @@ static int partition_try_spare(char *devname, int *dfdp, struct dev_policy *pol, if (st2 == NULL || st2->ss->load_super(st2, fd, NULL) < 0) goto next; + st2->ignore_hw_compat = 0; if (!st) { /* Check domain policy again, this time referring to metadata */ @@ -1267,8 +1280,7 @@ static int try_spare(char *devname, int *dfdp, struct dev_policy *pol, !policy_action_allows(pol, st?st->ss->name:NULL, act_spare_same_slot)) { if (verbose > 1) - pr_err("%s is not bare, so not " - "considering as a spare\n", + pr_err("%s is not bare, so not considering as a spare\n", devname); return 1; } @@ -1359,12 +1371,11 @@ restart: struct supertype *st = super_by_fd(mdfd, NULL); int ret = 0; struct map_ent *map = NULL; - if (st) - st->ignore_hw_compat = 1; + if (st && st->ss->load_container) ret = st->ss->load_container(st, mdfd, NULL); close(mdfd); - if (!ret && st->ss->container_content) { + if (!ret && st && st->ss->container_content) { if (map_lock(&map)) pr_err("failed to get exclusive lock on mapfile\n"); ret = Incremental_container(st, me->path, c, only); @@ -1576,8 +1587,7 @@ static int Incremental_container(struct supertype *st, char *devname, if (match && match->devname && strcasecmp(match->devname, "<ignore>") == 0) { if (c->verbose > 0) - pr_err("array %s/%s is " - "explicitly ignored by mdadm.conf\n", + pr_err("array %s/%s is explicitly ignored by mdadm.conf\n", match->container, match->member); continue; } @@ -1710,34 +1720,34 @@ int IncrementalRemove(char *devname, char *id_path, int verbose) char buf[32]; if (!id_path) - dprintf(Name ": incremental removal without --path <id_path> " - "lacks the possibility to re-add new device in this " - "port\n"); + dprintf("incremental removal without --path <id_path> lacks the possibility to re-add new device in this port\n"); if (strchr(devname, '/')) { - pr_err("incremental removal requires a " - "kernel device name, not a file: %s\n", devname); + pr_err("incremental removal requires a kernel device name, not a file: %s\n", devname); return 1; } ent = mdstat_by_component(devname); if (!ent) { if (verbose >= 0) - pr_err("%s does not appear to be a component " - "of any array\n", devname); + pr_err("%s does not appear to be a component of any array\n", devname); return 1; } sysfs_init(&mdi, -1, ent->devnm); - if (sysfs_get_str(&mdi, NULL, "array_state", - buf, sizeof(buf)) > 0) { - if (strncmp(buf, "active", 6) == 0 || - strncmp(buf, "clean", 5) == 0) - sysfs_set_str(&mdi, NULL, - "array_state", "read-auto"); + mdfd = open_dev_excl(ent->devnm); + if (mdfd > 0) { + close(mdfd); + if (sysfs_get_str(&mdi, NULL, "array_state", + buf, sizeof(buf)) > 0) { + if (strncmp(buf, "active", 6) == 0 || + strncmp(buf, "clean", 5) == 0) + sysfs_set_str(&mdi, NULL, + "array_state", "read-auto"); + } } mdfd = open_dev(ent->devnm); if (mdfd < 0) { if (verbose >= 0) - pr_err("Cannot open array %s!!\n", ent->dev); + pr_err("Cannot open array %s!!\n", ent->devnm); free_mdstat(ent); return 1; } @@ -1759,11 +1769,11 @@ int IncrementalRemove(char *devname, char *id_path, int verbose) struct mdstat_ent *mdstat = mdstat_read(0, 0); struct mdstat_ent *memb; for (memb = mdstat ; memb ; memb = memb->next) - if (is_container_member(memb, ent->dev)) { + if (is_container_member(memb, ent->devnm)) { int subfd = open_dev(memb->devnm); if (subfd >= 0) { rv |= Manage_subdevs( - memb->dev, subfd, + memb->devnm, subfd, &devlist, verbose, 0, NULL, 0); close(subfd); @@ -1771,7 +1781,7 @@ int IncrementalRemove(char *devname, char *id_path, int verbose) } free_mdstat(mdstat); } else - rv |= Manage_subdevs(ent->dev, mdfd, &devlist, + rv |= Manage_subdevs(ent->devnm, mdfd, &devlist, verbose, 0, NULL, 0); if (rv & 2) { /* Failed due to EBUSY, try to stop the array. @@ -1779,7 +1789,7 @@ int IncrementalRemove(char *devname, char *id_path, int verbose) */ int devid = devnm2devid(ent->devnm); run_udisks("--unmount", map_dev(major(devid),minor(devid), 0)); - rv = Manage_stop(ent->dev, mdfd, verbose, 1); + rv = Manage_stop(ent->devnm, mdfd, verbose, 1); if (rv) /* At least we can try to trigger a 'remove' */ sysfs_uevent(&mdi, "remove"); @@ -1789,7 +1799,7 @@ int IncrementalRemove(char *devname, char *id_path, int verbose) } } else { devlist.disposition = 'r'; - rv = Manage_subdevs(ent->dev, mdfd, &devlist, + rv = Manage_subdevs(ent->devnm, mdfd, &devlist, verbose, 0, NULL, 0); } close(mdfd); @@ -43,7 +43,7 @@ KLIBC_GCC = gcc -nostdinc -iwithprefix include -I$(KLIBC)/klibc/include -I$(KLIB CC = $(CROSS_COMPILE)gcc CXFLAGS ?= -ggdb -CWFLAGS = -Wall -Werror -Wstrict-prototypes -Wextra -Wno-unused-parameter +CWFLAGS = -Wall -Wstrict-prototypes -Wextra -Wno-unused-parameter ifdef WARN_UNUSED CWFLAGS += -Wp,-D_FORTIFY_SOURCE=2 -O3 endif @@ -62,8 +62,8 @@ CPPFLAGS += -DBINDIR=\"$(BINDIR)\" PKG_CONFIG ?= pkg-config SYSCONFDIR = /etc -CONFFILE = $(SYSCONFDIR)/mdadm.conf -CONFFILE2 = $(SYSCONFDIR)/mdadm/mdadm.conf +CONFFILE = $(SYSCONFDIR)/mdadm/mdadm.conf +CONFFILE2 = $(SYSCONFDIR)/mdadm.conf MAILCMD =/usr/sbin/sendmail -t CONFFILEFLAGS = -DCONFFILE=\"$(CONFFILE)\" -DCONFFILE2=\"$(CONFFILE2)\" # Both MAP_DIR and MDMON_DIR should be somewhere that persists across the @@ -79,10 +79,14 @@ MDMON_DIR = $(RUN_DIR) # place for autoreplace cookies FAILED_SLOTS_DIR = $(RUN_DIR)/failed-slots SYSTEMD_DIR=/lib/systemd/system + +COROSYNC:=$(shell [ -d /usr/include/corosync ] || echo -DNO_COROSYNC) +DLM:=$(shell [ -f /usr/include/libdlm.h ] || echo -DNO_DLM) + DIRFLAGS = -DMAP_DIR=\"$(MAP_DIR)\" -DMAP_FILE=\"$(MAP_FILE)\" DIRFLAGS += -DMDMON_DIR=\"$(MDMON_DIR)\" DIRFLAGS += -DFAILED_SLOTS_DIR=\"$(FAILED_SLOTS_DIR)\" -CFLAGS = $(CWFLAGS) $(CXFLAGS) -DSendmail=\""$(MAILCMD)"\" $(CONFFILEFLAGS) $(DIRFLAGS) +CFLAGS = $(CWFLAGS) $(CXFLAGS) -DSendmail=\""$(MAILCMD)"\" $(CONFFILEFLAGS) $(DIRFLAGS) $(COROSYNC) $(DLM) VERSION = $(shell [ -d .git ] && git describe HEAD | sed 's/mdadm-//') VERS_DATE = $(shell [ -d .git ] && date --date="`git log -n1 --format=format:%cd --date=short`" '+%0dth %B %Y' | sed -e 's/1th/1st/' -e 's/2th/2nd/' -e 's/11st/11th/' -e 's/12nd/12th/') @@ -101,6 +105,7 @@ endif # If you want a static binary, you might uncomment these # LDFLAGS = -static # STRIP = -s +LDLIBS=-ldl INSTALL = /usr/bin/install DESTDIR = @@ -115,6 +120,12 @@ ifndef UDEVDIR UDEVDIR = /lib/udev endif +ifeq (,$(findstring s,$(MAKEFLAGS))) + ECHO=echo +else + ECHO=: +endif + OBJS = mdadm.o config.o policy.o mdstat.o ReadMe.o util.o maps.o lib.o \ Manage.o Assemble.o Build.o \ Create.o Detail.o Examine.o Grow.o Monitor.o dlink.o Kill.o Query.o \ @@ -122,7 +133,7 @@ OBJS = mdadm.o config.o policy.o mdstat.o ReadMe.o util.o maps.o lib.o \ mdopen.o super0.o super1.o super-ddf.o super-intel.o bitmap.o \ super-mbr.o super-gpt.o \ restripe.o sysfs.o sha1.o mapfile.o crc32.o sg_io.o msg.o xmalloc.o \ - platform-intel.o probe_roms.o + platform-intel.o probe_roms.o crc32c.o CHECK_OBJS = restripe.o sysfs.o maps.o lib.o xmalloc.o dlink.o @@ -145,7 +156,7 @@ STATICOBJS = pwgr.o ASSEMBLE_SRCS := mdassemble.c Assemble.c Manage.c config.c policy.c dlink.c util.c \ maps.c lib.c xmalloc.c \ super0.c super1.c super-ddf.c super-intel.c sha1.c crc32.c sg_io.c mdstat.c \ - platform-intel.c probe_roms.c sysfs.c super-mbr.c super-gpt.c + platform-intel.c probe_roms.c sysfs.c super-mbr.c super-gpt.c mapfile.c ASSEMBLE_AUTO_SRCS := mdopen.c ASSEMBLE_FLAGS:= $(CFLAGS) -DMDASSEMBLE ifdef MDASSEMBLE_AUTO @@ -153,7 +164,7 @@ ASSEMBLE_SRCS += $(ASSEMBLE_AUTO_SRCS) ASSEMBLE_FLAGS += -DMDASSEMBLE_AUTO endif -all : check_rundir mdadm mdmon +all : mdadm mdmon man : mdadm.man md.man mdadm.conf.man mdmon.man raid6check.man check_rundir: @@ -172,11 +183,11 @@ everything-test: all mdadm.static swap_super test_stripe \ # mdadm.uclibc and mdassemble.uclibc don't work on x86-64 # mdadm.tcc doesn't work.. -mdadm : check_rundir $(OBJS) +mdadm : $(OBJS) | check_rundir $(CC) $(CFLAGS) $(LDFLAGS) -o mdadm $(OBJS) $(LDLIBS) mdadm.static : $(OBJS) $(STATICOBJS) - $(CC) $(CFLAGS) $(LDFLAGS) -static -o mdadm.static $(OBJS) $(STATICOBJS) + $(CC) $(CFLAGS) $(LDFLAGS) -static -o mdadm.static $(OBJS) $(STATICOBJS) $(LDLIBS) mdadm.tcc : $(SRCS) $(INCL) $(TCC) -o mdadm.tcc $(SRCS) @@ -186,21 +197,21 @@ mdadm.klibc : $(SRCS) $(INCL) $(CC) -nostdinc -iwithprefix include -I$(KLIBC)/klibc/include -I$(KLIBC)/linux/include -I$(KLIBC)/klibc/arch/i386/include -I$(KLIBC)/klibc/include/bits32 $(CFLAGS) $(SRCS) mdadm.Os : $(SRCS) $(INCL) - $(CC) -o mdadm.Os $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -DHAVE_STDINT_H -Os $(SRCS) + $(CC) -o mdadm.Os $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -DHAVE_STDINT_H -Os $(SRCS) $(LDLIBS) mdadm.O2 : $(SRCS) $(INCL) mdmon.O2 - $(CC) -o mdadm.O2 $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -DHAVE_STDINT_H -O2 -D_FORTIFY_SOURCE=2 $(SRCS) + $(CC) -o mdadm.O2 $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -DHAVE_STDINT_H -O2 -D_FORTIFY_SOURCE=2 $(SRCS) $(LDLIBS) mdmon.O2 : $(MON_SRCS) $(INCL) mdmon.h - $(CC) -o mdmon.O2 $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(MON_LDFLAGS) -DHAVE_STDINT_H -O2 -D_FORTIFY_SOURCE=2 $(MON_SRCS) + $(CC) -o mdmon.O2 $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(MON_LDFLAGS) -DHAVE_STDINT_H -O2 -D_FORTIFY_SOURCE=2 $(MON_SRCS) $(LDLIBS) # use '-z now' to guarantee no dynamic linker interactions with the monitor thread -mdmon : check_rundir $(MON_OBJS) +mdmon : $(MON_OBJS) | check_rundir $(CC) $(CFLAGS) $(LDFLAGS) $(MON_LDFLAGS) -Wl,-z,now -o mdmon $(MON_OBJS) $(LDLIBS) msg.o: msg.c msg.h test_stripe : restripe.c xmalloc.o mdadm.h - $(CC) $(CXFLAGS) $(LDFLAGS) -o test_stripe xmalloc.o -DMAIN restripe.c + $(CC) $(CFLAGS) $(CXFLAGS) $(LDFLAGS) -o test_stripe xmalloc.o -DMAIN restripe.c raid6check : raid6check.o mdadm.h $(CHECK_OBJS) $(CC) $(CXFLAGS) $(LDFLAGS) -o raid6check raid6check.o $(CHECK_OBJS) @@ -283,7 +294,7 @@ install-man: mdadm.8 md.4 mdadm.conf.5 mdmon.8 install-udev: udev-md-raid-arrays.rules udev-md-raid-assembly.rules @for file in 63-md-raid-arrays.rules 64-md-raid-assembly.rules ; \ do sed -e 's,BINDIR,$(BINDIR),g' udev-$${file#??-} > .install.tmp.1 && \ - echo $(INSTALL) -D -m 644 udev-$${file#??-} $(DESTDIR)$(UDEVDIR)/rules.d/$$file ; \ + $(ECHO) $(INSTALL) -D -m 644 udev-$${file#??-} $(DESTDIR)$(UDEVDIR)/rules.d/$$file ; \ $(INSTALL) -D -m 644 .install.tmp.1 $(DESTDIR)$(UDEVDIR)/rules.d/$$file ; \ rm -f .install.tmp.1; \ done @@ -292,13 +303,13 @@ install-systemd: systemd/mdmon@.service @for file in mdmon@.service mdmonitor.service mdadm-last-resort@.timer \ mdadm-last-resort@.service mdadm-grow-continue@.service; \ do sed -e 's,BINDIR,$(BINDIR),g' systemd/$$file > .install.tmp.2 && \ - echo $(INSTALL) -D -m 644 systemd/$$file $(DESTDIR)$(SYSTEMD_DIR)/$$file ; \ + $(ECHO) $(INSTALL) -D -m 644 systemd/$$file $(DESTDIR)$(SYSTEMD_DIR)/$$file ; \ $(INSTALL) -D -m 644 .install.tmp.2 $(DESTDIR)$(SYSTEMD_DIR)/$$file ; \ rm -f .install.tmp.2; \ done @for file in mdadm.shutdown ; \ do sed -e 's,BINDIR,$(BINDIR),g' systemd/$$file > .install.tmp.3 && \ - echo $(INSTALL) -D -m 755 systemd/$$file $(DESTDIR)$(SYSTEMD_DIR)-shutdown/$$file ; \ + $(ECHO) $(INSTALL) -D -m 755 systemd/$$file $(DESTDIR)$(SYSTEMD_DIR)-shutdown/$$file ; \ $(INSTALL) -D -m 755 .install.tmp.3 $(DESTDIR)$(SYSTEMD_DIR)-shutdown/$$file ; \ rm -f .install.tmp.3; \ done @@ -211,15 +211,11 @@ int Manage_stop(char *devname, int fd, int verbose, int will_retry) if (md_get_version(fd) < 9000) { if (ioctl(fd, STOP_MD, 0) == 0) return 0; - pr_err("stopping device %s " - "failed: %s\n", + pr_err("stopping device %s failed: %s\n", devname, strerror(errno)); return 1; } - /* If this is an mdmon managed array, just write 'inactive' - * to the array state and let mdmon clear up. - */ strcpy(devnm, fd2devnm(fd)); /* Get EXCL access first. If this fails, then attempting * to stop is probably a bad idea. @@ -236,13 +232,17 @@ int Manage_stop(char *devname, int fd, int verbose, int will_retry) container[0] = 0; close(fd); count = 5; - while (((fd = ((devnm[0] == '/') + while (((fd = ((devname[0] == '/') ?open(devname, O_RDONLY|O_EXCL) :open_dev_flags(devnm, O_RDONLY|O_EXCL))) < 0 || strcmp(fd2devnm(fd), devnm) != 0) && container[0] && mdmon_running(container) && count) { + /* Can't open, so something might be wrong. However it + * is a container, so we might be racing with mdmon, so + * retry for a bit. + */ if (fd >= 0) close(fd); flush_mdmon(container); @@ -252,13 +252,13 @@ int Manage_stop(char *devname, int fd, int verbose, int will_retry) if (fd >= 0) close(fd); if (verbose >= 0) - pr_err("Cannot get exclusive access to %s:" - "Perhaps a running " - "process, mounted filesystem " - "or active volume group?\n", + pr_err("Cannot get exclusive access to %s:Perhaps a running process, mounted filesystem or active volume group?\n", devname); return 1; } + /* If this is an mdmon managed array, just write 'inactive' + * to the array state and let mdmon clear up. + */ if (mdi && mdi->array.level > 0 && is_subarray(mdi->text_version)) { @@ -266,7 +266,7 @@ int Manage_stop(char *devname, int fd, int verbose, int will_retry) /* This is mdmon managed. */ close(fd); - /* As we have an O_EXCL open, any use of the device + /* As we had an O_EXCL open, any use of the device * which blocks STOP_ARRAY is probably a transient use, * so it is reasonable to retry for a while - 5 seconds. */ @@ -293,8 +293,7 @@ int Manage_stop(char *devname, int fd, int verbose, int will_retry) fd = open_dev_excl(devnm); if (fd < 0) { if (verbose >= 0) - pr_err("failed to completely stop %s" - ": Device is busy\n", + pr_err("failed to completely stop %s: Device is busy\n", devname); rv = 1; goto out; @@ -320,9 +319,8 @@ int Manage_stop(char *devname, int fd, int verbose, int will_retry) metadata_container_matches(m->metadata_version+9, devnm)) { if (verbose >= 0) - pr_err("Cannot stop container %s: " - "member %s still active\n", - devname, m->dev); + pr_err("Cannot stop container %s: member %s still active\n", + devname, m->devnm); free_mdstat(mds); rv = 1; goto out; @@ -346,9 +344,7 @@ int Manage_stop(char *devname, int fd, int verbose, int will_retry) sysfs_attribute_available(mdi, NULL, "reshape_direction") && sysfs_get_str(mdi, NULL, "sync_action", buf, 20) > 0 && strcmp(buf, "reshape\n") == 0 && - sysfs_get_two(mdi, NULL, "raid_disks", &rd1, &rd2) == 2 && - sysfs_set_str(mdi, NULL, "sync_action", "frozen") == 0) { - /* Array is frozen */ + sysfs_get_two(mdi, NULL, "raid_disks", &rd1, &rd2) == 2) { unsigned long long position, curr; unsigned long long chunk1, chunk2; unsigned long long rddiv, chunkdiv; @@ -359,12 +355,28 @@ int Manage_stop(char *devname, int fd, int verbose, int will_retry) int delay; int scfd; + delay = 40; + while (rd1 > rd2 && delay > 0 && + sysfs_get_ll(mdi, NULL, "sync_max", &old_sync_max) == 0) { + /* must be in the critical section - wait a bit */ + delay -= 1; + usleep(100000); + } + + if (sysfs_set_str(mdi, NULL, "sync_action", "frozen") != 0) + goto done; + /* Array is frozen */ + rd1 -= mdi->array.level == 6 ? 2 : 1; rd2 -= mdi->array.level == 6 ? 2 : 1; sysfs_get_str(mdi, NULL, "reshape_direction", buf, sizeof(buf)); if (strncmp(buf, "back", 4) == 0) backwards = 1; - sysfs_get_ll(mdi, NULL, "reshape_position", &position); + if (sysfs_get_ll(mdi, NULL, "reshape_position", &position) != 0) { + /* reshape must have finished now */ + sysfs_set_str(mdi, NULL, "sync_action", "idle"); + goto done; + } sysfs_get_two(mdi, NULL, "chunk_size", &chunk1, &chunk2); chunk1 /= 512; chunk2 /= 512; @@ -381,9 +393,20 @@ int Manage_stop(char *devname, int fd, int verbose, int will_retry) size &= ~(chunk1-1); size &= ~(chunk2-1); /* rd1 must be smaller */ + /* Reshape may have progressed further backwards than + * recorded, so target even further back (hence "-1") + */ position = (position / sectors - 1) * sectors; + /* rd1 is always the conversion factor between 'sync' + * position and 'reshape' position. + * We read 1 "new" stripe worth of data from where-ever, + * and when write out that full stripe. + */ sync_max = size - position/rd1; } else { + /* Reshape will very likely be beyond position, and it may + * be too late to stop at '+1', so aim for '+2' + */ position = (position / sectors + 2) * sectors; sync_max = position/rd1; } @@ -406,6 +429,7 @@ int Manage_stop(char *devname, int fd, int verbose, int will_retry) delay = 3000; scfd = sysfs_open(mdi->sys_name, NULL, "sync_completed"); while (scfd >= 0 && delay > 0 && old_sync_max > 0) { + unsigned long long max_completed; sysfs_get_ll(mdi, NULL, "reshape_position", &curr); sysfs_fd_get_str(scfd, buf, sizeof(buf)); if (strncmp(buf, "none", 4) == 0) { @@ -419,7 +443,10 @@ int Manage_stop(char *devname, int fd, int verbose, int will_retry) break; } - if (sysfs_fd_get_ll(scfd, &completed) == 0 && + if (sysfs_fd_get_two(scfd, &completed, + &max_completed) == 2 && + /* 'completed' sometimes reads as max-uulong */ + completed < max_completed && (completed > sync_max || (completed == sync_max && curr != position))) { while (completed > sync_max) { @@ -443,6 +470,7 @@ int Manage_stop(char *devname, int fd, int verbose, int will_retry) close(scfd); } +done: /* As we have an O_EXCL open, any use of the device * which blocks STOP_ARRAY is probably a transient use, @@ -460,9 +488,7 @@ int Manage_stop(char *devname, int fd, int verbose, int will_retry) pr_err("failed to stop array %s: %s\n", devname, strerror(errno)); if (errno == EBUSY) - cont_err("Perhaps a running " - "process, mounted filesystem " - "or active volume group?\n"); + cont_err("Perhaps a running process, mounted filesystem or active volume group?\n"); } rv = 1; goto out; @@ -643,6 +669,15 @@ int attempt_re_add(int fd, int tfd, struct mddev_dev *dv, disc.number = mdi.disk.number; disc.raid_disk = mdi.disk.raid_disk; disc.state = mdi.disk.state; + if (array->state & (1 << MD_SB_CLUSTERED)) { + /* extra flags are needed when adding to a cluster as + * there are two cases to distinguish + */ + if (dv->disposition == 'c') + disc.state |= (1 << MD_DISK_CANDIDATE); + else + disc.state |= (1 << MD_DISK_CLUSTER_ADD); + } if (dv->writemostly == 1) disc.state |= 1 << MD_DISK_WRITEMOSTLY; if (dv->writemostly == 2) @@ -652,8 +687,7 @@ int attempt_re_add(int fd, int tfd, struct mddev_dev *dv, int rv = -1; tfd = dev_open(dv->devname, O_RDWR); if (tfd < 0) { - pr_err("failed to open %s for" - " superblock update during re-add\n", dv->devname); + pr_err("failed to open %s for superblock update during re-add\n", dv->devname); return -1; } @@ -673,8 +707,7 @@ int attempt_re_add(int fd, int tfd, struct mddev_dev *dv, rv = dev_st->ss->store_super(dev_st, tfd); close(tfd); if (rv != 0) { - pr_err("failed to update" - " superblock during re-add\n"); + pr_err("failed to update superblock during re-add\n"); return -1; } } @@ -700,7 +733,8 @@ skip_re_add: int Manage_add(int fd, int tfd, struct mddev_dev *dv, struct supertype *tst, mdu_array_info_t *array, int force, int verbose, char *devname, - char *update, unsigned long rdev, unsigned long long array_size) + char *update, unsigned long rdev, unsigned long long array_size, + int raid_slot) { unsigned long long ldsize; struct supertype *dev_st = NULL; @@ -717,17 +751,13 @@ int Manage_add(int fd, int tfd, struct mddev_dev *dv, if (tst->ss == &super0 && ldsize > 4ULL*1024*1024*1024*1024) { /* More than 4TB is wasted on v0.90 */ if (!force) { - pr_err("%s is larger than %s can " - "effectively use.\n" - " Add --force is you " - "really want to add this device.\n", + pr_err("%s is larger than %s can effectively use.\n" + " Add --force is you really want to add this device.\n", dv->devname, devname); return -1; } - pr_err("%s is larger than %s can " - "effectively use.\n" - " Adding anyway as --force " - "was given.\n", + pr_err("%s is larger than %s can effectively use.\n" + " Adding anyway as --force was given.\n", dv->devname, devname); } if (!tst->ss->external && @@ -795,7 +825,9 @@ int Manage_add(int fd, int tfd, struct mddev_dev *dv, } /* Make sure device is large enough */ - if (tst->ss->avail_size(tst, ldsize/512, INVALID_SECTORS) < + if (dv->disposition != 'j' && /* skip size check for Journal */ + tst->sb && + tst->ss->avail_size(tst, ldsize/512, INVALID_SECTORS) < array_size) { if (dv->disposition == 'M') return 0; @@ -841,7 +873,7 @@ int Manage_add(int fd, int tfd, struct mddev_dev *dv, int d; int found = 0; - for (d = 0; d < MAX_DISKS && found < array->active_disks; d++) { + for (d = 0; d < MAX_DISKS && found < array->nr_disks; d++) { disc.number = d; if (ioctl(fd, GET_DISK_INFO, &disc)) continue; @@ -893,10 +925,36 @@ int Manage_add(int fd, int tfd, struct mddev_dev *dv, } disc.major = major(rdev); disc.minor = minor(rdev); - disc.number =j; + if (raid_slot < 0) + disc.number = j; + else + disc.number = raid_slot; disc.state = 0; + + /* only add journal to array that supports journaling */ + if (dv->disposition == 'j') { + struct mdinfo mdi; + struct mdinfo *mdp; + + mdp = sysfs_read(fd, NULL, GET_ARRAY_STATE); + + if (strncmp(mdp->sysfs_array_state, "readonly", 8) != 0) { + pr_err("%s is not readonly, cannot add journal.\n", devname); + return -1; + } + + tst->ss->getinfo_super(tst, &mdi, NULL); + if (mdi.journal_device_required == 0) { + pr_err("%s does not support journal device.\n", devname); + return -1; + } + disc.raid_disk = 0; + } + if (array->not_persistent==0) { int dfd; + if (dv->disposition == 'j') + disc.state |= (1 << MD_DISK_JOURNAL) | (1 << MD_DISK_SYNC); if (dv->writemostly == 1) disc.state |= 1 << MD_DISK_WRITEMOSTLY; dfd = dev_open(dv->devname, O_RDWR | O_EXCL|O_DIRECT); @@ -934,6 +992,14 @@ int Manage_add(int fd, int tfd, struct mddev_dev *dv, } free(used); } + + if (array->state & (1 << MD_SB_CLUSTERED)) { + if (dv->disposition == 'c') + disc.state |= (1 << MD_DISK_CANDIDATE); + else + disc.state |= (1 << MD_DISK_CLUSTER_ADD); + } + if (dv->writemostly == 1) disc.state |= (1 << MD_DISK_WRITEMOSTLY); if (tst->ss->external) { @@ -949,8 +1015,7 @@ int Manage_add(int fd, int tfd, struct mddev_dev *dv, container_fd = open_dev_excl(devnm); if (container_fd < 0) { - pr_err("add failed for %s:" - " could not get exclusive access to container\n", + pr_err("add failed for %s: could not get exclusive access to container\n", dv->devname); tst->ss->free_super(tst); return -1; @@ -989,8 +1054,7 @@ int Manage_add(int fd, int tfd, struct mddev_dev *dv, * would block add_disk */ tst->ss->free_super(tst); if (sysfs_add_disk(sra, &new_mdi, 0) != 0) { - pr_err("add new device to external metadata" - " failed for %s\n", dv->devname); + pr_err("add new device to external metadata failed for %s\n", dv->devname); close(container_fd); sysfs_free(sra); return -1; @@ -1001,10 +1065,20 @@ int Manage_add(int fd, int tfd, struct mddev_dev *dv, } else { tst->ss->free_super(tst); if (ioctl(fd, ADD_NEW_DISK, &disc)) { - pr_err("add new device failed for %s as %d: %s\n", - dv->devname, j, strerror(errno)); + if (dv->disposition == 'j') + pr_err("Failed to hot add %s as journal, " + "please try restart %s.\n", dv->devname, devname); + else + pr_err("add new device failed for %s as %d: %s\n", + dv->devname, j, strerror(errno)); return -1; } + if (dv->disposition == 'j') { + pr_err("Journal added successfully, making %s read-write\n", devname); + if (Manage_ro(devname, fd, -1)) + pr_err("Failed to make %s read-write\n", devname); + } + } if (verbose >= 0) pr_err("added %s\n", dv->devname); @@ -1032,8 +1106,7 @@ int Manage_remove(struct supertype *tst, int fd, struct mddev_dev *dv, strcpy(devnm, fd2devnm(fd)); lfd = open_dev_excl(devnm); if (lfd < 0) { - pr_err("Cannot get exclusive access " - " to container - odd\n"); + pr_err("Cannot get exclusive access to container - odd\n"); return -1; } /* We may not be able to check on holders in @@ -1093,8 +1166,7 @@ int Manage_remove(struct supertype *tst, int fd, struct mddev_dev *dv, } } if (err) { - pr_err("hot remove failed " - "for %s: %s\n", dv->devname, + pr_err("hot remove failed for %s: %s\n", dv->devname, strerror(errno)); if (lfd >= 0) close(lfd); @@ -1239,6 +1311,7 @@ int Manage_subdevs(char *devname, int fd, * try HOT_ADD_DISK * If that fails EINVAL, try ADD_NEW_DISK * 'S' - add the device as a spare - don't try re-add + * 'j' - add the device as a journal device * 'A' - re-add the device * 'r' - remove the device: HOT_REMOVE_DISK * device can be 'faulty' or 'detached' in which case all @@ -1257,6 +1330,7 @@ int Manage_subdevs(char *devname, int fd, * variant on 'A' * 'F' - Another variant of 'A', where the device was faulty * so must be removed from the array first. + * 'c' - confirm the device as found (for clustered environments) * * For 'f' and 'r', the device can also be a kernel-internal * name such as 'sdb'. @@ -1270,8 +1344,10 @@ int Manage_subdevs(char *devname, int fd, int sysfd = -1; int count = 0; /* number of actions taken */ struct mdinfo info; + struct mdinfo devinfo; int frozen = 0; int busy = 0; + int raid_slot = -1; if (ioctl(fd, GET_ARRAY_INFO, &array)) { pr_err("Cannot get array info for %s\n", @@ -1300,12 +1376,22 @@ int Manage_subdevs(char *devname, int fd, int rv; int mj,mn; + raid_slot = -1; + if (dv->disposition == 'c') { + rv = parse_cluster_confirm_arg(dv->devname, + &dv->devname, + &raid_slot); + if (rv) { + pr_err("Could not get the devname of cluster\n"); + goto abort; + } + } + if (strcmp(dv->devname, "failed") == 0 || strcmp(dv->devname, "faulty") == 0) { if (dv->disposition != 'A' && dv->disposition != 'r') { - pr_err("%s only meaningful " - "with -r or --re-add, not -%c\n", + pr_err("%s only meaningful with -r or --re-add, not -%c\n", dv->devname, dv->disposition); goto abort; } @@ -1315,8 +1401,7 @@ int Manage_subdevs(char *devname, int fd, } if (strcmp(dv->devname, "detached") == 0) { if (dv->disposition != 'r' && dv->disposition != 'f') { - pr_err("%s only meaningful " - "with -r of -f, not -%c\n", + pr_err("%s only meaningful with -r of -f, not -%c\n", dv->devname, dv->disposition); goto abort; } @@ -1327,9 +1412,13 @@ int Manage_subdevs(char *devname, int fd, if (strcmp(dv->devname, "missing") == 0) { struct mddev_dev *add_devlist = NULL; struct mddev_dev **dp; + if (dv->disposition == 'c') { + rv = ioctl(fd, CLUSTERED_DISK_NACK, NULL); + break; + } + if (dv->disposition != 'A') { - pr_err("'missing' only meaningful " - "with --re-add\n"); + pr_err("'missing' only meaningful with --re-add\n"); goto abort; } add_devlist = conf_get_devs(); @@ -1381,8 +1470,7 @@ int Manage_subdevs(char *devname, int fd, int found = 0; char dname[55]; if (dv->disposition != 'r' && dv->disposition != 'f') { - pr_err("%s only meaningful " - "with -r or -f, not -%c\n", + pr_err("%s only meaningful with -r or -f, not -%c\n", dv->devname, dv->disposition); goto abort; } @@ -1402,8 +1490,7 @@ int Manage_subdevs(char *devname, int fd, if (!found) { sysfd = sysfs_open(fd2devnm(fd), dname, "state"); if (sysfd < 0) { - pr_err("%s does not appear " - "to be a component of %s\n", + pr_err("%s does not appear to be a component of %s\n", dv->devname, devname); goto abort; } @@ -1457,16 +1544,28 @@ int Manage_subdevs(char *devname, int fd, goto abort; case 'a': case 'S': /* --add-spare */ + case 'j': /* --add-journal */ case 'A': case 'M': /* --re-add missing */ case 'F': /* --re-add faulty */ + case 'c': /* --cluster-confirm */ /* add the device */ if (subarray) { - pr_err("Cannot add disks to a" - " \'member\' array, perform this" - " operation on the parent container\n"); + pr_err("Cannot add disks to a \'member\' array, perform this operation on the parent container\n"); goto abort; } + + /* Let's first try to write re-add to sysfs */ + if (rdev != 0 && + (dv->disposition == 'A' || dv->disposition == 'F')) { + sysfs_init_dev(&devinfo, rdev); + if (sysfs_set_str(&info, &devinfo, "state", "re-add") == 0) { + pr_err("re-add %s to %s succeed\n", + dv->devname, info.sys_name); + break; + } + } + if (dv->disposition == 'F') /* Need to remove first */ ioctl(fd, HOT_REMOVE_DISK, rdev); @@ -1495,7 +1594,7 @@ int Manage_subdevs(char *devname, int fd, } rv = Manage_add(fd, tfd, dv, tst, &array, force, verbose, devname, update, - rdev, array_size); + rdev, array_size, raid_slot); close(tfd); tfd = -1; if (rv < 0) @@ -1507,9 +1606,7 @@ int Manage_subdevs(char *devname, int fd, case 'r': /* hot remove */ if (subarray) { - pr_err("Cannot remove disks from a" - " \'member\' array, perform this" - " operation on the parent container\n"); + pr_err("Cannot remove disks from a \'member\' array, perform this operation on the parent container\n"); rv = -1; } else rv = Manage_remove(tst, fd, dv, sysfd, @@ -1547,9 +1644,7 @@ int Manage_subdevs(char *devname, int fd, break; case 'R': /* Mark as replaceable */ if (subarray) { - pr_err("Cannot replace disks in a" - " \'member\' array, perform this" - " operation on the parent container\n"); + pr_err("Cannot replace disks in a \'member\' array, perform this operation on the parent container\n"); rv = -1; } else { if (!frozen) { @@ -310,15 +310,11 @@ static int check_one_sharer(int scan) rv = stat(dir, &buf); if (rv != -1) { if (scan) { - pr_err("Only one " - "autorebuild process allowed" - " in scan mode, aborting\n"); + pr_err("Only one autorebuild process allowed in scan mode, aborting\n"); fclose(fp); return 1; } else { - pr_err("Warning: One" - " autorebuild process already" - " running.\n"); + pr_err("Warning: One autorebuild process already running.\n"); } } fclose(fp); @@ -326,14 +322,11 @@ static int check_one_sharer(int scan) if (scan) { if (mkdir(MDMON_DIR, S_IRWXU) < 0 && errno != EEXIST) { - pr_err("Can't create " - "autorebuild.pid file\n"); + pr_err("Can't create autorebuild.pid file\n"); } else { fp = fopen(path, "w"); if (!fp) - pr_err("Cannot create" - " autorebuild.pid" - "file\n"); + pr_err("Cannot create autorebuild.pidfile\n"); else { pid = getpid(); fprintf(fp, "%d\n", pid); @@ -381,24 +374,21 @@ static void alert(char *event, char *dev, char *disc, struct alert_info *info) if (info->mailfrom) fprintf(mp, "From: %s\n", info->mailfrom); else - fprintf(mp, "From: " Name " monitoring <root>\n"); + fprintf(mp, "From: %s monitoring <root>\n", Name); fprintf(mp, "To: %s\n", info->mailaddr); fprintf(mp, "Subject: %s event on %s:%s\n\n", event, dev, hname); fprintf(mp, - "This is an automatically generated" - " mail message from " Name "\n"); + "This is an automatically generated mail message from %s\n", Name); fprintf(mp, "running on %s\n\n", hname); fprintf(mp, - "A %s event had been detected on" - " md device %s.\n\n", event, dev); + "A %s event had been detected on md device %s.\n\n", event, dev); if (disc && disc[0] != ' ') fprintf(mp, - "It could be related to" - " component device %s.\n\n", disc); + "It could be related to component device %s.\n\n", disc); if (disc && disc[0] == ' ') fprintf(mp, "Extra information:%s.\n\n", disc); @@ -409,8 +399,7 @@ static void alert(char *event, char *dev, char *disc, struct alert_info *info) char buf[8192]; int n; fprintf(mp, - "\nP.S. The /proc/mdstat file" - " currently contains the following:\n\n"); + "\nP.S. The /proc/mdstat file currently contains the following:\n\n"); while ( (n=fread(buf, 1, sizeof(buf), mdstat)) > 0) n=fwrite(buf, 1, n, mp); fclose(mdstat); @@ -437,10 +426,13 @@ static void alert(char *event, char *dev, char *disc, struct alert_info *info) else priority = LOG_INFO; - if (disc) + if (disc && disc[0] != ' ') syslog(priority, - "%s event detected on md device %s," - " component device %s", event, dev, disc); + "%s event detected on md device %s, component device %s", event, dev, disc); + else if (disc) + syslog(priority, + "%s event detected on md device %s: %s", + event, dev, disc); else syslog(priority, "%s event detected on md device %s", @@ -460,7 +452,7 @@ static int check_array(struct state *st, struct mdstat_ent *mdstat, mdu_array_info_t array; struct mdstat_ent *mse = NULL, *mse2; char *dev = st->devname; - int fd; + int fd = -1; int i; int remaining_disks; int last_disk; @@ -468,6 +460,33 @@ static int check_array(struct state *st, struct mdstat_ent *mdstat, if (test) alert("TestMessage", dev, NULL, ainfo); + if (st->devnm[0]) + fd = open("/sys/block", O_RDONLY|O_DIRECTORY); + if (fd >= 0) { + /* Don't open the device unless it is present and + * active in sysfs. + */ + char buf[10]; + close(fd); + fd = sysfs_open(st->devnm, NULL, "array_state"); + if (fd < 0 || + read(fd, buf, 10) < 5 || + strncmp(buf,"clear",5) == 0 || + strncmp(buf,"inact",5) == 0) { + if (fd >= 0) + close(fd); + fd = sysfs_open(st->devnm, NULL, "level"); + if (fd < 0 || read(fd, buf, 10) != 0) { + if (fd >= 0) + close(fd); + if (!st->err) + alert("DeviceDisappeared", dev, NULL, ainfo); + st->err++; + return 0; + } + } + close(fd); + } fd = open(dev, O_RDONLY); if (fd < 0) { if (!st->err) @@ -488,7 +507,7 @@ static int check_array(struct state *st, struct mdstat_ent *mdstat, */ if (array.level == 0 || array.level == -1) { if (!st->err && !st->from_config) - alert("DeviceDisappeared", dev, "Wrong-Level", ainfo); + alert("DeviceDisappeared", dev, " Wrong-Level", ainfo); st->err++; close(fd); return 0; @@ -668,6 +687,7 @@ static int add_new_arrays(struct mdstat_ent *mdstat, struct state **statelist, { struct mdstat_ent *mse; int new_found = 0; + char *name; for (mse=mdstat; mse; mse=mse->next) if (mse->devnm[0] && @@ -678,7 +698,14 @@ static int add_new_arrays(struct mdstat_ent *mdstat, struct state **statelist, struct state *st = xcalloc(1, sizeof *st); mdu_array_info_t array; int fd; - st->devname = xstrdup(get_md_name(mse->devnm)); + + name = get_md_name(mse->devnm); + if (!name) { + free(st); + continue; + } + + st->devname = xstrdup(name); if ((fd = open(st->devname, O_RDONLY)) < 0 || ioctl(fd, GET_ARRAY_INFO, &array)< 0) { /* no such array */ @@ -966,6 +993,7 @@ int Wait(char *dev) struct stat stb; char devnm[32]; int rv = 1; + int frozen_remaining = 3; if (stat(dev, &stb) != 0) { pr_err("Cannot find %s: %s\n", dev, @@ -982,7 +1010,7 @@ int Wait(char *dev) if (strcmp(e->devnm, devnm) == 0) break; - if (e->percent == RESYNC_NONE) { + if (e && e->percent == RESYNC_NONE) { /* We could be in the brief pause before something * starts. /proc/mdstat doesn't show that, but * sync_action does. @@ -992,8 +1020,15 @@ int Wait(char *dev) sysfs_init(&mdi, -1, devnm); if (sysfs_get_str(&mdi, NULL, "sync_action", buf, 20) > 0 && - strcmp(buf,"idle\n") != 0) + strcmp(buf,"idle\n") != 0) { e->percent = RESYNC_UNKNOWN; + if (strcmp(buf, "frozen\n") == 0) { + if (frozen_remaining == 0) + e->percent = RESYNC_NONE; + else + frozen_remaining -= 1; + } + } } if (!e || e->percent == RESYNC_NONE) { if (e && e->metadata_version && @@ -1035,8 +1070,7 @@ int WaitClean(char *dev, int sock, int verbose) mdi = sysfs_read(fd, devnm, GET_VERSION|GET_LEVEL|GET_SAFEMODE); if (!mdi) { if (verbose) - pr_err("Failed to read sysfs attributes for " - "%s\n", dev); + pr_err("Failed to read sysfs attributes for %s\n", dev); close(fd); return 0; } @@ -1,7 +1,7 @@ /* * mdadm - manage Linux "md" devices aka RAID arrays. * - * Copyright (C) 2001-2014 Neil Brown <neilb@suse.de> + * Copyright (C) 2001-2016 Neil Brown <neilb@suse.com> * * * This program is free software; you can redistribute it and/or modify @@ -25,12 +25,12 @@ #include "mdadm.h" #ifndef VERSION -#define VERSION "3.3.2" +#define VERSION "3.4" #endif #ifndef VERS_DATE -#define VERS_DATE "21st August 2014" +#define VERS_DATE "28th January 2016" #endif -char Version[] = Name " - v" VERSION " - " VERS_DATE "\n"; +char Version[] = "mdadm - v" VERSION " - " VERS_DATE "\n"; /* * File: ReadMe.c @@ -140,6 +140,9 @@ struct option long_options[] = { {"homehost", 1, 0, HomeHost}, {"symlinks", 1, 0, Symlinks}, {"data-offset",1, 0, DataOffset}, + {"nodes",1, 0, Nodes}, /* also for --assemble */ + {"home-cluster",1, 0, ClusterName}, + {"write-journal",1, 0, WriteJournal}, /* For assemble */ {"uuid", 1, 0, 'u'}, @@ -154,6 +157,7 @@ struct option long_options[] = { /* Management */ {"add", 0, 0, Add}, {"add-spare", 0, 0, AddSpare}, + {"add-journal", 0, 0, AddJournal}, {"remove", 0, 0, Remove}, {"fail", 0, 0, Fail}, {"set-faulty",0, 0, Fail}, @@ -167,6 +171,7 @@ struct option long_options[] = { {"wait", 0, 0, WaitOpt}, {"wait-clean", 0, 0, Waitclean }, {"action", 1, 0, Action }, + {"cluster-confirm", 0, 0, ClusterConfirm}, /* For Detail/Examine */ {"brief", 0, 0, Brief}, @@ -372,6 +377,7 @@ char Help_create[] = " --name= -N : Textual name for array - max 32 characters\n" " --bitmap-chunk= : bitmap chunksize in Kilobytes.\n" " --delay= -d : bitmap update delay in seconds.\n" +" --write-journal= : Specify journal device for RAID-4/5/6 array\n" "\n" ; @@ -593,7 +599,7 @@ char Help_incr[] = ; char Help_config[] = -"The /etc/mdadm.conf config file:\n\n" +"The /etc/mdadm/mdadm.conf config file:\n\n" " The config file contains, apart from blank lines and comment lines that\n" " start with a hash(#), array lines, device lines, and various\n" " configuration lines.\n" @@ -20,7 +20,7 @@ #include "mdadm.h" -inline void sb_le_to_cpu(bitmap_super_t *sb) +static inline void sb_le_to_cpu(bitmap_super_t *sb) { sb->magic = __le32_to_cpu(sb->magic); sb->version = __le32_to_cpu(sb->version); @@ -32,9 +32,11 @@ inline void sb_le_to_cpu(bitmap_super_t *sb) sb->daemon_sleep = __le32_to_cpu(sb->daemon_sleep); sb->sync_size = __le64_to_cpu(sb->sync_size); sb->write_behind = __le32_to_cpu(sb->write_behind); + sb->nodes = __le32_to_cpu(sb->nodes); + sb->sectors_reserved = __le32_to_cpu(sb->sectors_reserved); } -inline void sb_cpu_to_le(bitmap_super_t *sb) +static inline void sb_cpu_to_le(bitmap_super_t *sb) { sb_le_to_cpu(sb); /* these are really the same thing */ } @@ -74,7 +76,7 @@ typedef struct bitmap_info_s { } bitmap_info_t; /* count the dirty bits in the first num_bits of byte */ -inline int count_dirty_bits_byte(char byte, int num_bits) +static inline int count_dirty_bits_byte(char byte, int num_bits) { int num = 0; @@ -140,8 +142,7 @@ bitmap_info_t *bitmap_fd_read(int fd, int brief) info = xmalloc(sizeof(*info)); if (n < sizeof(info->sb)) { - pr_err("failed to read superblock of bitmap " - "file: %s\n", strerror(errno)); + pr_err("failed to read superblock of bitmap file: %s\n", strerror(errno)); free(info); free(buf); return NULL; @@ -182,8 +183,7 @@ bitmap_info_t *bitmap_fd_read(int fd, int brief) } if (read_bits < total_bits) { /* file truncated... */ - pr_err("WARNING: bitmap file is not large " - "enough for array size %llu!\n\n", + pr_err("WARNING: bitmap file is not large enough for array size %llu!\n\n", (unsigned long long)info->sb.sync_size); total_bits = read_bits; } @@ -221,8 +221,12 @@ int bitmap_file_open(char *filename, struct supertype **stp) pr_err("No bitmap possible with %s metadata\n", st->ss->name); return -1; - } else - st->ss->locate_bitmap(st, fd); + } else { + if (st->ss->locate_bitmap(st, fd)) { + pr_err("%s doesn't have bitmap\n", filename); + fd = -1; + } + } *stp = st; } else { @@ -260,7 +264,7 @@ int ExamineBitmap(char *filename, int brief, struct supertype *st) int rv = 1; char buf[64]; int swap; - int fd; + int fd, i; __u32 uuid32[4]; fd = bitmap_file_open(filename, &st); @@ -287,7 +291,7 @@ int ExamineBitmap(char *filename, int brief, struct supertype *st) } printf(" Version : %d\n", sb->version); if (sb->version < BITMAP_MAJOR_LO || - sb->version > BITMAP_MAJOR_HI) { + sb->version > BITMAP_MAJOR_CLUSTERED) { pr_err("unknown bitmap version %d, either the bitmap file\n", sb->version); pr_err("is corrupted or you need to upgrade your tools\n"); @@ -317,9 +321,13 @@ int ExamineBitmap(char *filename, int brief, struct supertype *st) uuid32[2], uuid32[3]); - printf(" Events : %llu\n", (unsigned long long)sb->events); - printf(" Events Cleared : %llu\n", (unsigned long long)sb->events_cleared); - printf(" State : %s\n", bitmap_state(sb->state)); + if (sb->nodes == 0) { + printf(" Events : %llu\n", (unsigned long long)sb->events); + printf(" Events Cleared : %llu\n", (unsigned long long)sb->events_cleared); + printf(" State : %s\n", bitmap_state(sb->state)); + + } + printf(" Chunksize : %s\n", human_chunksize(sb->chunksize)); printf(" Daemon : %ds flush period\n", sb->daemon_sleep); if (sb->write_behind) @@ -329,11 +337,40 @@ int ExamineBitmap(char *filename, int brief, struct supertype *st) printf(" Write Mode : %s\n", buf); printf(" Sync Size : %llu%s\n", (unsigned long long)sb->sync_size/2, human_size(sb->sync_size * 512)); - if (brief) - goto free_info; - printf(" Bitmap : %llu bits (chunks), %llu dirty (%2.1f%%)\n", - info->total_bits, info->dirty_bits, - 100.0 * info->dirty_bits / (info->total_bits?:1)); + + if (sb->nodes == 0) { + if (brief) + goto free_info; + printf(" Bitmap : %llu bits (chunks), %llu dirty (%2.1f%%)\n", + info->total_bits, info->dirty_bits, + 100.0 * info->dirty_bits / (info->total_bits?:1)); + } else { + printf(" Cluster nodes : %d\n", sb->nodes); + printf(" Cluster name : %-64s\n", sb->cluster_name); + for (i = 0; i < (int)sb->nodes; i++) { + if (i) { + free(info); + info = bitmap_fd_read(fd, brief); + sb = &info->sb; + } + if (sb->magic != BITMAP_MAGIC) + pr_err("invalid bitmap magic 0x%x, the bitmap file appears to be corrupted\n", sb->magic); + + printf(" Node Slot : %d\n", i); + printf(" Events : %llu\n", + (unsigned long long)sb->events); + printf(" Events Cleared : %llu\n", + (unsigned long long)sb->events_cleared); + printf(" State : %s\n", bitmap_state(sb->state)); + if (brief) + continue; + printf(" Bitmap : %llu bits (chunks), %llu dirty (%2.1f%%)\n", + info->total_bits, info->dirty_bits, + 100.0 * info->dirty_bits / (info->total_bits?:1)); + + } + } + free_info: free(info); return rv; @@ -12,6 +12,7 @@ */ #define BITMAP_MAJOR_HI 4 #define BITMAP_MAJOR_HOSTENDIAN 3 +#define BITMAP_MAJOR_CLUSTERED 5 #define BITMAP_MINOR 39 @@ -154,8 +155,11 @@ typedef struct bitmap_super_s { __u32 chunksize; /* 52 the bitmap chunk size in bytes */ __u32 daemon_sleep; /* 56 seconds between disk flushes */ __u32 write_behind; /* 60 number of outstanding write-behind writes */ - - __u8 pad[256 - 64]; /* set to zero */ + __u32 sectors_reserved; /* 64 number of 512-byte sectors that are + * reserved for the bitmap. */ + __u32 nodes; /* 68 the maximum number of nodes in cluster. */ + __u8 cluster_name[64]; /* 72 cluster name to which this md belongs */ + __u8 pad[256 - 136]; /* set to zero */ } bitmap_super_t; /* notes: @@ -63,6 +63,9 @@ * but may not wrap over lines * */ +#ifndef _POSIX_C_SOURCE +#define _POSIX_C_SOURCE 200809L +#endif #ifndef CONFFILE #define CONFFILE "/etc/mdadm.conf" @@ -77,7 +80,7 @@ char DefaultAltConfFile[] = CONFFILE2; char DefaultAltConfDir[] = CONFFILE2 ".d"; enum linetype { Devices, Array, Mailaddr, Mailfrom, Program, CreateDev, - Homehost, AutoMode, Policy, PartPolicy, LTEnd }; + Homehost, HomeCluster, AutoMode, Policy, PartPolicy, LTEnd }; char *keywords[] = { [Devices] = "devices", [Array] = "array", @@ -86,6 +89,7 @@ char *keywords[] = { [Program] = "program", [CreateDev]= "create", [Homehost] = "homehost", + [HomeCluster] = "homecluster", [AutoMode] = "auto", [Policy] = "policy", [PartPolicy]="part-policy", @@ -167,10 +171,10 @@ struct mddev_dev *load_containers(void) !is_subarray(&ent->metadata_version[9])) { d = xmalloc(sizeof(*d)); memset(d, 0, sizeof(*d)); - me = map_by_devnm(&map, ent->dev); + me = map_by_devnm(&map, ent->devnm); if (me) d->devname = xstrdup(me->path); - else if (asprintf(&d->devname, "/dev/%s", ent->dev) < 0) { + else if (asprintf(&d->devname, "/dev/%s", ent->devnm) < 0) { free(d); continue; } @@ -396,14 +400,12 @@ void arrayline(char *line) ) { /* This is acceptable */; if (mis.devname) - pr_err("only give one " - "device per ARRAY line: %s and %s\n", + pr_err("only give one device per ARRAY line: %s and %s\n", mis.devname, w); else mis.devname = w; }else { - pr_err("%s is an invalid name for " - "an md device - ignored.\n", w); + pr_err("%s is an invalid name for an md device - ignored.\n", w); } } else if (strncasecmp(w, "uuid=", 5)==0 ) { if (mis.uuid_set) @@ -564,6 +566,21 @@ void homehostline(char *line) } } +static char *home_cluster = NULL; +void homeclusterline(char *line) +{ + char *w; + + for (w=dl_next(line); w != line ; w=dl_next(w)) { + if (home_cluster == NULL) { + if (strcasecmp(w, "<none>")==0) + home_cluster = xstrdup(""); + else + home_cluster = xstrdup(w); + } + } +} + char auto_yes[] = "yes"; char auto_no[] = "no"; char auto_homehost[] = "homehost"; @@ -726,6 +743,9 @@ void conf_file(FILE *f) case Homehost: homehostline(line); break; + case HomeCluster: + homeclusterline(line); + break; case AutoMode: autoline(line); break; @@ -886,6 +906,12 @@ char *conf_get_homehost(int *require_homehostp) return home_host; } +char *conf_get_homecluster(void) +{ + load_conffile(); + return home_cluster; +} + struct createinfo *conf_get_create_info(void) { load_conffile(); @@ -1121,8 +1147,7 @@ struct mddev_ident *conf_match(struct supertype *st, !array_list->devices && array_list->super_minor == UnSet) { if (verbose >= 2 && array_list->devname) - pr_err("%s doesn't have any identifying" - " information.\n", + pr_err("%s doesn't have any identifying information.\n", array_list->devname); continue; } @@ -1131,13 +1156,11 @@ struct mddev_ident *conf_match(struct supertype *st, if (match) { if (verbose >= 0) { if (match->devname && array_list->devname) - pr_err("we match both %s and %s - " - "cannot decide which to use.\n", + pr_err("we match both %s and %s - cannot decide which to use.\n", match->devname, array_list->devname); else - pr_err("multiple lines in mdadm.conf" - " match\n"); + pr_err("multiple lines in mdadm.conf match\n"); } if (rvp) *rvp = 2; @@ -1174,8 +1197,7 @@ int conf_verify_devnames(struct mddev_ident *array_list) "%s have the same name: %s\n", nbuf, a1->devname); } else - pr_err("Device %s given twice" - " in config file\n", a1->devname); + pr_err("Device %s given twice in config file\n", a1->devname); return 1; } } diff --git a/crc32c.c b/crc32c.c new file mode 100644 index 00000000..156cba19 --- /dev/null +++ b/crc32c.c @@ -0,0 +1,104 @@ +/* + * Oct 28, 2015 Song Liu simplified the code and port it to mdadm + * + * Aug 8, 2011 Bob Pearson with help from Joakim Tjernlund and George Spelvin + * cleaned up code to current version of sparse and added the slicing-by-8 + * algorithm to the closely similar existing slicing-by-4 algorithm. + * + * Oct 15, 2000 Matt Domsch <Matt_Domsch@dell.com> + * Nicer crc32 functions/docs submitted by linux@horizon.com. Thanks! + * Code was from the public domain, copyright abandoned. Code was + * subsequently included in the kernel, thus was re-licensed under the + * GNU GPL v2. + * + * Oct 12, 2000 Matt Domsch <Matt_Domsch@dell.com> + * Same crc32 function was used in 5 other places in the kernel. + * I made one version, and deleted the others. + * There are various incantations of crc32(). Some use a seed of 0 or ~0. + * Some xor at the end with ~0. The generic crc32() function takes + * seed as an argument, and doesn't xor at the end. Then individual + * users can do whatever they need. + * drivers/net/smc9194.c uses seed ~0, doesn't xor with ~0. + * fs/jffs2 uses seed 0, doesn't xor with ~0. + * fs/partitions/efi.c uses seed ~0, xor's with ~0. + * + * This source code is licensed under the GNU General Public License, + * Version 2. See the file COPYING for more details. + */ + +#include <sys/types.h> +#include <asm/types.h> +#include <stdlib.h> + +/* + * There are multiple 16-bit CRC polynomials in common use, but this is + * *the* standard CRC-32 polynomial, first popularized by Ethernet. + * x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x^1+x^0 + */ +#define CRCPOLY_LE 0xedb88320 +#define CRCPOLY_BE 0x04c11db7 + +/* + * This is the CRC32c polynomial, as outlined by Castagnoli. + * x^32+x^28+x^27+x^26+x^25+x^23+x^22+x^20+x^19+x^18+x^14+x^13+x^11+x^10+x^9+ + * x^8+x^6+x^0 + */ +#define CRC32C_POLY_LE 0x82F63B78 + +/** + * crc32_le_generic() - Calculate bitwise little-endian Ethernet AUTODIN II + * CRC32/CRC32C + * @crc: seed value for computation. ~0 for Ethernet, sometimes 0 for other + * uses, or the previous crc32/crc32c value if computing incrementally. + * @p: pointer to buffer over which CRC32/CRC32C is run + * @len: length of buffer @p + * @polynomial: CRC32/CRC32c LE polynomial + */ +static inline __u32 crc32_le_generic(__u32 crc, unsigned char const *p, + size_t len, __u32 polynomial) +{ + int i; + while (len--) { + crc ^= *p++; + for (i = 0; i < 8; i++) + crc = (crc >> 1) ^ ((crc & 1) ? polynomial : 0); + } + return crc; +} + +__u32 crc32_le(__u32 crc, unsigned char const *p, size_t len) +{ + return crc32_le_generic(crc, p, len, CRCPOLY_LE); +} + +__u32 crc32c_le(__u32 crc, unsigned char const *p, size_t len) +{ + return crc32_le_generic(crc, p, len, CRC32C_POLY_LE); +} + +/** + * crc32_be_generic() - Calculate bitwise big-endian Ethernet AUTODIN II CRC32 + * @crc: seed value for computation. ~0 for Ethernet, sometimes 0 for + * other uses, or the previous crc32 value if computing incrementally. + * @p: pointer to buffer over which CRC32 is run + * @len: length of buffer @p + * @polynomial: CRC32 BE polynomial + */ +static inline __u32 crc32_be_generic(__u32 crc, unsigned char const *p, + size_t len, __u32 polynomial) +{ + int i; + while (len--) { + crc ^= *p++ << 24; + for (i = 0; i < 8; i++) + crc = + (crc << 1) ^ ((crc & 0x80000000) ? polynomial : + 0); + } + return crc; +} + +__u32 crc32_be(__u32 crc, unsigned char const *p, size_t len) +{ + return crc32_be_generic(crc, p, len, CRCPOLY_BE); +} diff --git a/debian/.gitignore b/debian/.gitignore deleted file mode 100644 index b14b640b..00000000 --- a/debian/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -.*.sw? -/*.substvars -/files -/mdadm -/mdadm-udeb -/*.debhelper -/*.log diff --git a/debian/changelog b/debian/changelog index 0a6a95a6..f843ff8a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,73 @@ +mdadm (3.4-2) unstable; urgency=low + + * Reneable incremental assembly + * Rely on udev to assemble incremental arrays + * In environments with systemd rely on mdadm-last-resort@.timer|.service + units to activate degrated raids + * In environments initramfs-tools initrd (no systemd) add local-block + script to do the same after 2/3rds of root delay iteration + * Drop local-top initramfs script + * Drop dependency on initscripts package + * Drop INITRDSTART support + * Drop mdadm-raid init script + * Drop ancient preinst + * In mdadm.init remove dependency on mdadm-raid + * In mdadm.init check, and bail out running in a container + * In mdadm.config drop mdadm/autostart logic + * Drop CREATE stanzas from mkconf and don't include them in the + initramfs. The generated defaults, are the compiled-in defaults. And + the current one generates warnings when running mdadm in the + initramfs, as there is no passwd|group files to resolve root/disk + uid/gid. Closes: 717609 + * Adapt changes and formatting of initramfs hook from Ubuntu + * Bump standards version to 3.9.7, no changes required + * Fix copyright-refers-to-symlink-license + * Closes: #781172, #796624, #769201, #813335, #632401, #804973, #714155, + #770002, #737132, #675452, #726390, #813637, #814036. + + -- Dimitri John Ledkov <xnox@ubuntu.com> Sat, 02 Jul 2016 19:16:01 +0100 + +mdadm (3.4-1) unstable; urgency=medium + + * New upstream release. + * Drop use-tempnode-not-devnode.patch, not needed anymore. + * Drop use-external-blkid.diff. (Closes: #793631) + * Refresh patches. + + -- Dimitri John Ledkov <xnox@ubuntu.com> Fri, 19 Feb 2016 16:18:36 +0000 + +mdadm (3.3.4-1.1) unstable; urgency=medium + + * Non-maintainer upload. + * disable-incremental-assembly.patch: incremental assembly prevents booting + in degraded mode (Closes: #784070) + + -- Yann Soubeyrand <yann-externe.soubeyrand@edf.fr> Tue, 10 Nov 2015 11:18:39 +0100 + +mdadm (3.3.4-1) unstable; urgency=medium + + [ Dimitri John Ledkov ] + * Adopting the package as per mjt delegation. Thank you for your + service mainting this package over the years, your contributions + are highly appreciated by all of Debian and derivate communities. + * New upstream release. + * Bump standards version to 3.9.6.0, no changes required. + * Use dh_prep instead of dh_clean -k + * Drop cherrypicked patches. + + [ Helmut Grohne ] + * Fix FTCBFS. Export CROSS_COMPILE=<triplet>- (Closes: #794335) + + [ Cyril B. ] + * Copy AUTO lines from host into initrd, when updating initrd. + (Closes: #785104) + + [ Martin von Wittich ] + * Ignore errors attempting to apply *nice to checkarray, it may be + done already. (Closes: #791554) + + -- Dimitri John Ledkov <xnox@debian.org> Sun, 08 Nov 2015 11:48:03 +0000 + mdadm (3.3.2-5) unstable; urgency=medium * use-tempnode-not-devnode.patch: change udev rules file to use diff --git a/debian/checkarray b/debian/checkarray index 88266c45..1fb97356 100644 --- a/debian/checkarray +++ b/debian/checkarray @@ -205,8 +205,8 @@ for array in $arrays; do resync_pid=$(ps -ef | awk -v dev=$array 'BEGIN { pattern = "^\\[" dev "_resync]$" } $8 ~ pattern { print $2 }') if [ -n "$resync_pid" ]; then [ $quiet -lt 1 ] && echo "$PROGNAME: I: selecting $ionice I/O scheduling class and $renice niceness for resync of $array." >&2 - ionice -p "$resync_pid" $ioarg || : - renice -n $renice -p "$resync_pid" 1>/dev/null || : + ionice -p "$resync_pid" $ioarg 2>/dev/null || : + renice -n $renice -p "$resync_pid" 1>/dev/null 2>&1 || : break fi sleep 1 diff --git a/debian/control b/debian/control index 4a053617..96491c6d 100644 --- a/debian/control +++ b/debian/control @@ -2,16 +2,16 @@ Source: mdadm Section: admin Priority: optional Maintainer: Debian mdadm maintainers <pkg-mdadm-devel@lists.alioth.debian.org> -Uploaders: Michael Tokarev <mjt@tls.msk.ru> +Uploaders: Dimitri John Ledkov <xnox@debian.org> Build-Depends: debhelper (>= 6.0.7~), po-debconf, groff-base -Standards-Version: 3.9.5 +Standards-Version: 3.9.7 Vcs-Git: git://anonscm.debian.org/pkg-mdadm/mdadm.git Vcs-Browser: https://anonscm.debian.org/cgit/pkg-mdadm/mdadm.git Homepage: http://neil.brown.name/blog/mdadm Package: mdadm -Architecture: any -Depends: ${shlibs:Depends}, udev, ${misc:Depends}, lsb-base, debconf, initscripts +Architecture: linux-any +Depends: ${shlibs:Depends}, udev, ${misc:Depends}, lsb-base, debconf Recommends: default-mta | mail-transport-agent, kmod | module-init-tools Description: tool to administer Linux MD arrays (software RAID) The mdadm utility can be used to create, manage, and monitor MD @@ -23,7 +23,7 @@ Description: tool to administer Linux MD arrays (software RAID) Package: mdadm-udeb Section: debian-installer XC-Package-Type: udeb -Architecture: any +Architecture: linux-any Depends: ${shlibs:Depends} Description: tool to administer Linux MD arrays (software RAID) The mdadm utility can be used to create, manage, and monitor MD diff --git a/debian/copyright b/debian/copyright index f6eaec91..39f1435d 100644 --- a/debian/copyright +++ b/debian/copyright @@ -18,4 +18,4 @@ the Free Software Foundation; either version 2 of the License, or (at your option) any later version. On Debian GNU/Linux systems, the complete text of the GNU General -Public License can be found in '/usr/share/common-licenses/GPL'. +Public License can be found in '/usr/share/common-licenses/GPL-2'. diff --git a/debian/initramfs/hook b/debian/initramfs/hook index 85bad65e..ae7d4d18 100644 --- a/debian/initramfs/hook +++ b/debian/initramfs/hook @@ -7,10 +7,10 @@ # set -eu -PREREQ= +PREREQ="udev" prereqs() { - echo "$PREREQ" + echo "$PREREQ" } case "${1:-}" in @@ -44,223 +44,67 @@ warn() write W "$@" } -err() -{ - write E "$@" -} - -MDADM=/sbin/mdadm -MDMON=/sbin/mdmon -[ -x "$MDADM" ] || exit 0 - -[ -r /usr/share/initramfs-tools/hook-functions ] || exit 0 . /usr/share/initramfs-tools/hook-functions # copy the binary as early as possible -copy_exec $MDADM /sbin -copy_exec $MDMON /sbin +copy_exec /sbin/mdadm /sbin +copy_exec /sbin/mdmon /sbin + +# Copy udev rules, which udev no longer does +for UDEV_RULE in 63-md-raid-arrays.rules 64-md-raid-assembly.rules; do +for rules_folder in /lib/udev/rules.d /etc/udev/rules.d; do + if [ -f $rules_folder/$UDEV_RULE ]; then + mkdir -p $DESTDIR$rules_folder + cp $rules_folder/$UDEV_RULE $DESTDIR$rules_folder/$UDEV_RULE + fi +done +done -# copy all modules into the initramfs, just for safety. -# we copy raid456 / raid5+raid6 because the hook script just won't do -# anything when the module cannot be found. -modules="linear multipath raid0 raid1 raid456 raid5 raid6 raid10" -for mod in $modules; do manual_add_modules $mod; done +# load raid modules in the initramfs +for module in linear multipath raid0 raid1 raid456 raid5 raid6 raid10; do + force_load $module +done -# read in the configuration +# copy the mdadm configuration CONFIG=/etc/mdadm/mdadm.conf ALTCONFIG=/etc/mdadm.conf -[ ! -f $CONFIG ] && [ -f $ALTCONFIG ] && CONFIG=$ALTCONFIG || : - -DEBIANCONFIG=/etc/default/mdadm -INITRDSTART=all -[ -s $DEBIANCONFIG ] && . $DEBIANCONFIG -[ -z "$INITRDSTART" ] && INITRDSTART=none - DESTMDADMCONF=$DESTDIR/etc/mdadm/mdadm.conf -DESTCONFIG=$DESTDIR/conf/mdadm - -if [ -f $CONFIG ]; then - homehost="$(sed -ne 's,^[[:space:]]*HOMEHOST[[:space:]]*,,p' $CONFIG)" -fi -if [ -z "${homehost:-}" ] || [ "${homehost:-}" = '<system>' ]; then - echo "MD_HOMEHOST='$(hostname)'" > $DESTCONFIG -fi - -install_config() -{ - # install the configuration file - mkdir -p ${2%/*} - # only copy ARRAY/DEVICE/HOMEHOST lines, and merge continuation lines into one - if [ -f "$1" ] ; then - sed -e :a -re '$!N;s/\n[[:space:]]+/ /;ta' -ne '/^(ARRAY|DEVICE|HOMEHOST)/P;D' $1 > $2 - fi -} +[ ! -f $CONFIG ] && [ -f $ALTCONFIG ] && CONFIG=$ALTCONFIG || : +mkdir -p ${DESTDIR}/etc/mdadm if [ ! -f $CONFIG ]; then - # there is no configuration file, so let's create one - - if /usr/share/mdadm/mkconf generate $CONFIG; then - # all is well - install_config $CONFIG $DESTMDADMCONF - info "auto-generated the mdadm.conf configuration file." - else - # we failed to auto-generate, so let the emergency procedure take over - warn "failed to auto-generate the mdadm.conf file." - fi - + # there is no configuration file, so let's create one + if /usr/share/mdadm/mkconf generate $CONFIG; then + # all is well + cp -p $CONFIG $DESTMDADMCONF + info "auto-generated the mdadm.conf configuration file." + else + # we failed to auto-generate, so let the emergency procedure take over + warn "failed to auto-generate the mdadm.conf file." + warn "please read /usr/share/doc/mdadm/README.upgrading-2.5.3.gz ." + fi else - - if grep -q '^ARRAY' $CONFIG; then - - # this is the ideal case - install_config $CONFIG $DESTMDADMCONF - info "using configuration file: $CONFIG" - - else - - # the file defines no ARRAYs. We better create a temporary file to be sure. - - warn "$CONFIG defines no arrays." - - mkdir --parents ${DESTMDADMCONF%/*} - tmpfile="${DESTMDADMCONF}.tmp" - if /usr/share/mdadm/mkconf > $tmpfile; then - # all is well, we now have a temporary configuration file - info "auto-generated temporary mdadm.conf configuration file." - install_config $tmpfile $DESTMDADMCONF - else - # stuff's really broke, as we failed to generate a temporary file. - # let's hope the unchecked file works, provided it contains at least one - # ARRAY statement... - warn "failed to auto-generate temporary mdadm.conf file." - if grep -q '^ARRAY' $CONFIG; then - warn "using the unchecked file and hoping for the best..." - install_config $CONFIG $DESTMDADMCONF - fi - fi - rm -f $tmpfile - - fi - -fi - -# if at this point, $DESTMDADMCONF does not exist or it does not contain any -# ARRAY statements, we must let the initramfs handle stuff. -if [ ! -f $DESTMDADMCONF ]; then - warn "no configuration file available." - info "letting initramfs assemble auto-detected arrays." - exit 0 -elif ! grep -q '^ARRAY' $DESTMDADMCONF; then - warn "no arrays defined in configuration file." - info "letting initramfs assemble auto-detected arrays." - exit 0 -else - # obtain devices list from config file, honouring multiline entries - devices="$( - dev= - while read line; do - case "$line" in - (ARRAY*) :;; - (*) continue;; - esac - for atom in $line; do - case "$atom" in - (/dev*) dev=$atom;; - esac - done - - # /dev/mdX and /dev/md/X are the same, really - case "$dev" in - "") continue ;; - (/dev/md/*) alt=/dev/md${dev##*/};; - (/dev/md*) alt=/dev/md/${dev#/dev/md};; - (*) - err "unknown device encountered: $dev" - warn_emergency - exit 0 - ;; - esac - if [ ! -b "$dev" ] && [ -b "$alt" ]; then - dev="$alt" - fi - - echo "$dev" - done < $DESTMDADMCONF)" || exit $? -fi - -if [ "$INITRDSTART" != none ] && [ -n "$devices" ]; then - - devs= - for dev in $devices; do - case "$INITRDSTART " in - all|*${dev}[[:space:]]*) - case "$devs " in # uniquiness - (*${dev}\ *) :;; - (*) devs="${devs:+$devs }$dev" ;; - esac - ;; - *) :;; - esac - done - - # make sure the configuration file knows about all running devices - $MDADM --detail --scan | while read array device params; do - uuid=${params#*UUID=}; uuid=${uuid%% *} - if ! grep -qi "uuid=$uuid" $DESTMDADMCONF; then - warn "the array $device with UUID $uuid" - warn "is currently active, but it is not listed in mdadm.conf. if" - warn "it is needed for boot, then YOUR SYSTEM IS NOW UNBOOTABLE!" - warn "please inspect the output of /usr/share/mdadm/mkconf, compare" - warn "it to $CONFIG, and make the necessary changes." - fi - done - - for i in $INITRDSTART; do - case "$INITRDSTART" in all) break;; *) :;; esac - case "$devs" in - *${i}*) continue;; - *) :;; - esac - - warn "I am supposed to start $i from the initial ramdisk," - warn "yet I cannot find the array in the configuration file." - warn "I am thus reverting to starting all arrays." - INITRDSTART=all - break - done - - if [ "$INITRDSTART" = all ]; then - echo "MD_DEVS=all" >> $DESTCONFIG - else - echo "MD_DEVS='$devs'" >> $DESTCONFIG - fi - - if [ "$INITRDSTART" = all ]; then - info "will start all available MD arrays from the initial ramdisk." - else - for i in $devs; do - info "will start MD array $i from the initial ramdisk." - done - fi - - # Copy udev rules, which udev no longer does - for rules_file in 63-md-raid-arrays.rules 64-md-raid-assembly.rules - do - for rules_folder in /lib/udev/rules.d /etc/udev/rules.d; do - if [ -f $rules_folder/$rules_file ]; then - mkdir -p $DESTDIR$rules_folder - cp $rules_folder/$rules_file $DESTDIR$rules_folder/$rules_file - fi - done - done - -else - echo "MD_DEVS=none" >> $DESTCONFIG - info "no MD arrays will be started from the initial ramdisk." + cp -p $CONFIG ${DESTDIR}/etc/mdadm + sed -i '/^CREATE/s/^/#/' $DESTMDADMCONF + if ! grep -q '^ARRAY' $CONFIG; then + tmpfile="${DESTMDADMCONF}.tmp" + warn "$CONFIG defines no arrays." + if /usr/share/mdadm/mkconf > $tmpfile; then + cp -p $tmpfile $DESTMDADMCONF + else + warn "failed to auto-generate temporary mdadm.conf file." + fi + else + # make sure the configuration file knows about all running devices + /sbin/mdadm --detail --scan | while read array device params; do + uuid=${params#*UUID=}; uuid=${uuid%% *} + if ! grep -q "UUID=$uuid" $DESTMDADMCONF; then + warn "the array $device with UUID $uuid" + warn "is currently active, but it is not listed in mdadm.conf. if" + warn "it is needed for boot, then YOUR SYSTEM IS NOW UNBOOTABLE!" + warn "please inspect the output of /usr/share/mdadm/mkconf, compare" + warn "it to $CONFIG, and make the necessary changes." + fi + done + fi fi - -# only output this on Debian systems -[ -s /etc/default/mdadm ] && \ - info 'use `dpkg-reconfigure --priority=low mdadm` to change this.' - -exit 0 diff --git a/debian/initramfs/script.local-block b/debian/initramfs/script.local-block new file mode 100644 index 00000000..e9b47c3d --- /dev/null +++ b/debian/initramfs/script.local-block @@ -0,0 +1,44 @@ +#!/bin/sh + +PREREQ="multipath" + +prereqs() +{ + echo "$PREREQ" +} + +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +# Poor man's mdadm-last-resort@.timer +# That kicks in 2/3rds into the ROOTDELAY + +if [ ! -f /run/count.mdadm.initrd ] +then + COUNT=0 +else + COUNT=$(cat /run/count.mdadm.initrd) +fi +COUNT=$((COUNT + 1)) + +echo $COUNT > /run/count.mdadm.initrd + +MAX=30 +if [ ${ROOTDELAY:-0} -gt $MAX ]; then + MAX=$ROOTDELAY +fi +MAX=$((MAX*2/3)) + +if [ "$COUNT" = "$MAX" ] +then + # Poor man's mdadm-last-resort@.service + mdadm -q --run /dev/md?* + rm -f /run/count.mdadm.initrd +fi + +exit 0 diff --git a/debian/initramfs/script.local-bottom b/debian/initramfs/script.local-bottom new file mode 100644 index 00000000..eda3b179 --- /dev/null +++ b/debian/initramfs/script.local-bottom @@ -0,0 +1,3 @@ +#!/bin/sh +rm -f /run/count.mdadm.initrd +exit 0
\ No newline at end of file diff --git a/debian/initramfs/script.local-top b/debian/initramfs/script.local-top deleted file mode 100644 index 9450bb72..00000000 --- a/debian/initramfs/script.local-top +++ /dev/null @@ -1,101 +0,0 @@ -#!/bin/sh -# -# Copyright © 2006-2008 Martin F. Krafft <madduck@debian.org>, -# 2012 Michael Tokarev <mjt@tls.msk.ru> -# based on the scripts in the initramfs-tools package. -# released under the terms of the Artistic Licence. -# -set -eu - -case ${1:-} in - prereqs) echo "multipath"; exit 0;; -esac - -. /scripts/functions - -maybe_break pre-mdadm - -if [ -e /scripts/local-top/md ]; then - log_warning_msg "old md initialisation script found, getting out of its way..." - exit 0 -fi - -MDADM=/sbin/mdadm -[ -x "$MDADM" ] || exit 0 - -verbose() -{ - case "$quiet" in y*|Y*|1|t*|T*) - return 1;; - *) - return 0;; - esac -} - -MD_DEVS=all -[ -s /conf/mdadm ] && . /conf/mdadm - -if [ "$MD_DEVS" = none ]; then - verbose && - log_warning_msg "INITRDSTART set to \"none\" in /etc/default/mdadm, not assembling raid arrays" - exit 0 -fi - -if [ ! -f /proc/mdstat ] && ! modprobe -q md_mod; then - verbose && log_warning_msg "failed to load module md_mod." -fi -if [ ! -f /proc/mdstat ]; then - verbose && log_warning_msg "cannot initialise MD subsystem (/proc/mdstat missing)" - exit 0 -fi - -# handle /dev/md/X nodes -mkdir -p /dev/md - -CONFIG=/etc/mdadm/mdadm.conf -# in case the hook failed to install a configuration file, this is our last -# attempt... the "emergency procedure"... <drumroll> -if [ ! -e $CONFIG ]; then - log_warning_msg "missing mdadm.conf file, trying to create one..." - mkdir -p ${CONFIG%/*} - echo DEVICE partitions > $CONFIG - $MDADM --examine --scan >> $CONFIG - if [ -s $CONFIG ]; then - verbose && log_success_msg "mdadm.conf created." - else - verbose && log_failure_msg "could not create mdadm.conf, the boot will likely fail." - fi - MD_DEVS=all -fi - -if [ "$MD_DEVS" = all ]; then - - verbose && log_begin_msg "Assembling all MD arrays" - extra_args='' - [ -n "${MD_HOMEHOST:-}" ] && extra_args="--homehost=$MD_HOMEHOST" - if $MDADM --assemble --scan --run --auto=yes${extra_args:+ $extra_args}; then - verbose && log_success_msg "assembled all arrays." - else - log_failure_msg "failed to assemble all arrays." - fi - verbose && log_end_msg - -else - for dev in $MD_DEVS; do - - verbose && log_begin_msg "Assembling MD array $dev" - if $MDADM --assemble --scan --run --auto=yes $dev; then - verbose && log_success_msg "started $dev" - else - log_failure_msg "failed to start $dev" - fi - verbose && log_end_msg - - done -fi - -wait_for_udev 10 - -maybe_break post-mdadm - -exit 0 diff --git a/debian/mdadm-raid b/debian/mdadm-raid deleted file mode 100644 index 6d4d6a99..00000000 --- a/debian/mdadm-raid +++ /dev/null @@ -1,256 +0,0 @@ -#!/bin/sh -# -# Start all arrays specified in the configuration file. -# -# Copyright © 2001-2005 Mario Jou/3en <joussen@debian.org> -# Copyright © 2005-2008 Martin F. Krafft <madduck@debian.org> -# Distributable under the terms of the GNU GPL version 2. -# -### BEGIN INIT INFO -# Provides: mdadm-raid -# Required-Start: mountkernfs hostname -# Should-Start: udev multipath-tools-boot -# X-Start-Before: checkfs mountall -# Required-Stop: mountkernfs -# Should-Stop: udev -# X-Stop-After: umountfs -# Default-Start: S -# Default-Stop: 0 6 -# Short-Description: MD array assembly -# Description: This script assembles a system's MD arrays, according to -# the settings in /etc/mdadm/mdadm.conf and the preferences -# in /etc/default/mdadm. -### END INIT INFO -# -set -eu - -MDADM=/sbin/mdadm -CONFIG=/etc/mdadm/mdadm.conf -ALTCONFIG=/etc/mdadm.conf -DEBIANCONFIG=/etc/default/mdadm - -test -x "$MDADM" || exit 0 - -STATEDIR=/run/mdadm -test -f $DEBIANCONFIG && . $DEBIANCONFIG - -. /lib/lsb/init-functions - -short_dev() -{ - local dev; dev=${1##*/} - case "$dev" in - md*|md_*|mdp*|mdp_*) echo "$dev";; - d*) echo "md_${dev}";; - *) echo "md${dev}";; - esac -} - -log() -{ - case "$1" in - [[:digit:]]*) success=$1; shift;; - *) :;; - esac - log_action_begin_msg "$1"; shift - log_action_end_msg ${success:-0} "$*" -} - -log_dev() -{ - success=${1:-}; shift - dev=${1:-}; shift - log $success "${PREFIX:-} $(short_dev ${dev:-})" "$*" -} - -log_notice() -{ - log 0 "${PREFIX:-}s" "$*" -} - -log_problem() -{ - log 1 "${PREFIX:-}s" "$*" -} - -is_true() -{ - case "${1:-}" in - [Yy]es|[Yy]|1|[Tt]rue|[Tt]) return 0;; - *) return 1;; - esac -} - -case "${1:-}" in - - start) - PREFIX="Assembling MD array" - - if [ ! -f /proc/mdstat ] && [ -x "$(command -v modprobe)" ] ; then - modprobe -q md 2>/dev/null || : - fi - if [ ! -f /proc/mdstat ]; then - log_problem "failed to load MD subsystem" - exit 0 - fi - - if [ ! -f $CONFIG -a ! -f $ALTCONFIG ]; then - log_problem "no $CONFIG file" - exit 0 - fi - - # handle devfs-style names and version-1 devices - # fail gracefully in case we're on a read-only filesystem, in which - # case it's safe to assume that the admin knows what s/he's doing. - # See (#382876). - mkdir --parent /dev/md || : - - # ugly hack because shell sucks - IFSOLD=${IFS:-} - IFS=' -' - for line in $($MDADM --assemble --scan --auto=yes --symlink=no 2>&1); do - IFS=$IFSOLD - set -- $line - shift - - case "$@" in - - 'No arrays found in config file'*) - # no point in carrying on. - shift - log_notice "no $*" - exit 0 - ;; - - 'Unknown keyword'*) - # warn only - if [ -x $(command -v logger >/dev/null) ]; then - logger -t mdadm -p syslog.warning -- "$*" - elif [ -w /dev/console ]; then - echo "mdadm: $*" > /dev/console - else - echo "mdadm: $*" >&2 - fi - ;; - - *' is already active.') - log_dev 0 $1 "already running" - ;; - - *'has been started with '[[:digit:]]*' drive'*' (out of '[[:digit:]]*') and '[[:digit:]]*' spare'*'.') - log_dev 0 $1 "initialising [$6/${10%).}]" - ;; - - *'has been started with '[[:digit:]]*' drive'*' (out of '[[:digit:]]*').') - log_dev 0 $1 "degraded [$6/${10%).}]" - ;; - - *'has been started with '[[:digit:]]*' drive'*'.') - log_dev 0 $1 "started [$6/$6]" - ;; - - *'assembled from '[[:digit:]]*' drive'*' - not enough to start the array.') - log_dev 1 $1 "not enough devices" - ;; - - 'no devices found for '*) - log_dev 1 $5 "no devices found" - ;; - - 'failed to RUN_ARRAY '*': Input/output error') - log_dev 1 ${4%:} "RUN_ARRAY input/output error" - ;; - - *) :;; - esac - done - ret=$? - - log_action_begin_msg "Generating udev events for MD arrays" - [ -d $STATEDIR ] || mkdir -p $STATEDIR - for uevent in /sys/block/md*/uevent; do - test -e $uevent || break - sentinel=${uevent#/sys/block/}; sentinel=${sentinel%/uevent}-uevent - test -e $STATEDIR/$sentinel && continue - test -w $uevent || continue - echo add > $uevent - test -d $STATEDIR && : > $STATEDIR/$sentinel - done - log_action_end_msg 0 - - exit $ret - ;; - - stop) - PREFIX="Stopping MD array" - - if [ ! -f /proc/mdstat ]; then - log_problem "no MD subsystem loaded" - exit 0 - fi - - # ugly hack because shell sucks - IFSOLD=${IFS:-} - IFS=' -' - set +e - for line in $($MDADM --stop --scan 2>&1); do - set -e - IFS=$IFSOLD - set -- $line - shift - case "$@" in - - 'Unknown keyword'*) - # warn only - if [ -x $(command -v logger >/dev/null) ]; then - logger -t mdadm -p syslog.warning -- "$*" - elif [ -w /dev/console ]; then - echo "mdadm: $*" > /dev/console - else - echo "mdadm: $*" >&2 - fi - ;; - - 'stopped '*) - log_dev 0 $2 stopped - ;; - - 'fail to stop array '*': Device or resource busy') - log_dev 1 ${5%:} busy - ;; - - *) :;; - esac - done || exit $? - - rm -f $STATEDIR/md*-uevent - ;; - - restart|force-reload) - ${0:-} stop - ${0:-} start - ;; - - reload) - PREFIX="Reloading MD array" - log_notice "never anything to do" - ;; - - status) - if [ ! -f /proc/mdstat ]; then - log_problem "no MD subsystem loaded" - exit 1 - else - cat /proc/mdstat - fi - ;; - - *) - echo "Usage: ${0:-} {start|stop|restart}" >&2 - exit 1;; - -esac - -exit 0 diff --git a/debian/mdadm.config b/debian/mdadm.config index 97352662..b9d4e246 100644 --- a/debian/mdadm.config +++ b/debian/mdadm.config @@ -13,9 +13,6 @@ ALTCONFIG=/etc/mdadm.conf DEBIANCONFIG=/etc/default/mdadm -db_get mdadm/initrdstart || : -INITRDSTART="$RET" - if [ -s $DEBIANCONFIG ] ; then AUTOCHECK=true START_DAEMON=true @@ -31,136 +28,8 @@ if [ -s $DEBIANCONFIG ] ; then [ -n "$MAILADDR" ] && db_set mdadm/mail_to "$MAILADDR" fi -chrooted() { - test "$(stat -c "%d/%i" /)" != "$(stat -Lc "%d/%i" /proc/1/root 2>/dev/null)" -} - -get_root_raiddev() { - local rootraiddev; - rootraiddev="$(df --portability / | sed -rne 's,^(/dev/[^[:space:]]+).*,\1,p')" - if ! mdadm --detail $rootraiddev >/dev/null 2>&1; then - return 1 - fi - echo ${rootraiddev%p[0-9]*} - return 0 -} - -get_initrdstart() { - db_fget mdadm/initrdstart seen - if chrooted || [ "$RET $INITRDSTART" = "false all" ]; then - echo all - return 1 - fi - - get_root_raiddev || echo all -} - -[ -z "$INITRDSTART" ] && INITRDSTART="$(get_initrdstart)" || : -[ -n "$INITRDSTART" ] && db_set mdadm/initrdstart "$INITRDSTART" - -INITRDSTART_PRIORITY=high -if chrooted; then - INITRDSTART_PRIORITY=medium -fi - db_capb escape -msg=intro; suffix=''; error=0 -while true; do - db_metaget mdadm/initrdstart_msg_${msg} extended_description || : - db_subst mdadm/initrdstart msg "$(echo -n "${RET}${suffix}" | debconf-escape -e)" - ret=0; db_input $INITRDSTART_PRIORITY mdadm/initrdstart || ret=$? - db_go - - if [ $error -ne 0 ] && [ $ret -eq 30 ]; then - # there was an error in a previous run of this loop, but the above question - # was not asked, so we better exit the endless loop... - echo "W: mdadm: unable to determine MD arrays needed for boot." >&2 - echo "W: mdadm: falling back to starting all of them..." >&2 - INITRDSTART=all - break - fi - - db_get mdadm/initrdstart - INITRDSTART="$(echo $RET | tr , ' ')" - - case "$INITRDSTART" in - ''|none) INITRDSTART=none; break;; - all) break;; - - *) - arrays='' - for i in $INITRDSTART; do - - # standardise by prefixing /dev/ - i="/dev/${i#/dev/}" - - # remove partition from partitionable array - i="${i%p[0-9]*}" - - if [ ! -e "$i" ]; then - error=1; msg=errexist; suffix=": $i"; break - fi - - if [ ! -b "$i" ]; then - t="$(readlink -nf "$i")" - if [ ! -b "$t" ]; then - suffix=": $t" - else - suffix=": $i" - fi - error=1; msg=errblock; break - fi - - if ! mdadm --detail "$i" >/dev/null 2>&1; then - error=1; msg=errmd; suffix=": $i"; break - fi - - if [ -f $CONFIG ]; then - if ! egrep -q "^(ARRAY)?[[:space:]]+$i([[:space:]]+|$)" $CONFIG; then - t="$(readlink -nf "$i")" - if [ -L "$i" ] \ - && egrep -q "^(ARRAY)?[[:space:]]+$t([[:space:]]|$)+" $CONFIG; then - i="$t" - else - db_set mdadm/initrdstart_notinconf false - db_fset mdadm/initrdstart_notinconf seen false - db_subst mdadm/initrdstart_notinconf array "$i" - db_subst mdadm/initrdstart_notinconf config "$CONFIG" - db_input high mdadm/initrdstart_notinconf || : - db_go - db_get mdadm/initrdstart_notinconf - if [ "$RET" = true ]; then - error=0 - else - db_fset mdadm/initrdstart seen false - db_set mdadm/initrdstart all - error=1; msg=errconf; suffix=": $i"; break - fi - fi - fi - fi - - # uniquely add device name - echo $arrays | egrep -q "\b${i}\b" || arrays="${arrays:+$arrays }$i" - done - - if [ $error -eq 0 ]; then - INITRDSTART="$arrays" - # exit the while true loop - break - fi - ;; - esac -done - -db_set mdadm/initrdstart "$INITRDSTART" - -if [ "$INITRDSTART" != all ]; then - db_input high mdadm/autostart || : - db_go -fi - db_input medium mdadm/autocheck || : db_go diff --git a/debian/mdadm.init b/debian/mdadm.init index 8b603796..0a9004f0 100644 --- a/debian/mdadm.init +++ b/debian/mdadm.init @@ -9,8 +9,8 @@ # ### BEGIN INIT INFO # Provides: mdadm -# Required-Start: $local_fs $syslog mdadm-raid -# Required-Stop: $local_fs $syslog sendsigs mdadm-raid +# Required-Start: $local_fs $syslog +# Required-Stop: $local_fs $syslog sendsigs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: MD monitoring daemon @@ -47,6 +47,12 @@ is_true() case "${1:-}" in start) + if [ -x /usr/bin/systemd-detect-virt ] && /usr/bin/systemd-detect-virt --quiet --container; then + log_daemon_msg "Not starting MD monitoring service in container" + log_end_msg 0 + exit 0 + fi + if is_true $START_DAEMON; then log_daemon_msg "Starting MD monitoring service" "mdadm --monitor" mkdir -p $RUNDIR diff --git a/debian/mdadm.maintscript b/debian/mdadm.maintscript new file mode 100644 index 00000000..17290594 --- /dev/null +++ b/debian/mdadm.maintscript @@ -0,0 +1 @@ +rm_conffile /etc/init.d/mdadm-raid 3.4-2~ diff --git a/debian/mdadm.postinst b/debian/mdadm.postinst index a603376d..fbe1f362 100644 --- a/debian/mdadm.postinst +++ b/debian/mdadm.postinst @@ -51,8 +51,6 @@ case "${1:-}" in fi unset MDADM_MAILADDR__ - db_get mdadm/initrdstart - INITRDSTART="${RET:-all}" db_get mdadm/autocheck AUTOCHECK="${RET:-true}" db_get mdadm/start_daemon @@ -69,12 +67,6 @@ case "${1:-}" in # rewritten. # -# INITRDSTART: -# list of arrays (or 'all') to start automatically when the initial ramdisk -# loads. This list *must* include the array holding your root filesystem. Use -# 'none' to prevent any array from being started from the initial ramdisk. -INITRDSTART='$INITRDSTART' - # AUTOCHECK: # should mdadm run periodic redundancy checks over your arrays? See # /etc/cron.d/mdadm. @@ -96,6 +88,9 @@ _eof db_stop + # Remove old init script + update-rc.d mdadm-raid remove + command -v update-initramfs >/dev/null 2>&1 && update-initramfs -u if dpkg --compare-versions "$2" le 3.3.2-3; then diff --git a/debian/mdadm.postrm b/debian/mdadm.postrm index 30309626..eaa62ad3 100644 --- a/debian/mdadm.postrm +++ b/debian/mdadm.postrm @@ -6,12 +6,12 @@ set -e case "${1:-}" in - remove) - if command -v update-initramfs >/dev/null 2>&1; then - echo "W: mdadm: I'll update the initramfs, but if you need MD to boot" >&2 - echo "W: mdadm: with initramfs, your system may be left unbootable!" >&2 - update-initramfs -u - fi + remove) + if command -v update-initramfs >/dev/null 2>&1; then + echo "W: mdadm: I'll update the initramfs, but if you need MD to boot" >&2 + echo "W: mdadm: with initramfs, your system may be left unbootable!" >&2 + update-initramfs -u + fi ;; purge) diff --git a/debian/mdadm.preinst b/debian/mdadm.preinst deleted file mode 100644 index b90ffb87..00000000 --- a/debian/mdadm.preinst +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/sh -# Copyright © martin f. krafft <madduck@debian.org> -# Distributed under the terms of the Artistic Licence 2.0 -# -set -e - -# based on idea from http://www.dpkg.org/dpkg/ConffileHandling -rm_conffile() { - local conffile md5sum package old_md5sum - - conffile="$1" - if [ -e "$conffile" ]; then - md5sum=$(md5sum "$conffile" | cut -d' ' -f1) - package=$(dpkg -S "$conffile" | cut -d: -f1) - old_md5sum=$(dpkg -s $package | sed -rne "s,[[:space:]]+${conffile}[[:space:]]+,,p") - if [ "$md5sum" != "$old_md5sum" ]; then - echo "Obsolete conffile $conffile has been modified by you." - echo "Saving as ${conffile}.dpkg-bak ..." - mv -f "$conffile" "$conffile".dpkg-bak - else - echo "Removing obsolete conffile $conffile ..." - rm -f "$conffile" - fi - fi -} - -case "$1" in - - upgrade|install) - - # migrate old configuration from *way back then* - DEBIANCONFIG=/etc/default/mdadm - OLDCONFIG=/etc/mdadm/debian.conf - if [ -s $OLDCONFIG ] && [ ! -f $DEBIANCONFIG ]; then - mv $OLDCONFIG $DEBIANCONFIG - fi - - # Used incorrect name s/_/-/, keep all throughout until after jessie is released. - rm_conffile /etc/udev/rules.d/65-mdadm.vol_id.rules - ;; - - *) :;; -esac - -#DEBHELPER# diff --git a/debian/mdadm.templates b/debian/mdadm.templates index ddf63c76..5a797c55 100644 --- a/debian/mdadm.templates +++ b/debian/mdadm.templates @@ -7,67 +7,6 @@ # Even minor modifications require translation updates and such # changes should be coordinated with translators and reviewers. -Template: mdadm/initrdstart -Type: string -Default: all -#flag:translate!:2 -_Description: MD arrays needed for the root file system: - ${msg} - . - Please enter 'all', 'none', or a space-separated list of devices such as - 'md0 md1' or 'md/1 md/d0' (the leading '/dev/' can be omitted). - -Template: mdadm/initrdstart_msg_intro -Type: text -_Description: for internal use - only the long description is needed. - If the system's root file system is located on an MD array (RAID), it needs to be - started early during the boot sequence. If it is located on - a logical volume (LVM), which is on MD, all constituent arrays need to be - started. - . - If you know exactly which arrays are needed to bring up the root file system, - and you want to postpone starting all other arrays to a later point in the - boot sequence, enter the arrays to start here. Alternatively, enter 'all' to - simply start all available arrays. - . - If you do not need or want to start any arrays for the root file system, leave - the answer blank (or enter 'none'). This may be the case if you are using - kernel autostart or do not need any arrays to boot. - -Template: mdadm/initrdstart_msg_errexist -Type: text -_Description: - An error occurred: device node does not exist - -Template: mdadm/initrdstart_msg_errblock -Type: text -_Description: - An error occurred: not a block device - -Template: mdadm/initrdstart_msg_errmd -Type: text -_Description: - An error occurred: not an MD array - -Template: mdadm/initrdstart_msg_errconf -Type: text -_Description: - An error occurred: array not listed in mdadm.conf file - -Template: mdadm/initrdstart_notinconf -Type: boolean -Default: false -_Description: Start arrays not listed in mdadm.conf? - The specified array (${array}) is not listed in the configuration - file (${config}). Therefore, it cannot be started during boot, unless you - correct the configuration file and recreate the initial ramdisk. - . - This warning is only relevant if you need arrays to be started from the - initial ramdisk to be able to boot. If you use kernel autostarting, or do not - need any arrays to be started as early as the initial ramdisk is loaded, you - can simply continue. Alternatively, choose not to continue and enter 'none' - when prompted which arrays to start from the initial ramdisk. - Template: mdadm/autocheck Type: boolean Default: true diff --git a/debian/mkconf b/debian/mkconf index a580f5b3..632c9120 100644 --- a/debian/mkconf +++ b/debian/mkconf @@ -13,7 +13,7 @@ DEBIANCONFIG=/etc/default/mdadm CONFIG=/etc/mdadm/mdadm.conf # initialise config variables in case the environment leaks -MAILADDR= DEVICE= CREATE= HOMEHOST= PROGRAM= +MAILADDR= DEVICE= HOMEHOST= PROGRAM= test -r $DEBIANCONFIG && . $DEBIANCONFIG @@ -28,7 +28,6 @@ fi # save existing values as defaults if [ -r "$CONFIG" ]; then DEVICE="$(sed -ne 's/^DEVICE //p' $CONFIG)" - CREATE="$(sed -ne 's/^CREATE //p' $CONFIG)" HOMEHOST="$(sed -ne 's/^HOMEHOST //p' $CONFIG)" PROGRAM="$(sed -ne 's/^PROGRAM //p' $CONFIG)" fi @@ -59,9 +58,6 @@ cat <<_eof # wildcards if desired. #DEVICE ${DEVICE:-partitions containers} -# auto-create devices with Debian standard permissions -CREATE ${CREATE:-owner=root group=disk mode=0660 auto=yes} - # automatically tag new arrays as belonging to the local system HOMEHOST ${HOMEHOST:-<system>} diff --git a/debian/patches/build-sys-no-check_rundir.patch b/debian/patches/build-sys-no-check_rundir.patch deleted file mode 100644 index 61f3a6f0..00000000 --- a/debian/patches/build-sys-no-check_rundir.patch +++ /dev/null @@ -1,33 +0,0 @@ -Subject: build-sys: do not depend on check_rundir for executables -From: Michael Tokarev <mjt@tls.msk.ru> -To: linux-raid@vger.kernel.org - -The problem is that the link lines will always be executed -even if the executables are up to date. - -If anything, this check_rundir should be a dependency of -install target, or some other "phony" target like this, -since check_rundir is phony by itself. - -Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> - ---- a/Makefile -+++ b/Makefile -@@ -172,7 +172,7 @@ everything-test: all mdadm.static swap_super test_stripe \ - # mdadm.uclibc and mdassemble.uclibc don't work on x86-64 - # mdadm.tcc doesn't work.. - --mdadm : check_rundir $(OBJS) -+mdadm : $(OBJS) - $(CC) $(CFLAGS) $(LDFLAGS) -o mdadm $(OBJS) $(LDLIBS) - - mdadm.static : $(OBJS) $(STATICOBJS) -@@ -195,7 +195,7 @@ mdmon.O2 : $(MON_SRCS) $(INCL) mdmon.h - $(CC) -o mdmon.O2 $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(MON_LDFLAGS) -DHAVE_STDINT_H -O2 -D_FORTIFY_SOURCE=2 $(MON_SRCS) - - # use '-z now' to guarantee no dynamic linker interactions with the monitor thread --mdmon : check_rundir $(MON_OBJS) -+mdmon : $(MON_OBJS) - $(CC) $(CFLAGS) $(LDFLAGS) $(MON_LDFLAGS) -Wl,-z,now -o mdmon $(MON_OBJS) $(LDLIBS) - msg.o: msg.c msg.h - diff --git a/debian/patches/rebuildmap-strip-local-host-name-from-device-name.patch b/debian/patches/rebuildmap-strip-local-host-name-from-device-name.patch deleted file mode 100644 index f7c9b1b7..00000000 --- a/debian/patches/rebuildmap-strip-local-host-name-from-device-name.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 628cdf19ea35daad22e409e51c0abc7ffb19d6aa Mon Sep 17 00:00:00 2001 -From: NeilBrown <neilb@suse.de> -Date: Mon, 3 Nov 2014 12:49:05 +1100 -Subject: Rebuildmap: strip local host name from device name. - -When /run/mdadm/map is being rebuilt, e.g. by "mdadm -Ir", -if the device doesn't exist in /dev, we have to choose -a name. -Currently we don't strip the hostname which is wrong if -it is the local host. - -Reported-by: Stephen Kent <smkent@smkent.net> -Signed-off-by: NeilBrown <neilb@suse.de> ---- - mapfile.c | 13 ++++++++++--- - 1 file changed, 10 insertions(+), 3 deletions(-) - -diff --git a/mapfile.c b/mapfile.c -index 4e7f242..41599df 100644 ---- a/mapfile.c -+++ b/mapfile.c -@@ -455,12 +455,19 @@ void RebuildMap(void) - sep = ""; - } - } -- if (strchr(name, ':')) -- /* probably a uniquifying -+ if (strchr(name, ':')) { -+ /* Probably a uniquifying - * hostname prefix. Allow -- * without a suffix -+ * without a suffix, and strip -+ * hostname if it is us. - */ -+ if (homehost && unum == -1 && -+ strncmp(name, homehost, -+ strlen(homehost)) == 0 && -+ name[strlen(homehost)] == ':') -+ name += strlen(homehost)+1; - unum = -1; -+ } - - while (conflict) { - if (unum >= 0) --- -1.7.10.4 - diff --git a/debian/patches/series b/debian/patches/series index c13a5c88..728fabf4 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,9 +1,5 @@ debian-conffile-location.diff debian-no-Werror.diff sha1-includes.diff -use-external-blkid.diff -use-tempnode-not-devnode.patch -build-sys-no-check_rundir.patch -rebuildmap-strip-local-host-name-from-device-name.patch readlink-path.patch mdmonitor-service-simplify.diff diff --git a/debian/patches/use-external-blkid.diff b/debian/patches/use-external-blkid.diff deleted file mode 100644 index 637f7c3a..00000000 --- a/debian/patches/use-external-blkid.diff +++ /dev/null @@ -1,16 +0,0 @@ -From: Michael Tokarev <mjt@tls.msk.ru> -Subject: blkid is not udev builtin, use /sbin/blkid - ---- a/udev-md-raid-arrays.rules -+++ b/udev-md-raid-arrays.rules -@@ -26,9 +26,7 @@ ENV{DEVTYPE}=="partition", ENV{MD_UUID}= - ENV{DEVTYPE}=="partition", ENV{MD_DEVNAME}=="*[^0-9]", SYMLINK+="md/$env{MD_DEVNAME}%n" - ENV{DEVTYPE}=="partition", ENV{MD_DEVNAME}=="*[0-9]", SYMLINK+="md/$env{MD_DEVNAME}p%n" - --IMPORT{builtin}="blkid" --OPTIONS+="link_priority=100" --OPTIONS+="watch" -+IMPORT{program}="/sbin/blkid -o udev -p -u noraid $tempnode" - ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" - ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}" - diff --git a/debian/patches/use-tempnode-not-devnode.patch b/debian/patches/use-tempnode-not-devnode.patch deleted file mode 100644 index 38a55044..00000000 --- a/debian/patches/use-tempnode-not-devnode.patch +++ /dev/null @@ -1,31 +0,0 @@ -From: Michael Tokarev <mjt@tls.msk.ru> -Subject: use tempnode not devnode in udev rules -Bug-Debian: http://bugs.debian.org/770883 -Forwarded: no - -udev in wheezy does not understand $devnode construct -in rules file, while upstream uses it in mdadm rules -files. udev in jessie has $devnode and it also supports -old $tempnode which is the way it worked in wheezy and -before, even if $tempnode in jessie's udev is not documented. -So on jessie, both $tempnode and $devnode works fine, while -in wheezy, only $tempnode works. - -Use $tempnode instead of $devnode. Since mdadm is important -enough for system functionality and easily can break system -by making it unbootable, and this is the only incompatibility -between wheezy's and jessie's udev wrt mdadm, it is better than -having a versioned dependency on udev. - -This patch is debian-specific and should be dropped for jessie+1. - ---- a/udev-md-raid-arrays.rules -+++ b/udev-md-raid-arrays.rules -@@ -20 +20 @@ --IMPORT{program}="BINDIR/mdadm --detail --export $devnode" -+IMPORT{program}="BINDIR/mdadm --detail --export $tempnode" ---- a/udev-md-raid-assembly.rules -+++ b/udev-md-raid-assembly.rules -@@ -30 +30 @@ --ACTION=="add|change", IMPORT{program}="BINDIR/mdadm --incremental --export $devnode --offroot ${DEVLINKS}" -+ACTION=="add|change", IMPORT{program}="BINDIR/mdadm --incremental --export $tempnode --offroot ${DEVLINKS}" diff --git a/debian/po/ca.po b/debian/po/ca.po index 0710fd90..a58c3ffd 100644 --- a/debian/po/ca.po +++ b/debian/po/ca.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 3.1.4-1+8efb9d1\n" "Report-Msgid-Bugs-To: mdadm@packages.debian.org\n" -"POT-Creation-Date: 2012-05-22 00:50+0100\n" +"POT-Creation-Date: 2016-07-05 14:12+0200\n" "PO-Revision-Date: 2011-05-17 16:54+0100\n" "Last-Translator: Innocent De Marchi <tangram.peces@gmail.com>\n" "Language-Team: Catalan <debian-l10n-catalan@lists.debian.org>\n" @@ -18,134 +18,9 @@ msgstr "" "X-Poedit-Language: Catalan\n" "X-Poedit-Country: SPAIN\n" -#. Type: string -#. Description -#: ../mdadm.templates:2001 -msgid "MD arrays needed for the root file system:" -msgstr "Les matrius MD necessaris per al sistema de fitxers arrel:" - -#. Type: string -#. Description -#: ../mdadm.templates:2001 -msgid "" -"Please enter 'all', 'none', or a space-separated list of devices such as " -"'md0 md1' or 'md/1 md/d0' (the leading '/dev/' can be omitted)." -msgstr "" -"Escriviu «all» (tots), «none» (cap) o una llista separada per espais dels " -"dispositius com «md0 md1» o «md/1 md/d0» (podeu ometre el «/dev/» inicial)." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "for internal use - only the long description is needed." -msgstr "per a ús intern, només és necessà ria la descripció llarga. " - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If the system's root file system is located on an MD array (RAID), it needs " -"to be started early during the boot sequence. If it is located on a logical " -"volume (LVM), which is on MD, all constituent arrays need to be started." -msgstr "" -"Si el sistema de fitxers arrel del sistema està en un conjunt MD (RAID), cal " -"que s'iniciï al principi de la seqüència d'arrencada. Si està en un volum " -"lògic (LVM), que està definit sobre un MD, cal iniciar totes les matrius que " -"el constitueixen." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If you know exactly which arrays are needed to bring up the root file " -"system, and you want to postpone starting all other arrays to a later point " -"in the boot sequence, enter the arrays to start here. Alternatively, enter " -"'all' to simply start all available arrays." -msgstr "" -"Si sabeu exactament quines matrius són necessà ries per arrencar el sistema " -"de fitxers arrel, i vol ajornar l'arrencada de la resta de conjunts a un " -"punt posterior de la seqüència d'arrencada, Introduïu aquà els conjunts que " -"voleu arrencar. També podeu seleccionar «all» per, simplement, arrencar tots " -"els disponibles." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If you do not need or want to start any arrays for the root file system, " -"leave the answer blank (or enter 'none'). This may be the case if you are " -"using kernel autostart or do not need any arrays to boot." -msgstr "" -"Si no necessita o vol arrencar qualsevol matriu per al sistema de fitxers " -"arrel, deixau en blanc la resposta (o escriviu «none»). Pot ésser el seu cas " -"si fa servir l'auto-arrencada del nucli o no necessiteu cap matriu en " -"l'arrencada." - -#. Type: text -#. Description -#: ../mdadm.templates:4001 -msgid "An error occurred: device node does not exist" -msgstr "S'ha produït un error: el node de dispositiu no existeix." - -#. Type: text -#. Description -#: ../mdadm.templates:5001 -msgid "An error occurred: not a block device" -msgstr "S'ha produït un error: no és un dispositiu de blocs." - -#. Type: text -#. Description -#: ../mdadm.templates:6001 -msgid "An error occurred: not an MD array" -msgstr "S'ha produït un error: no és un conjunt («array») MD." - -#. Type: text -#. Description -#: ../mdadm.templates:7001 -msgid "An error occurred: array not listed in mdadm.conf file" -msgstr "" -"S'ha produït un error: la matriu («array») no apareix llistada en el fitxer " -"de configuració «mdadm.conf»." - -#. Type: boolean -#. Description -#: ../mdadm.templates:8001 -msgid "Start arrays not listed in mdadm.conf?" -msgstr "Voleu arrencar les matrius no llistats en el fitxer «mdadm.conf»?" - -#. Type: boolean -#. Description -#: ../mdadm.templates:8001 -msgid "" -"The specified array (${array}) is not listed in the configuration file " -"(${config}). Therefore, it cannot be started during boot, unless you correct " -"the configuration file and recreate the initial ramdisk." -msgstr "" -"La matriu («array») especificada (${array}) no apareix llistada en el " -"fitxer de configuració (${config}). Per tant, no es pot iniciar la matriu " -"durant l'arrencada del sistema, llevat que corregeixi el fitxer de " -"configuració i regenereu el disc RAM inicial." - -#. Type: boolean -#. Description -#: ../mdadm.templates:8001 -msgid "" -"This warning is only relevant if you need arrays to be started from the " -"initial ramdisk to be able to boot. If you use kernel autostarting, or do " -"not need any arrays to be started as early as the initial ramdisk is loaded, " -"you can simply continue. Alternatively, choose not to continue and enter " -"'none' when prompted which arrays to start from the initial ramdisk." -msgstr "" -"Aquest avÃs només és important si necessiteu que les matrius s'arrenquin en " -"el disc RAM inicial per poder arrencar el sistema. Si feu servir l'arrencada " -"automà tica del nucli o no necessiteu que les matrius estiguin arrencats " -"quan es carregui el disc RAM, podeu continuar. També podeu decidir no " -"continuar i introduir «none» quan se li demani quines matrius cal iniciar " -"del disc RAM inicial." - #. Type: boolean #. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "Should mdadm run monthly redundancy checks of the MD arrays?" msgstr "" "Voleu que «mdadm» executi comprovacions de redundà ncia mensuals de les " @@ -153,7 +28,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "" "If the kernel supports it (versions greater than 2.6.14), mdadm can " "periodically check the redundancy of MD arrays (RAIDs). This may be a " @@ -172,7 +47,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "" "The default, if turned on, is to check on the first Sunday of every month at " "01:06." @@ -182,13 +57,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "Do you want to start the MD monitoring daemon?" msgstr "Desitjau arrencar el dimoni monitor MD?" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "" "The MD (RAID) monitor daemon sends email notifications in response to " "important MD events (such as a disk failure)." @@ -199,22 +74,111 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "Enabling this option is recommended." msgstr "Es recomana l'activació d'aquesta opció." #. Type: string #. Description -#: ../mdadm.templates:12001 +#: ../mdadm.templates:4001 msgid "Recipient for email notifications:" msgstr "Destinatari de les notificacions de correu electrònic:" #. Type: string #. Description -#: ../mdadm.templates:12001 +#: ../mdadm.templates:4001 msgid "" "Please enter the email address of the user who should get the email " "notifications for important MD events." msgstr "" "Introduïu l'adreça de correu electrònic de l'usuari que ha de rebre les " "notificacions de correu electrònic per a esdeveniments MD rellevants." + +#~ msgid "MD arrays needed for the root file system:" +#~ msgstr "Les matrius MD necessaris per al sistema de fitxers arrel:" + +#~ msgid "" +#~ "Please enter 'all', 'none', or a space-separated list of devices such as " +#~ "'md0 md1' or 'md/1 md/d0' (the leading '/dev/' can be omitted)." +#~ msgstr "" +#~ "Escriviu «all» (tots), «none» (cap) o una llista separada per espais dels " +#~ "dispositius com «md0 md1» o «md/1 md/d0» (podeu ometre el «/dev/» " +#~ "inicial)." + +#~ msgid "for internal use - only the long description is needed." +#~ msgstr "per a ús intern, només és necessà ria la descripció llarga. " + +#~ msgid "" +#~ "If the system's root file system is located on an MD array (RAID), it " +#~ "needs to be started early during the boot sequence. If it is located on a " +#~ "logical volume (LVM), which is on MD, all constituent arrays need to be " +#~ "started." +#~ msgstr "" +#~ "Si el sistema de fitxers arrel del sistema està en un conjunt MD (RAID), " +#~ "cal que s'iniciï al principi de la seqüència d'arrencada. Si està en un " +#~ "volum lògic (LVM), que està definit sobre un MD, cal iniciar totes les " +#~ "matrius que el constitueixen." + +#~ msgid "" +#~ "If you know exactly which arrays are needed to bring up the root file " +#~ "system, and you want to postpone starting all other arrays to a later " +#~ "point in the boot sequence, enter the arrays to start here. " +#~ "Alternatively, enter 'all' to simply start all available arrays." +#~ msgstr "" +#~ "Si sabeu exactament quines matrius són necessà ries per arrencar el " +#~ "sistema de fitxers arrel, i vol ajornar l'arrencada de la resta de " +#~ "conjunts a un punt posterior de la seqüència d'arrencada, Introduïu aquà " +#~ "els conjunts que voleu arrencar. També podeu seleccionar «all» per, " +#~ "simplement, arrencar tots els disponibles." + +#~ msgid "" +#~ "If you do not need or want to start any arrays for the root file system, " +#~ "leave the answer blank (or enter 'none'). This may be the case if you are " +#~ "using kernel autostart or do not need any arrays to boot." +#~ msgstr "" +#~ "Si no necessita o vol arrencar qualsevol matriu per al sistema de fitxers " +#~ "arrel, deixau en blanc la resposta (o escriviu «none»). Pot ésser el seu " +#~ "cas si fa servir l'auto-arrencada del nucli o no necessiteu cap matriu en " +#~ "l'arrencada." + +#~ msgid "An error occurred: device node does not exist" +#~ msgstr "S'ha produït un error: el node de dispositiu no existeix." + +#~ msgid "An error occurred: not a block device" +#~ msgstr "S'ha produït un error: no és un dispositiu de blocs." + +#~ msgid "An error occurred: not an MD array" +#~ msgstr "S'ha produït un error: no és un conjunt («array») MD." + +#~ msgid "An error occurred: array not listed in mdadm.conf file" +#~ msgstr "" +#~ "S'ha produït un error: la matriu («array») no apareix llistada en el " +#~ "fitxer de configuració «mdadm.conf»." + +#~ msgid "Start arrays not listed in mdadm.conf?" +#~ msgstr "Voleu arrencar les matrius no llistats en el fitxer «mdadm.conf»?" + +#~ msgid "" +#~ "The specified array (${array}) is not listed in the configuration file " +#~ "(${config}). Therefore, it cannot be started during boot, unless you " +#~ "correct the configuration file and recreate the initial ramdisk." +#~ msgstr "" +#~ "La matriu («array») especificada (${array}) no apareix llistada en el " +#~ "fitxer de configuració (${config}). Per tant, no es pot iniciar la matriu " +#~ "durant l'arrencada del sistema, llevat que corregeixi el fitxer de " +#~ "configuració i regenereu el disc RAM inicial." + +#~ msgid "" +#~ "This warning is only relevant if you need arrays to be started from the " +#~ "initial ramdisk to be able to boot. If you use kernel autostarting, or do " +#~ "not need any arrays to be started as early as the initial ramdisk is " +#~ "loaded, you can simply continue. Alternatively, choose not to continue " +#~ "and enter 'none' when prompted which arrays to start from the initial " +#~ "ramdisk." +#~ msgstr "" +#~ "Aquest avÃs només és important si necessiteu que les matrius s'arrenquin " +#~ "en el disc RAM inicial per poder arrencar el sistema. Si feu servir " +#~ "l'arrencada automà tica del nucli o no necessiteu que les matrius " +#~ "estiguin arrencats quan es carregui el disc RAM, podeu continuar. També " +#~ "podeu decidir no continuar i introduir «none» quan se li demani quines " +#~ "matrius cal iniciar del disc RAM inicial." diff --git a/debian/po/cs.po b/debian/po/cs.po index 40e8668c..d44601d3 100644 --- a/debian/po/cs.po +++ b/debian/po/cs.po @@ -15,7 +15,7 @@ msgid "" msgstr "" "Project-Id-Version: mdadm\n" "Report-Msgid-Bugs-To: mdadm@packages.debian.org\n" -"POT-Creation-Date: 2012-05-22 00:50+0100\n" +"POT-Creation-Date: 2016-07-05 14:12+0200\n" "PO-Revision-Date: 2008-02-17 21:10+0100\n" "Last-Translator: Miroslav Kure <kurem@debian.cz>\n" "Language-Team: Czech <debian-l10n-czech@lists.debian.org>\n" @@ -24,137 +24,15 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#. Type: string -#. Description -#: ../mdadm.templates:2001 -msgid "MD arrays needed for the root file system:" -msgstr "MD pole vyžadovaná pro koÅ™enový souborový systém:" - -#. Type: string -#. Description -#: ../mdadm.templates:2001 -msgid "" -"Please enter 'all', 'none', or a space-separated list of devices such as " -"'md0 md1' or 'md/1 md/d0' (the leading '/dev/' can be omitted)." -msgstr "" -"Zadejte prosÃm mezerami oddÄ›lený seznam zaÅ™ÃzenÃ, pÅ™ÃpadnÄ› „all“ nebo " -"„none“. PoÄáteÄnà „/dev/“ můžete vynechat a zadat jen napÅ™. „md0 md1“ nebo " -"„md/1 md/d0“." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "for internal use - only the long description is needed." -msgstr "pro vnitÅ™nà použità - pouze kvůli zobrazenà dlouhého popisu." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If the system's root file system is located on an MD array (RAID), it needs " -"to be started early during the boot sequence. If it is located on a logical " -"volume (LVM), which is on MD, all constituent arrays need to be started." -msgstr "" -"Pokud je koÅ™enový souborový systém umÃstÄ›n na MD (RAID) svazku, musà být " -"tento spuÅ¡tÄ›n bÄ›hem zavádÄ›nà systému co nejdÅ™Ãve. Pokud se koÅ™enový " -"souborový systém nacházà na logickém svazku LVM, který je vytvoÅ™en nad MD " -"polem, musà se spustit vÅ¡echna souvisejÃcà pole." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If you know exactly which arrays are needed to bring up the root file " -"system, and you want to postpone starting all other arrays to a later point " -"in the boot sequence, enter the arrays to start here. Alternatively, enter " -"'all' to simply start all available arrays." -msgstr "" -"Jestliže pÅ™esnÄ› vÃte, která pole jsou potÅ™eba pro pÅ™ipojenà koÅ™enového " -"souborového systému a zároveň chcete pozdržet spuÅ¡tÄ›nà ostatnÃch polà na " -"pozdÄ›jÅ¡Ã dobu, zadejte zde prosÃm pole, která se majà spustit. Chcete-li " -"spustit vÅ¡echna dostupná pole, můžete zadat „all“." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If you do not need or want to start any arrays for the root file system, " -"leave the answer blank (or enter 'none'). This may be the case if you are " -"using kernel autostart or do not need any arrays to boot." -msgstr "" -"NepotÅ™ebujete-li nebo nechcete-li spouÅ¡tÄ›t pole pro koÅ™enový souborový " -"systém, ponechte odpovÄ›Ä prázdnou, pÅ™ÃpadnÄ› zadejte „none“. To může nastat " -"tÅ™eba v pÅ™ÃpadÄ›, že použÃváte automatický start pÅ™Ãmo v jádÅ™e, nebo pokud k " -"zavedenà systému žádná pole nepotÅ™ebujete." - -#. Type: text -#. Description -#: ../mdadm.templates:4001 -msgid "An error occurred: device node does not exist" -msgstr "Vyskytla se chyba: uzel zaÅ™Ãzenà neexistuje" - -#. Type: text -#. Description -#: ../mdadm.templates:5001 -msgid "An error occurred: not a block device" -msgstr "Vyskytla se chyba: nenà blokovým zaÅ™ÃzenÃm" - -#. Type: text -#. Description -#: ../mdadm.templates:6001 -msgid "An error occurred: not an MD array" -msgstr "Vyskytla se chyba: nenà MD polem" - -#. Type: text -#. Description -#: ../mdadm.templates:7001 -msgid "An error occurred: array not listed in mdadm.conf file" -msgstr "Vyskytla se chyba: pole nenà uvedeno v souboru mdadm.conf" - #. Type: boolean #. Description -#: ../mdadm.templates:8001 -msgid "Start arrays not listed in mdadm.conf?" -msgstr "Spustit pole neuvedená v mdadm.conf?" - -#. Type: boolean -#. Description -#: ../mdadm.templates:8001 -msgid "" -"The specified array (${array}) is not listed in the configuration file " -"(${config}). Therefore, it cannot be started during boot, unless you correct " -"the configuration file and recreate the initial ramdisk." -msgstr "" -"Zadané pole (${array}) nenà uvedeno v konfiguraÄnÃm souboru ${config} a tÃm " -"pádem nemůže být spuÅ¡tÄ›no pÅ™i zavádÄ›nà systému. Napravit to můžete opravou " -"konfiguraÄnÃho souboru a znovuvytvoÅ™enÃm poÄáteÄnÃho ramdisku." - -#. Type: boolean -#. Description -#: ../mdadm.templates:8001 -msgid "" -"This warning is only relevant if you need arrays to be started from the " -"initial ramdisk to be able to boot. If you use kernel autostarting, or do " -"not need any arrays to be started as early as the initial ramdisk is loaded, " -"you can simply continue. Alternatively, choose not to continue and enter " -"'none' when prompted which arrays to start from the initial ramdisk." -msgstr "" -"Toto varovánà je relevantnà pouze pokud k zavedenà systému potÅ™ebujete, aby " -"se pole spustila z poÄáteÄnÃho ramdisku. PoužÃváte-li automatické spouÅ¡tÄ›nà " -"pÅ™Ãmo v jádÅ™e, nebo pokud nepotÅ™ebujete pouÅ¡tÄ›t žádná pole jeÅ¡tÄ› z " -"poÄáteÄnÃho ramdisku, můžete jednoduÅ¡e pokraÄovat. Jinou možnostà je " -"nepokraÄovat dále a pÅ™i dotazu na seznam polÃ, která se majà spouÅ¡tÄ›t z " -"poÄáteÄnÃho ramdisku, zadat 'none'." - -#. Type: boolean -#. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "Should mdadm run monthly redundancy checks of the MD arrays?" msgstr "Má mdadm spouÅ¡tÄ›t mÄ›sÃÄnà kontroly redundance MD polÃ?" #. Type: boolean #. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "" "If the kernel supports it (versions greater than 2.6.14), mdadm can " "periodically check the redundancy of MD arrays (RAIDs). This may be a " @@ -172,7 +50,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "" "The default, if turned on, is to check on the first Sunday of every month at " "01:06." @@ -182,13 +60,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "Do you want to start the MD monitoring daemon?" msgstr "Chcete spustit daemon pro monitorovánà MD?" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "" "The MD (RAID) monitor daemon sends email notifications in response to " "important MD events (such as a disk failure)." @@ -198,19 +76,19 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "Enabling this option is recommended." msgstr "Povolenà této možnosti je doporuÄeno." #. Type: string #. Description -#: ../mdadm.templates:12001 +#: ../mdadm.templates:4001 msgid "Recipient for email notifications:" msgstr "PÅ™Ãjemce emailových upozornÄ›nÃ:" #. Type: string #. Description -#: ../mdadm.templates:12001 +#: ../mdadm.templates:4001 msgid "" "Please enter the email address of the user who should get the email " "notifications for important MD events." @@ -218,6 +96,91 @@ msgstr "" "Zadejte prosÃm emailovou adresu uživatele, který má dostávat emailová " "upozornÄ›nà pÅ™i výskytu významných MD událostÃ." +#~ msgid "MD arrays needed for the root file system:" +#~ msgstr "MD pole vyžadovaná pro koÅ™enový souborový systém:" + +#~ msgid "" +#~ "Please enter 'all', 'none', or a space-separated list of devices such as " +#~ "'md0 md1' or 'md/1 md/d0' (the leading '/dev/' can be omitted)." +#~ msgstr "" +#~ "Zadejte prosÃm mezerami oddÄ›lený seznam zaÅ™ÃzenÃ, pÅ™ÃpadnÄ› „all“ nebo " +#~ "„none“. PoÄáteÄnà „/dev/“ můžete vynechat a zadat jen napÅ™. „md0 md1“ " +#~ "nebo „md/1 md/d0“." + +#~ msgid "for internal use - only the long description is needed." +#~ msgstr "pro vnitÅ™nà použità - pouze kvůli zobrazenà dlouhého popisu." + +#~ msgid "" +#~ "If the system's root file system is located on an MD array (RAID), it " +#~ "needs to be started early during the boot sequence. If it is located on a " +#~ "logical volume (LVM), which is on MD, all constituent arrays need to be " +#~ "started." +#~ msgstr "" +#~ "Pokud je koÅ™enový souborový systém umÃstÄ›n na MD (RAID) svazku, musà být " +#~ "tento spuÅ¡tÄ›n bÄ›hem zavádÄ›nà systému co nejdÅ™Ãve. Pokud se koÅ™enový " +#~ "souborový systém nacházà na logickém svazku LVM, který je vytvoÅ™en nad MD " +#~ "polem, musà se spustit vÅ¡echna souvisejÃcà pole." + +#~ msgid "" +#~ "If you know exactly which arrays are needed to bring up the root file " +#~ "system, and you want to postpone starting all other arrays to a later " +#~ "point in the boot sequence, enter the arrays to start here. " +#~ "Alternatively, enter 'all' to simply start all available arrays." +#~ msgstr "" +#~ "Jestliže pÅ™esnÄ› vÃte, která pole jsou potÅ™eba pro pÅ™ipojenà koÅ™enového " +#~ "souborového systému a zároveň chcete pozdržet spuÅ¡tÄ›nà ostatnÃch polà na " +#~ "pozdÄ›jÅ¡Ã dobu, zadejte zde prosÃm pole, která se majà spustit. Chcete-li " +#~ "spustit vÅ¡echna dostupná pole, můžete zadat „all“." + +#~ msgid "" +#~ "If you do not need or want to start any arrays for the root file system, " +#~ "leave the answer blank (or enter 'none'). This may be the case if you are " +#~ "using kernel autostart or do not need any arrays to boot." +#~ msgstr "" +#~ "NepotÅ™ebujete-li nebo nechcete-li spouÅ¡tÄ›t pole pro koÅ™enový souborový " +#~ "systém, ponechte odpovÄ›Ä prázdnou, pÅ™ÃpadnÄ› zadejte „none“. To může " +#~ "nastat tÅ™eba v pÅ™ÃpadÄ›, že použÃváte automatický start pÅ™Ãmo v jádÅ™e, " +#~ "nebo pokud k zavedenà systému žádná pole nepotÅ™ebujete." + +#~ msgid "An error occurred: device node does not exist" +#~ msgstr "Vyskytla se chyba: uzel zaÅ™Ãzenà neexistuje" + +#~ msgid "An error occurred: not a block device" +#~ msgstr "Vyskytla se chyba: nenà blokovým zaÅ™ÃzenÃm" + +#~ msgid "An error occurred: not an MD array" +#~ msgstr "Vyskytla se chyba: nenà MD polem" + +#~ msgid "An error occurred: array not listed in mdadm.conf file" +#~ msgstr "Vyskytla se chyba: pole nenà uvedeno v souboru mdadm.conf" + +#~ msgid "Start arrays not listed in mdadm.conf?" +#~ msgstr "Spustit pole neuvedená v mdadm.conf?" + +#~ msgid "" +#~ "The specified array (${array}) is not listed in the configuration file " +#~ "(${config}). Therefore, it cannot be started during boot, unless you " +#~ "correct the configuration file and recreate the initial ramdisk." +#~ msgstr "" +#~ "Zadané pole (${array}) nenà uvedeno v konfiguraÄnÃm souboru ${config} a " +#~ "tÃm pádem nemůže být spuÅ¡tÄ›no pÅ™i zavádÄ›nà systému. Napravit to můžete " +#~ "opravou konfiguraÄnÃho souboru a znovuvytvoÅ™enÃm poÄáteÄnÃho ramdisku." + +#~ msgid "" +#~ "This warning is only relevant if you need arrays to be started from the " +#~ "initial ramdisk to be able to boot. If you use kernel autostarting, or do " +#~ "not need any arrays to be started as early as the initial ramdisk is " +#~ "loaded, you can simply continue. Alternatively, choose not to continue " +#~ "and enter 'none' when prompted which arrays to start from the initial " +#~ "ramdisk." +#~ msgstr "" +#~ "Toto varovánà je relevantnà pouze pokud k zavedenà systému potÅ™ebujete, " +#~ "aby se pole spustila z poÄáteÄnÃho ramdisku. PoužÃváte-li automatické " +#~ "spouÅ¡tÄ›nà pÅ™Ãmo v jádÅ™e, nebo pokud nepotÅ™ebujete pouÅ¡tÄ›t žádná pole " +#~ "jeÅ¡tÄ› z poÄáteÄnÃho ramdisku, můžete jednoduÅ¡e pokraÄovat. Jinou možnostà " +#~ "je nepokraÄovat dále a pÅ™i dotazu na seznam polÃ, která se majà spouÅ¡tÄ›t " +#~ "z poÄáteÄnÃho ramdisku, zadat 'none'." + #~ msgid "Initialise the superblock if you reuse hard disks" #~ msgstr "PÅ™i znovupoužità starÅ¡Ãch disků inicializujte superblok" diff --git a/debian/po/da.po b/debian/po/da.po index 47294504..c6bdffed 100644 --- a/debian/po/da.po +++ b/debian/po/da.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: mdadm\n" "Report-Msgid-Bugs-To: mdadm@packages.debian.org\n" -"POT-Creation-Date: 2012-05-22 00:50+0100\n" +"POT-Creation-Date: 2016-07-05 14:12+0200\n" "PO-Revision-Date: 2011-04-03 17:30+01:00\n" "Last-Translator: Joe Hansen <joedalton2@yahoo.dk>\n" "Language-Team: Danish <debian-l10n-danish@lists.debian.org> \n" @@ -16,135 +16,15 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#. Type: string -#. Description -#: ../mdadm.templates:2001 -msgid "MD arrays needed for the root file system:" -msgstr "MD arrays krævet for rodfilsystemet:" - -#. Type: string -#. Description -#: ../mdadm.templates:2001 -msgid "" -"Please enter 'all', 'none', or a space-separated list of devices such as " -"'md0 md1' or 'md/1 md/d0' (the leading '/dev/' can be omitted)." -msgstr "" -"Indtast venligst »all«, »none« eller en mellemrumsadskilt liste af enheder " -"sÃ¥som »md0 md1« eller »md/1 md/d0« (det foranstillede »/dev/« kan udelades)." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "for internal use - only the long description is needed." -msgstr "for intern brug - kun den lange beskrivelse er krævet." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If the system's root file system is located on an MD array (RAID), it needs " -"to be started early during the boot sequence. If it is located on a logical " -"volume (LVM), which is on MD, all constituent arrays need to be started." -msgstr "" -"Hvis systemets rodfilsystem er placeret pÃ¥ en MD-array (RAID), skal det " -"startes tidligt under opstartssekvensen. Hvis den er placeret pÃ¥ en logisk " -"diskenhed (LVM), som er pÃ¥ MD, skal alle indgÃ¥ende arrays startes." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If you know exactly which arrays are needed to bring up the root file " -"system, and you want to postpone starting all other arrays to a later point " -"in the boot sequence, enter the arrays to start here. Alternatively, enter " -"'all' to simply start all available arrays." -msgstr "" -"Hvis du ved præcis hvilke arrays som er krævet, for at fÃ¥ rodfilsystemet op, " -"og du ønsker at udsætte start af alle andre arrays til et senere tidspunkt i " -"opstartssekvensen, sÃ¥ indtast her de arrays som skal startes. Alternativt " -"kan du indtaste »all« for at starte alle tilgængelige arrays." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If you do not need or want to start any arrays for the root file system, " -"leave the answer blank (or enter 'none'). This may be the case if you are " -"using kernel autostart or do not need any arrays to boot." -msgstr "" -"Hvis du ikke har brug for eller ønsker at starte nogen arrays for " -"rodfilsystemet, sÃ¥ efterlad svaret tomt (eller indtast »none«). Dette kan " -"være tilfældet, hvis du bruger automatisk start af kernen eller ikke skal " -"bruge arrays til at starte op med." - -#. Type: text -#. Description -#: ../mdadm.templates:4001 -msgid "An error occurred: device node does not exist" -msgstr "Der opstod en fejl: Enhedsknude findes ikke" - -#. Type: text -#. Description -#: ../mdadm.templates:5001 -msgid "An error occurred: not a block device" -msgstr "Der opstod en fejl: Ikke en blokenhed" - -#. Type: text -#. Description -#: ../mdadm.templates:6001 -msgid "An error occurred: not an MD array" -msgstr "Der opstod en fejl: Ikke en MD array" - -#. Type: text -#. Description -#: ../mdadm.templates:7001 -msgid "An error occurred: array not listed in mdadm.conf file" -msgstr "Der opstod en fejl: Array er ikke anført i mdadm.conf-filen" - -#. Type: boolean -#. Description -#: ../mdadm.templates:8001 -msgid "Start arrays not listed in mdadm.conf?" -msgstr "Start arrays er ikke anført i mdadm.conf?" - -#. Type: boolean -#. Description -#: ../mdadm.templates:8001 -msgid "" -"The specified array (${array}) is not listed in the configuration file " -"(${config}). Therefore, it cannot be started during boot, unless you correct " -"the configuration file and recreate the initial ramdisk." -msgstr "" -"Den angivne array (${array}) er ikke anført i konfigurationsfilen " -"(${config}). Den kan derfor ikke startes under opstarten, med mindre du " -"retter i konfigurationsfilen og gendanner den oprindleige ramdisk." - #. Type: boolean #. Description -#: ../mdadm.templates:8001 -msgid "" -"This warning is only relevant if you need arrays to be started from the " -"initial ramdisk to be able to boot. If you use kernel autostarting, or do " -"not need any arrays to be started as early as the initial ramdisk is loaded, " -"you can simply continue. Alternatively, choose not to continue and enter " -"'none' when prompted which arrays to start from the initial ramdisk." -msgstr "" -"Denne advarsel er kun relevant hvis du skal have arrays til at blive startet " -"fra den oprindelige ramdisk for at kunne starte op. Hvis du bruger den " -"automatiske opstart i kernen, eller ikke skal bruge at arrays startes sÃ¥ " -"tidligt som den oprindelige ramdisk indlæses, sÃ¥ kan du bare fortsætte. " -"Alternativt sÃ¥ vælg at fortsætte og indtaste »none« nÃ¥r du bliver spurgt om " -"hvilke arrays, der skal startes fra den oprindelige ramdisk." - -#. Type: boolean -#. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "Should mdadm run monthly redundancy checks of the MD arrays?" msgstr "Skal mdadm køre mÃ¥nedlig redundanskontrol af MD arrays?" #. Type: boolean #. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "" "If the kernel supports it (versions greater than 2.6.14), mdadm can " "periodically check the redundancy of MD arrays (RAIDs). This may be a " @@ -163,7 +43,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "" "The default, if turned on, is to check on the first Sunday of every month at " "01:06." @@ -173,13 +53,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "Do you want to start the MD monitoring daemon?" msgstr "Ønsker du at starte MD-overvÃ¥gningsdæmonen?" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "" "The MD (RAID) monitor daemon sends email notifications in response to " "important MD events (such as a disk failure)." @@ -189,22 +69,107 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "Enabling this option is recommended." msgstr "Aktivering af denne indstilling anbefales." #. Type: string #. Description -#: ../mdadm.templates:12001 +#: ../mdadm.templates:4001 msgid "Recipient for email notifications:" msgstr "Modtager af e-post-pÃ¥mindelser:" #. Type: string #. Description -#: ../mdadm.templates:12001 +#: ../mdadm.templates:4001 msgid "" "Please enter the email address of the user who should get the email " "notifications for important MD events." msgstr "" "Indtast venligst e-post-adressen pÃ¥ brugeren, som skal modtage e-post-" "pÃ¥mindelser for vigtige MD-hændelser." + +#~ msgid "MD arrays needed for the root file system:" +#~ msgstr "MD arrays krævet for rodfilsystemet:" + +#~ msgid "" +#~ "Please enter 'all', 'none', or a space-separated list of devices such as " +#~ "'md0 md1' or 'md/1 md/d0' (the leading '/dev/' can be omitted)." +#~ msgstr "" +#~ "Indtast venligst »all«, »none« eller en mellemrumsadskilt liste af " +#~ "enheder sÃ¥som »md0 md1« eller »md/1 md/d0« (det foranstillede »/dev/« kan " +#~ "udelades)." + +#~ msgid "for internal use - only the long description is needed." +#~ msgstr "for intern brug - kun den lange beskrivelse er krævet." + +#~ msgid "" +#~ "If the system's root file system is located on an MD array (RAID), it " +#~ "needs to be started early during the boot sequence. If it is located on a " +#~ "logical volume (LVM), which is on MD, all constituent arrays need to be " +#~ "started." +#~ msgstr "" +#~ "Hvis systemets rodfilsystem er placeret pÃ¥ en MD-array (RAID), skal det " +#~ "startes tidligt under opstartssekvensen. Hvis den er placeret pÃ¥ en " +#~ "logisk diskenhed (LVM), som er pÃ¥ MD, skal alle indgÃ¥ende arrays startes." + +#~ msgid "" +#~ "If you know exactly which arrays are needed to bring up the root file " +#~ "system, and you want to postpone starting all other arrays to a later " +#~ "point in the boot sequence, enter the arrays to start here. " +#~ "Alternatively, enter 'all' to simply start all available arrays." +#~ msgstr "" +#~ "Hvis du ved præcis hvilke arrays som er krævet, for at fÃ¥ rodfilsystemet " +#~ "op, og du ønsker at udsætte start af alle andre arrays til et senere " +#~ "tidspunkt i opstartssekvensen, sÃ¥ indtast her de arrays som skal startes. " +#~ "Alternativt kan du indtaste »all« for at starte alle tilgængelige arrays." + +#~ msgid "" +#~ "If you do not need or want to start any arrays for the root file system, " +#~ "leave the answer blank (or enter 'none'). This may be the case if you are " +#~ "using kernel autostart or do not need any arrays to boot." +#~ msgstr "" +#~ "Hvis du ikke har brug for eller ønsker at starte nogen arrays for " +#~ "rodfilsystemet, sÃ¥ efterlad svaret tomt (eller indtast »none«). Dette kan " +#~ "være tilfældet, hvis du bruger automatisk start af kernen eller ikke skal " +#~ "bruge arrays til at starte op med." + +#~ msgid "An error occurred: device node does not exist" +#~ msgstr "Der opstod en fejl: Enhedsknude findes ikke" + +#~ msgid "An error occurred: not a block device" +#~ msgstr "Der opstod en fejl: Ikke en blokenhed" + +#~ msgid "An error occurred: not an MD array" +#~ msgstr "Der opstod en fejl: Ikke en MD array" + +#~ msgid "An error occurred: array not listed in mdadm.conf file" +#~ msgstr "Der opstod en fejl: Array er ikke anført i mdadm.conf-filen" + +#~ msgid "Start arrays not listed in mdadm.conf?" +#~ msgstr "Start arrays er ikke anført i mdadm.conf?" + +#~ msgid "" +#~ "The specified array (${array}) is not listed in the configuration file " +#~ "(${config}). Therefore, it cannot be started during boot, unless you " +#~ "correct the configuration file and recreate the initial ramdisk." +#~ msgstr "" +#~ "Den angivne array (${array}) er ikke anført i konfigurationsfilen " +#~ "(${config}). Den kan derfor ikke startes under opstarten, med mindre du " +#~ "retter i konfigurationsfilen og gendanner den oprindleige ramdisk." + +#~ msgid "" +#~ "This warning is only relevant if you need arrays to be started from the " +#~ "initial ramdisk to be able to boot. If you use kernel autostarting, or do " +#~ "not need any arrays to be started as early as the initial ramdisk is " +#~ "loaded, you can simply continue. Alternatively, choose not to continue " +#~ "and enter 'none' when prompted which arrays to start from the initial " +#~ "ramdisk." +#~ msgstr "" +#~ "Denne advarsel er kun relevant hvis du skal have arrays til at blive " +#~ "startet fra den oprindelige ramdisk for at kunne starte op. Hvis du " +#~ "bruger den automatiske opstart i kernen, eller ikke skal bruge at arrays " +#~ "startes sÃ¥ tidligt som den oprindelige ramdisk indlæses, sÃ¥ kan du bare " +#~ "fortsætte. Alternativt sÃ¥ vælg at fortsætte og indtaste »none« nÃ¥r du " +#~ "bliver spurgt om hvilke arrays, der skal startes fra den oprindelige " +#~ "ramdisk." diff --git a/debian/po/de.po b/debian/po/de.po index e1191e21..140cc0bd 100644 --- a/debian/po/de.po +++ b/debian/po/de.po @@ -13,7 +13,7 @@ msgid "" msgstr "" "Project-Id-Version: mdadm 2.6.9-3\n" "Report-Msgid-Bugs-To: mdadm@packages.debian.org\n" -"POT-Creation-Date: 2012-05-22 00:50+0100\n" +"POT-Creation-Date: 2016-07-05 14:12+0200\n" "PO-Revision-Date: 2009-06-24 17:35+0200\n" "Last-Translator: Mario Joussen <joussen@debian.org>\n" "Language-Team: German <debian-l10n-german@lists.debian.org>\n" @@ -22,137 +22,9 @@ msgstr "" "Content-Type: text/plain; charset=ISO-8859-1\n" "Content-Transfer-Encoding: 8bit\n" -#. Type: string -#. Description -#: ../mdadm.templates:2001 -msgid "MD arrays needed for the root file system:" -msgstr "Für das Wurzeldateisystem benötigte MD folgende Verbünde:" - -#. Type: string -#. Description -#: ../mdadm.templates:2001 -msgid "" -"Please enter 'all', 'none', or a space-separated list of devices such as " -"'md0 md1' or 'md/1 md/d0' (the leading '/dev/' can be omitted)." -msgstr "" -"Bitte geben Sie »all«, »none« oder eine leerzeichenseparierte Geräteliste " -"wie zum Beispiel »md0 md1« oder »md/1 md/d0« ein (das führende »/dev« kann " -"weggelassen werden)." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "for internal use - only the long description is needed." -msgstr "" -"für internen Gebrauch - es wird nur die ausführliche Beschreibung benötigt." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If the system's root file system is located on an MD array (RAID), it needs " -"to be started early during the boot sequence. If it is located on a logical " -"volume (LVM), which is on MD, all constituent arrays need to be started." -msgstr "" -"Wenn das Wurzeldateisystem Ihres Systems auf einem MD-Verbund (RAID) liegt, " -"muss es frühzeitig während des Bootvorgangs gestartet werden. Wenn sich Ihr " -"Wurzeldateisystem auf einem logischen Laufwerk (LVM) befindet, das sich " -"wiederum auf einem MD Verbund befindet, müssen alle zugehörigen Verbünde " -"gestartet werden." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If you know exactly which arrays are needed to bring up the root file " -"system, and you want to postpone starting all other arrays to a later point " -"in the boot sequence, enter the arrays to start here. Alternatively, enter " -"'all' to simply start all available arrays." -msgstr "" -"Wenn Sie genau wissen, welche Verbünde benötigt werden, um das " -"Wurzeldateisystem zu starten, und Sie den Start der anderen Verbünde auf " -"einen späteren Zeitpunkt in der Bootreihenfolge verschieben wollen, geben " -"Sie die zu startenden Verbünde hier ein. Alternativ geben Sie »all« ein, um " -"alle verfügbaren Verbünde zu starten." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If you do not need or want to start any arrays for the root file system, " -"leave the answer blank (or enter 'none'). This may be the case if you are " -"using kernel autostart or do not need any arrays to boot." -msgstr "" -"Falls Sie keine RAID-Verbünde für das Wurzeldateisystem benötigen oder " -"starten wollen, lassen Sie die Antwort leer (oder geben »none« ein). Dies " -"könnte der Fall sein, wenn Sie entweder die Autostartfunktion des Kernels " -"verwenden oder keine Verbünde zum Booten benötigen." - -#. Type: text -#. Description -#: ../mdadm.templates:4001 -msgid "An error occurred: device node does not exist" -msgstr "Ein Fehler ist aufgetreten: Geräteknoten existiert nicht" - -#. Type: text -#. Description -#: ../mdadm.templates:5001 -msgid "An error occurred: not a block device" -msgstr "Ein Fehler ist aufgetreten: kein Blockgerät" - -#. Type: text -#. Description -#: ../mdadm.templates:6001 -msgid "An error occurred: not an MD array" -msgstr "Ein Fehler ist aufgetreten: kein RAID-Verbund" - -#. Type: text -#. Description -#: ../mdadm.templates:7001 -msgid "An error occurred: array not listed in mdadm.conf file" -msgstr "" -"Ein Fehler ist aufgetreten: Verbund nicht in der Datei mdadm.conf aufgeführt" - #. Type: boolean #. Description -#: ../mdadm.templates:8001 -msgid "Start arrays not listed in mdadm.conf?" -msgstr "Nicht in mdadm.conf aufgeführte Verbünde starten?" - -#. Type: boolean -#. Description -#: ../mdadm.templates:8001 -msgid "" -"The specified array (${array}) is not listed in the configuration file " -"(${config}). Therefore, it cannot be started during boot, unless you correct " -"the configuration file and recreate the initial ramdisk." -msgstr "" -"Der angegebene Verbund (${array}) ist in der Konfigurationsdatei ${config} " -"nicht aufgeführt. Deshalb kann er während des Bootvorgangs nicht gestartet " -"werden, es sei denn, Sie korrigieren die Konfigurationsdatei und erzeugen " -"die initiale Ramdisk neu." - -#. Type: boolean -#. Description -#: ../mdadm.templates:8001 -msgid "" -"This warning is only relevant if you need arrays to be started from the " -"initial ramdisk to be able to boot. If you use kernel autostarting, or do " -"not need any arrays to be started as early as the initial ramdisk is loaded, " -"you can simply continue. Alternatively, choose not to continue and enter " -"'none' when prompted which arrays to start from the initial ramdisk." -msgstr "" -"Diese Warnung ist nur von Bedeutung, wenn Sie RAID-Verbünde, die von der " -"initialen Ramdisk gestartet werden, benötigen, um booten zu können. Falls " -"Sie die Autostartfunktion des Kernels verwenden oder kein RAID-Verbund zum " -"frühen Zeitpunkt des Ladens der initialen Ramdisk gestartet werden muss, " -"können Sie einfach fortfahren. Alternativ wählen Sie, nicht fortzufahren und " -"geben »none« ein, wenn Sie gefragt werden, welche RAID-Verbünde von der " -"initialen Ramdisk gestartet werden sollen." - -#. Type: boolean -#. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "Should mdadm run monthly redundancy checks of the MD arrays?" msgstr "" "Soll mdadm monatlich die Redundanzüberprüfung auf den RAID-Verbünden " @@ -160,7 +32,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "" "If the kernel supports it (versions greater than 2.6.14), mdadm can " "periodically check the redundancy of MD arrays (RAIDs). This may be a " @@ -179,7 +51,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "" "The default, if turned on, is to check on the first Sunday of every month at " "01:06." @@ -189,13 +61,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "Do you want to start the MD monitoring daemon?" msgstr "Möchten Sie den RAID-Überwachungsdämon starten?" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "" "The MD (RAID) monitor daemon sends email notifications in response to " "important MD events (such as a disk failure)." @@ -205,19 +77,19 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "Enabling this option is recommended." msgstr "Das Aktivieren dieser Option ist empfohlen." #. Type: string #. Description -#: ../mdadm.templates:12001 +#: ../mdadm.templates:4001 msgid "Recipient for email notifications:" msgstr "Empfänger der E-Mail-Benachrichtungen:" #. Type: string #. Description -#: ../mdadm.templates:12001 +#: ../mdadm.templates:4001 msgid "" "Please enter the email address of the user who should get the email " "notifications for important MD events." @@ -225,6 +97,99 @@ msgstr "" "Geben Sie bitte die E-Mail-Adresse des Benutzers an, der die E-Mail-" "Benachrichtigung für wichtigen MD-Ereignisse erhalten soll." +#~ msgid "MD arrays needed for the root file system:" +#~ msgstr "Für das Wurzeldateisystem benötigte MD folgende Verbünde:" + +#~ msgid "" +#~ "Please enter 'all', 'none', or a space-separated list of devices such as " +#~ "'md0 md1' or 'md/1 md/d0' (the leading '/dev/' can be omitted)." +#~ msgstr "" +#~ "Bitte geben Sie »all«, »none« oder eine leerzeichenseparierte Geräteliste " +#~ "wie zum Beispiel »md0 md1« oder »md/1 md/d0« ein (das führende »/dev« " +#~ "kann weggelassen werden)." + +#~ msgid "for internal use - only the long description is needed." +#~ msgstr "" +#~ "für internen Gebrauch - es wird nur die ausführliche Beschreibung " +#~ "benötigt." + +#~ msgid "" +#~ "If the system's root file system is located on an MD array (RAID), it " +#~ "needs to be started early during the boot sequence. If it is located on a " +#~ "logical volume (LVM), which is on MD, all constituent arrays need to be " +#~ "started." +#~ msgstr "" +#~ "Wenn das Wurzeldateisystem Ihres Systems auf einem MD-Verbund (RAID) " +#~ "liegt, muss es frühzeitig während des Bootvorgangs gestartet werden. Wenn " +#~ "sich Ihr Wurzeldateisystem auf einem logischen Laufwerk (LVM) befindet, " +#~ "das sich wiederum auf einem MD Verbund befindet, müssen alle zugehörigen " +#~ "Verbünde gestartet werden." + +#~ msgid "" +#~ "If you know exactly which arrays are needed to bring up the root file " +#~ "system, and you want to postpone starting all other arrays to a later " +#~ "point in the boot sequence, enter the arrays to start here. " +#~ "Alternatively, enter 'all' to simply start all available arrays." +#~ msgstr "" +#~ "Wenn Sie genau wissen, welche Verbünde benötigt werden, um das " +#~ "Wurzeldateisystem zu starten, und Sie den Start der anderen Verbünde auf " +#~ "einen späteren Zeitpunkt in der Bootreihenfolge verschieben wollen, geben " +#~ "Sie die zu startenden Verbünde hier ein. Alternativ geben Sie »all« ein, " +#~ "um alle verfügbaren Verbünde zu starten." + +#~ msgid "" +#~ "If you do not need or want to start any arrays for the root file system, " +#~ "leave the answer blank (or enter 'none'). This may be the case if you are " +#~ "using kernel autostart or do not need any arrays to boot." +#~ msgstr "" +#~ "Falls Sie keine RAID-Verbünde für das Wurzeldateisystem benötigen oder " +#~ "starten wollen, lassen Sie die Antwort leer (oder geben »none« ein). Dies " +#~ "könnte der Fall sein, wenn Sie entweder die Autostartfunktion des Kernels " +#~ "verwenden oder keine Verbünde zum Booten benötigen." + +#~ msgid "An error occurred: device node does not exist" +#~ msgstr "Ein Fehler ist aufgetreten: Geräteknoten existiert nicht" + +#~ msgid "An error occurred: not a block device" +#~ msgstr "Ein Fehler ist aufgetreten: kein Blockgerät" + +#~ msgid "An error occurred: not an MD array" +#~ msgstr "Ein Fehler ist aufgetreten: kein RAID-Verbund" + +#~ msgid "An error occurred: array not listed in mdadm.conf file" +#~ msgstr "" +#~ "Ein Fehler ist aufgetreten: Verbund nicht in der Datei mdadm.conf " +#~ "aufgeführt" + +#~ msgid "Start arrays not listed in mdadm.conf?" +#~ msgstr "Nicht in mdadm.conf aufgeführte Verbünde starten?" + +#~ msgid "" +#~ "The specified array (${array}) is not listed in the configuration file " +#~ "(${config}). Therefore, it cannot be started during boot, unless you " +#~ "correct the configuration file and recreate the initial ramdisk." +#~ msgstr "" +#~ "Der angegebene Verbund (${array}) ist in der Konfigurationsdatei " +#~ "${config} nicht aufgeführt. Deshalb kann er während des Bootvorgangs " +#~ "nicht gestartet werden, es sei denn, Sie korrigieren die " +#~ "Konfigurationsdatei und erzeugen die initiale Ramdisk neu." + +#~ msgid "" +#~ "This warning is only relevant if you need arrays to be started from the " +#~ "initial ramdisk to be able to boot. If you use kernel autostarting, or do " +#~ "not need any arrays to be started as early as the initial ramdisk is " +#~ "loaded, you can simply continue. Alternatively, choose not to continue " +#~ "and enter 'none' when prompted which arrays to start from the initial " +#~ "ramdisk." +#~ msgstr "" +#~ "Diese Warnung ist nur von Bedeutung, wenn Sie RAID-Verbünde, die von der " +#~ "initialen Ramdisk gestartet werden, benötigen, um booten zu können. Falls " +#~ "Sie die Autostartfunktion des Kernels verwenden oder kein RAID-Verbund " +#~ "zum frühen Zeitpunkt des Ladens der initialen Ramdisk gestartet werden " +#~ "muss, können Sie einfach fortfahren. Alternativ wählen Sie, nicht " +#~ "fortzufahren und geben »none« ein, wenn Sie gefragt werden, welche RAID-" +#~ "Verbünde von der initialen Ramdisk gestartet werden sollen." + #~ msgid "Initialise the superblock if you reuse hard disks" #~ msgstr "" #~ "Initialisieren Sie den Superblock, wenn Sie Festplatten wieder verwenden." diff --git a/debian/po/es.po b/debian/po/es.po index d8809892..626b144e 100644 --- a/debian/po/es.po +++ b/debian/po/es.po @@ -39,7 +39,7 @@ msgid "" msgstr "" "Project-Id-Version: mdadm 2.5.6-6\n" "Report-Msgid-Bugs-To: mdadm@packages.debian.org\n" -"POT-Creation-Date: 2012-05-22 00:50+0100\n" +"POT-Creation-Date: 2016-07-05 14:12+0200\n" "PO-Revision-Date: 2008-04-25 17:47+0200\n" "Last-Translator: Javier Fernández-Sanguino <jfs@debian.org>\n" "Language-Team: Debian Spanish <debian-l10n-spanish@lists.debian.org>\n" @@ -48,136 +48,9 @@ msgstr "" "Content-Type: text/plain; charset=ISO-8859-15\n" "Content-Transfer-Encoding: 8bit\n" -#. Type: string -#. Description -#: ../mdadm.templates:2001 -msgid "MD arrays needed for the root file system:" -msgstr "Arrays MD necesarios para el sistema de ficheros raíz:" - -# No se traduce «all» y «none» porque no aparecen en la plantilla para traducir los elementos individuales -#. Type: string -#. Description -#: ../mdadm.templates:2001 -msgid "" -"Please enter 'all', 'none', or a space-separated list of devices such as " -"'md0 md1' or 'md/1 md/d0' (the leading '/dev/' can be omitted)." -msgstr "" -"Introduzca «all» (todos), «none» (ninguno) o una lista de dispositivos " -"separados por espacios como por ejemplo puede sólo introducir «md0 md1» o " -"«md/1 md/d0» (no tiene que preceder los nombres de dispositivos con «/dev»)." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "for internal use - only the long description is needed." -msgstr "para uso interno. Sólo se utiliza la descripción larga." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If the system's root file system is located on an MD array (RAID), it needs " -"to be started early during the boot sequence. If it is located on a logical " -"volume (LVM), which is on MD, all constituent arrays need to be started." -msgstr "" -"Si el sistema de ficheros raíz de su sistema está en un array MD (RAID) " -"tiene que inicializarse antes durante de la secuencia de arranque. Si está " -"en un volumen lógico (LVM), que está definido sobre un MD, todos los arrays " -"que lo forman tienen que haberse inicializado." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If you know exactly which arrays are needed to bring up the root file " -"system, and you want to postpone starting all other arrays to a later point " -"in the boot sequence, enter the arrays to start here. Alternatively, enter " -"'all' to simply start all available arrays." -msgstr "" -"Introduzca los arrays a iniciar aquí, si sabe con exactitud cuáles son " -"necesarios para arrancar el sistema de ficheros raíz y quiere posponer el " -"arranque de todos los demás arrays a un punto posterior de la secuencia de " -"arranque. También puede introducir «all» (todos) para, sencillamente, " -"iniciar todos los arrays disponibles." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If you do not need or want to start any arrays for the root file system, " -"leave the answer blank (or enter 'none'). This may be the case if you are " -"using kernel autostart or do not need any arrays to boot." -msgstr "" -"Puede dejar la respuesta en blanco (o introducir «none») si no necesita o " -"desea arrancar los arrays para el sistema de ficheros raíz. Este puede ser " -"su caso si está utilizando el autoarranque del núcleo o no necesita ningún " -"array para el arranque." - -#. Type: text -#. Description -#: ../mdadm.templates:4001 -msgid "An error occurred: device node does not exist" -msgstr "Se produjo un error: el nodo de dispositivo no existe" - -#. Type: text -#. Description -#: ../mdadm.templates:5001 -msgid "An error occurred: not a block device" -msgstr "Se produjo un error: no es un dispositivo de bloques" - -#. Type: text -#. Description -#: ../mdadm.templates:6001 -msgid "An error occurred: not an MD array" -msgstr "Se produjo un error: no es un array MD" - -#. Type: text -#. Description -#: ../mdadm.templates:7001 -msgid "An error occurred: array not listed in mdadm.conf file" -msgstr "" -"Se produjo un error: el array no está en la lista definida en el archivo " -"mdadm.conf" - -#. Type: boolean -#. Description -#: ../mdadm.templates:8001 -msgid "Start arrays not listed in mdadm.conf?" -msgstr "¿Desea arrancar los arrays no listados en mdadm.conf?" - -#. Type: boolean -#. Description -#: ../mdadm.templates:8001 -msgid "" -"The specified array (${array}) is not listed in the configuration file " -"(${config}). Therefore, it cannot be started during boot, unless you correct " -"the configuration file and recreate the initial ramdisk." -msgstr "" -"El array que ha especificado (${array}) no está listado en el fichero de " -"configuración ${config}. Este array no podrá iniciarse durante el arranque " -"del sistema a no ser que corrija el fichero de configuración y regenere el " -"disco de ram inicial." - #. Type: boolean #. Description -#: ../mdadm.templates:8001 -msgid "" -"This warning is only relevant if you need arrays to be started from the " -"initial ramdisk to be able to boot. If you use kernel autostarting, or do " -"not need any arrays to be started as early as the initial ramdisk is loaded, " -"you can simply continue. Alternatively, choose not to continue and enter " -"'none' when prompted which arrays to start from the initial ramdisk." -msgstr "" -"Este aviso sólo es relevante si necesita que los arrays se inicien en el " -"disco de RAM inicial para poder arrancar el sistema. Si utiliza el " -"autoarranque del núcleo o no necesita que los arrays estén arrancados tan " -"pronto como se cargue el disco de RAM, puede continuar simplemente. También " -"puede decidir no continuar e introducir «none» cuando se le pregunte qué " -"arrays deberían arrancarse del disco de RAM inicial." - -#. Type: boolean -#. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "Should mdadm run monthly redundancy checks of the MD arrays?" msgstr "" "¿Debería mdadm ejecutar comprobaciones de redundancia mensuales de los " @@ -185,7 +58,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "" "If the kernel supports it (versions greater than 2.6.14), mdadm can " "periodically check the redundancy of MD arrays (RAIDs). This may be a " @@ -205,7 +78,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "" "The default, if turned on, is to check on the first Sunday of every month at " "01:06." @@ -215,13 +88,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "Do you want to start the MD monitoring daemon?" msgstr "¿Desea arrancar el demonio de monitorización MD?" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "" "The MD (RAID) monitor daemon sends email notifications in response to " "important MD events (such as a disk failure)." @@ -232,19 +105,19 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "Enabling this option is recommended." msgstr "Es opcional habilitar esta opción." #. Type: string #. Description -#: ../mdadm.templates:12001 +#: ../mdadm.templates:4001 msgid "Recipient for email notifications:" msgstr "Destinatario de las notificaciones por correo:" #. Type: string #. Description -#: ../mdadm.templates:12001 +#: ../mdadm.templates:4001 msgid "" "Please enter the email address of the user who should get the email " "notifications for important MD events." @@ -252,3 +125,94 @@ msgstr "" "Introduzca la dirección de correo electrónico del usuario que debería " "recibir las notificaciones por correo de eventos relevantes en los " "dispositivos MD." + +#~ msgid "MD arrays needed for the root file system:" +#~ msgstr "Arrays MD necesarios para el sistema de ficheros raíz:" + +# No se traduce «all» y «none» porque no aparecen en la plantilla para traducir los elementos individuales +#~ msgid "" +#~ "Please enter 'all', 'none', or a space-separated list of devices such as " +#~ "'md0 md1' or 'md/1 md/d0' (the leading '/dev/' can be omitted)." +#~ msgstr "" +#~ "Introduzca «all» (todos), «none» (ninguno) o una lista de dispositivos " +#~ "separados por espacios como por ejemplo puede sólo introducir «md0 md1» o " +#~ "«md/1 md/d0» (no tiene que preceder los nombres de dispositivos con «/" +#~ "dev»)." + +#~ msgid "for internal use - only the long description is needed." +#~ msgstr "para uso interno. Sólo se utiliza la descripción larga." + +#~ msgid "" +#~ "If the system's root file system is located on an MD array (RAID), it " +#~ "needs to be started early during the boot sequence. If it is located on a " +#~ "logical volume (LVM), which is on MD, all constituent arrays need to be " +#~ "started." +#~ msgstr "" +#~ "Si el sistema de ficheros raíz de su sistema está en un array MD (RAID) " +#~ "tiene que inicializarse antes durante de la secuencia de arranque. Si " +#~ "está en un volumen lógico (LVM), que está definido sobre un MD, todos los " +#~ "arrays que lo forman tienen que haberse inicializado." + +#~ msgid "" +#~ "If you know exactly which arrays are needed to bring up the root file " +#~ "system, and you want to postpone starting all other arrays to a later " +#~ "point in the boot sequence, enter the arrays to start here. " +#~ "Alternatively, enter 'all' to simply start all available arrays." +#~ msgstr "" +#~ "Introduzca los arrays a iniciar aquí, si sabe con exactitud cuáles son " +#~ "necesarios para arrancar el sistema de ficheros raíz y quiere posponer el " +#~ "arranque de todos los demás arrays a un punto posterior de la secuencia " +#~ "de arranque. También puede introducir «all» (todos) para, sencillamente, " +#~ "iniciar todos los arrays disponibles." + +#~ msgid "" +#~ "If you do not need or want to start any arrays for the root file system, " +#~ "leave the answer blank (or enter 'none'). This may be the case if you are " +#~ "using kernel autostart or do not need any arrays to boot." +#~ msgstr "" +#~ "Puede dejar la respuesta en blanco (o introducir «none») si no necesita o " +#~ "desea arrancar los arrays para el sistema de ficheros raíz. Este puede " +#~ "ser su caso si está utilizando el autoarranque del núcleo o no necesita " +#~ "ningún array para el arranque." + +#~ msgid "An error occurred: device node does not exist" +#~ msgstr "Se produjo un error: el nodo de dispositivo no existe" + +#~ msgid "An error occurred: not a block device" +#~ msgstr "Se produjo un error: no es un dispositivo de bloques" + +#~ msgid "An error occurred: not an MD array" +#~ msgstr "Se produjo un error: no es un array MD" + +#~ msgid "An error occurred: array not listed in mdadm.conf file" +#~ msgstr "" +#~ "Se produjo un error: el array no está en la lista definida en el archivo " +#~ "mdadm.conf" + +#~ msgid "Start arrays not listed in mdadm.conf?" +#~ msgstr "¿Desea arrancar los arrays no listados en mdadm.conf?" + +#~ msgid "" +#~ "The specified array (${array}) is not listed in the configuration file " +#~ "(${config}). Therefore, it cannot be started during boot, unless you " +#~ "correct the configuration file and recreate the initial ramdisk." +#~ msgstr "" +#~ "El array que ha especificado (${array}) no está listado en el fichero de " +#~ "configuración ${config}. Este array no podrá iniciarse durante el " +#~ "arranque del sistema a no ser que corrija el fichero de configuración y " +#~ "regenere el disco de ram inicial." + +#~ msgid "" +#~ "This warning is only relevant if you need arrays to be started from the " +#~ "initial ramdisk to be able to boot. If you use kernel autostarting, or do " +#~ "not need any arrays to be started as early as the initial ramdisk is " +#~ "loaded, you can simply continue. Alternatively, choose not to continue " +#~ "and enter 'none' when prompted which arrays to start from the initial " +#~ "ramdisk." +#~ msgstr "" +#~ "Este aviso sólo es relevante si necesita que los arrays se inicien en el " +#~ "disco de RAM inicial para poder arrancar el sistema. Si utiliza el " +#~ "autoarranque del núcleo o no necesita que los arrays estén arrancados tan " +#~ "pronto como se cargue el disco de RAM, puede continuar simplemente. " +#~ "También puede decidir no continuar e introducir «none» cuando se le " +#~ "pregunte qué arrays deberían arrancarse del disco de RAM inicial." diff --git a/debian/po/eu.po b/debian/po/eu.po index 06d8e537..259dce2b 100644 --- a/debian/po/eu.po +++ b/debian/po/eu.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: mdadm-debconf\n" "Report-Msgid-Bugs-To: mdadm@packages.debian.org\n" -"POT-Creation-Date: 2012-05-22 00:50+0100\n" +"POT-Creation-Date: 2016-07-05 14:12+0200\n" "PO-Revision-Date: Y2008-04-30 11:00+0100\n" "Last-Translator: Piarres Beobide <pi@beobide.net>\n" "Language-Team: Euskara <debian-l10n-basque@lists.debian.org>\n" @@ -16,136 +16,16 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#. Type: string -#. Description -#: ../mdadm.templates:2001 -msgid "MD arrays needed for the root file system:" -msgstr "Erro fitxategi-sistemarentzat beharrezko MD array-ak:" - -#. Type: string -#. Description -#: ../mdadm.templates:2001 -msgid "" -"Please enter 'all', 'none', or a space-separated list of devices such as " -"'md0 md1' or 'md/1 md/d0' (the leading '/dev/' can be omitted)." -msgstr "" -"Mesedez idatzi 'denak', 'batez', edo zuriunez bereziriko gailuen zerrenda, " -"adibidez 'md0 md1' edo 'md/1 md/d0' (hasierako '/dev/' baztertu daiteke)." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "for internal use - only the long description is needed." -msgstr "barne erabilerako - deskribapen luzea bakarrik behar da." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If the system's root file system is located on an MD array (RAID), it needs " -"to be started early during the boot sequence. If it is located on a logical " -"volume (LVM), which is on MD, all constituent arrays need to be started." -msgstr "" -"Sistemaren erro fitxategi-sistema MD array (RAID) batetan kokaturik badago, " -"berau abio sekuentziaren hasieran abiarazi behar da. MD batetan kokaturiko " -"bolumen logiko (LVM) batetan badago osatzen duten array guztiak abiarazi " -"behar dira." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If you know exactly which arrays are needed to bring up the root file " -"system, and you want to postpone starting all other arrays to a later point " -"in the boot sequence, enter the arrays to start here. Alternatively, enter " -"'all' to simply start all available arrays." -msgstr "" -"Erro fitxategi-sistema erabiltzeko beharrezkoak diren arrayak zehazki jakin " -"eta beste array-en abiaraztea abioaren beranduagoko puntu batetara atzeratu " -"nahi baduzu, idatzi abiarazi beharreko array-ak hemen. Bestela idatzi " -"'denak' array erabilgarri guztiak abiarazteko." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If you do not need or want to start any arrays for the root file system, " -"leave the answer blank (or enter 'none'). This may be the case if you are " -"using kernel autostart or do not need any arrays to boot." -msgstr "" -"Ez baduzu erro fitxategi sistemarako array-rik abiarazi behar, hutsik utzi " -"ezazu (edo 'batez' idatzi). Hau abioan array-rik behar ez duzulako edo " -"kernel auto-abioa erabiltzen duzulako izan daiteke." - -#. Type: text -#. Description -#: ../mdadm.templates:4001 -msgid "An error occurred: device node does not exist" -msgstr "Errore bat gertatu da: gailu nodoa ez dago" - -#. Type: text -#. Description -#: ../mdadm.templates:5001 -msgid "An error occurred: not a block device" -msgstr "Errore bat gertatu da: ez da bloke gailu bat" - -#. Type: text -#. Description -#: ../mdadm.templates:6001 -msgid "An error occurred: not an MD array" -msgstr "Errore bat gertatu da: ez da MD array bat" - -#. Type: text -#. Description -#: ../mdadm.templates:7001 -msgid "An error occurred: array not listed in mdadm.conf file" -msgstr "" -"Errore bat gertatu da: array-a ez dago mdadm.conf fitxategian zerrendaturik" - -#. Type: boolean -#. Description -#: ../mdadm.templates:8001 -msgid "Start arrays not listed in mdadm.conf?" -msgstr "Abiarazi mdadm.conf fitxategian ez dauden array-ak?" - -#. Type: boolean -#. Description -#: ../mdadm.templates:8001 -msgid "" -"The specified array (${array}) is not listed in the configuration file " -"(${config}). Therefore, it cannot be started during boot, unless you correct " -"the configuration file and recreate the initial ramdisk." -msgstr "" -"Zehazturiko (${array}) array-a ez dago (${config}) konfigurazio fitxategian " -"zerrendaturiko. Horregatik ezin da abioan abiarazi zuk konfigurazio " -"fitxategia konpondu eta abio ramdiskoa bersortu arte." - -#. Type: boolean -#. Description -#: ../mdadm.templates:8001 -msgid "" -"This warning is only relevant if you need arrays to be started from the " -"initial ramdisk to be able to boot. If you use kernel autostarting, or do " -"not need any arrays to be started as early as the initial ramdisk is loaded, " -"you can simply continue. Alternatively, choose not to continue and enter " -"'none' when prompted which arrays to start from the initial ramdisk." -msgstr "" -"Abisu hau abiarazi ahal izateko ramdisk.etik array-ak baiaraztea behar " -"baduzu bakarrik da garrantzitsua. Kernel auto-abioa erabiltzen baduzu edo ez " -"baduzu ramdisk-etik hasieran array-rik kargatzea behar aurrera jarraitu " -"dezakezu. Bestela ez jarraitzea hautatu eta 'batez' idatzi hasierako ramdisk-" -"etik kargatu beharreko array-ez galdetzean." - #. Type: boolean #. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "Should mdadm run monthly redundancy checks of the MD arrays?" msgstr "" "Mdadm-ek hilabetero egin behar al du MD array-en erredundantzia egiaztapena?" #. Type: boolean #. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "" "If the kernel supports it (versions greater than 2.6.14), mdadm can " "periodically check the redundancy of MD arrays (RAIDs). This may be a " @@ -164,7 +44,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "" "The default, if turned on, is to check on the first Sunday of every month at " "01:06." @@ -174,13 +54,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "Do you want to start the MD monitoring daemon?" msgstr "MD monitorizazio deabrua abiarazi nahi al duzu?" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "" "The MD (RAID) monitor daemon sends email notifications in response to " "important MD events (such as a disk failure)." @@ -190,22 +70,107 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "Enabling this option is recommended." msgstr "Aukera hau gaitzea gomendagarria da." #. Type: string #. Description -#: ../mdadm.templates:12001 +#: ../mdadm.templates:4001 msgid "Recipient for email notifications:" msgstr "Eposta berri-emateen hartzailea:" #. Type: string #. Description -#: ../mdadm.templates:12001 +#: ../mdadm.templates:4001 msgid "" "Please enter the email address of the user who should get the email " "notifications for important MD events." msgstr "" "Mesedez idatzi MD gertaera garrantzitsuen berri emate mezuak jaso behar " "dituen erabiltzailearen eposta helbidea." + +#~ msgid "MD arrays needed for the root file system:" +#~ msgstr "Erro fitxategi-sistemarentzat beharrezko MD array-ak:" + +#~ msgid "" +#~ "Please enter 'all', 'none', or a space-separated list of devices such as " +#~ "'md0 md1' or 'md/1 md/d0' (the leading '/dev/' can be omitted)." +#~ msgstr "" +#~ "Mesedez idatzi 'denak', 'batez', edo zuriunez bereziriko gailuen " +#~ "zerrenda, adibidez 'md0 md1' edo 'md/1 md/d0' (hasierako '/dev/' baztertu " +#~ "daiteke)." + +#~ msgid "for internal use - only the long description is needed." +#~ msgstr "barne erabilerako - deskribapen luzea bakarrik behar da." + +#~ msgid "" +#~ "If the system's root file system is located on an MD array (RAID), it " +#~ "needs to be started early during the boot sequence. If it is located on a " +#~ "logical volume (LVM), which is on MD, all constituent arrays need to be " +#~ "started." +#~ msgstr "" +#~ "Sistemaren erro fitxategi-sistema MD array (RAID) batetan kokaturik " +#~ "badago, berau abio sekuentziaren hasieran abiarazi behar da. MD batetan " +#~ "kokaturiko bolumen logiko (LVM) batetan badago osatzen duten array " +#~ "guztiak abiarazi behar dira." + +#~ msgid "" +#~ "If you know exactly which arrays are needed to bring up the root file " +#~ "system, and you want to postpone starting all other arrays to a later " +#~ "point in the boot sequence, enter the arrays to start here. " +#~ "Alternatively, enter 'all' to simply start all available arrays." +#~ msgstr "" +#~ "Erro fitxategi-sistema erabiltzeko beharrezkoak diren arrayak zehazki " +#~ "jakin eta beste array-en abiaraztea abioaren beranduagoko puntu batetara " +#~ "atzeratu nahi baduzu, idatzi abiarazi beharreko array-ak hemen. Bestela " +#~ "idatzi 'denak' array erabilgarri guztiak abiarazteko." + +#~ msgid "" +#~ "If you do not need or want to start any arrays for the root file system, " +#~ "leave the answer blank (or enter 'none'). This may be the case if you are " +#~ "using kernel autostart or do not need any arrays to boot." +#~ msgstr "" +#~ "Ez baduzu erro fitxategi sistemarako array-rik abiarazi behar, hutsik " +#~ "utzi ezazu (edo 'batez' idatzi). Hau abioan array-rik behar ez duzulako " +#~ "edo kernel auto-abioa erabiltzen duzulako izan daiteke." + +#~ msgid "An error occurred: device node does not exist" +#~ msgstr "Errore bat gertatu da: gailu nodoa ez dago" + +#~ msgid "An error occurred: not a block device" +#~ msgstr "Errore bat gertatu da: ez da bloke gailu bat" + +#~ msgid "An error occurred: not an MD array" +#~ msgstr "Errore bat gertatu da: ez da MD array bat" + +#~ msgid "An error occurred: array not listed in mdadm.conf file" +#~ msgstr "" +#~ "Errore bat gertatu da: array-a ez dago mdadm.conf fitxategian " +#~ "zerrendaturik" + +#~ msgid "Start arrays not listed in mdadm.conf?" +#~ msgstr "Abiarazi mdadm.conf fitxategian ez dauden array-ak?" + +#~ msgid "" +#~ "The specified array (${array}) is not listed in the configuration file " +#~ "(${config}). Therefore, it cannot be started during boot, unless you " +#~ "correct the configuration file and recreate the initial ramdisk." +#~ msgstr "" +#~ "Zehazturiko (${array}) array-a ez dago (${config}) konfigurazio " +#~ "fitxategian zerrendaturiko. Horregatik ezin da abioan abiarazi zuk " +#~ "konfigurazio fitxategia konpondu eta abio ramdiskoa bersortu arte." + +#~ msgid "" +#~ "This warning is only relevant if you need arrays to be started from the " +#~ "initial ramdisk to be able to boot. If you use kernel autostarting, or do " +#~ "not need any arrays to be started as early as the initial ramdisk is " +#~ "loaded, you can simply continue. Alternatively, choose not to continue " +#~ "and enter 'none' when prompted which arrays to start from the initial " +#~ "ramdisk." +#~ msgstr "" +#~ "Abisu hau abiarazi ahal izateko ramdisk.etik array-ak baiaraztea behar " +#~ "baduzu bakarrik da garrantzitsua. Kernel auto-abioa erabiltzen baduzu edo " +#~ "ez baduzu ramdisk-etik hasieran array-rik kargatzea behar aurrera " +#~ "jarraitu dezakezu. Bestela ez jarraitzea hautatu eta 'batez' idatzi " +#~ "hasierako ramdisk-etik kargatu beharreko array-ez galdetzean." diff --git a/debian/po/fi.po b/debian/po/fi.po index 688baef0..759d3b37 100644 --- a/debian/po/fi.po +++ b/debian/po/fi.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: mdadm\n" "Report-Msgid-Bugs-To: mdadm@packages.debian.org\n" -"POT-Creation-Date: 2012-05-22 00:50+0100\n" +"POT-Creation-Date: 2016-07-05 14:12+0200\n" "PO-Revision-Date: 2008-02-14 11:24+0200\n" "Last-Translator: Esko Arajärvi <edu@iki.fi>\n" "Language-Team: Finnish <debian-l10n-finnish@lists.debian.org>\n" @@ -13,136 +13,15 @@ msgstr "" "X-Poedit-Language: Finnish\n" "X-Poedit-Country: FINLAND\n" -#. Type: string -#. Description -#: ../mdadm.templates:2001 -msgid "MD arrays needed for the root file system:" -msgstr "Juuritiedostojärjestelmän tarvitsemat MD-pakat:" - -#. Type: string -#. Description -#: ../mdadm.templates:2001 -msgid "" -"Please enter 'all', 'none', or a space-separated list of devices such as " -"'md0 md1' or 'md/1 md/d0' (the leading '/dev/' can be omitted)." -msgstr "" -"Syötä â€all†(kaikki), â€none†(ei mitään) tai välilyönnein eroteltu lista " -"laitteista, esimerkiksi â€md0 md1†tai â€md/1 md/d0†(edeltävä /dev/ voidaan " -"jättää pois)." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "for internal use - only the long description is needed." -msgstr "vain sisäiseen käyttöön - vain pitkä kuvaus on tarpeellinen." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If the system's root file system is located on an MD array (RAID), it needs " -"to be started early during the boot sequence. If it is located on a logical " -"volume (LVM), which is on MD, all constituent arrays need to be started." -msgstr "" -"Jos järjestelmän juuritiedostojärjestelmä sijaitsee MD-levypakassa (RAID), " -"pakka tulee käynnistää aikaisessa vaiheessa käynnistettäessä järjestelmää. " -"Jos se sijaitsee loogisella taltiolla (LVM), joka on MD-pakassa, kaikki " -"taltioon liittyvät pakat tulee käynnistää." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If you know exactly which arrays are needed to bring up the root file " -"system, and you want to postpone starting all other arrays to a later point " -"in the boot sequence, enter the arrays to start here. Alternatively, enter " -"'all' to simply start all available arrays." -msgstr "" -"Jos tiedät tarkalleen mitä pakkoja tarvitaan juuritiedostojärjestelmän " -"käynnistämiseen ja haluat viivästyttää muiden pakkojen käynnistystä, syötä " -"käynnistettävät pakat tähän. Vaihtoehtoisesti voit käynnistää kaikki pakat " -"syöttämällä â€allâ€." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If you do not need or want to start any arrays for the root file system, " -"leave the answer blank (or enter 'none'). This may be the case if you are " -"using kernel autostart or do not need any arrays to boot." -msgstr "" -"Jos mitään pakkoja ei tarvitse käynnistää juuritiedostojärjestelmän " -"käyttämiseksi, jätä kenttä tyhjäksi (tai syötä â€noneâ€). Tämä voi olla " -"tilanne, jos käytät ytimen autokäynnistystä tai et tarvitse mitään pakkoja " -"käynnistykseen." - -#. Type: text -#. Description -#: ../mdadm.templates:4001 -msgid "An error occurred: device node does not exist" -msgstr "Tapahtui virhe: laitetiedostoa ei ole olemassa" - -#. Type: text -#. Description -#: ../mdadm.templates:5001 -msgid "An error occurred: not a block device" -msgstr "Tapahtui virhe: ei lohkolaite" - -#. Type: text -#. Description -#: ../mdadm.templates:6001 -msgid "An error occurred: not an MD array" -msgstr "Tapahtui virhe: ei MD-pakka" - -#. Type: text -#. Description -#: ../mdadm.templates:7001 -msgid "An error occurred: array not listed in mdadm.conf file" -msgstr "Tapahtui virhe: pakkaa ei ole listattu tiedostossa mdadm.conf" - -#. Type: boolean -#. Description -#: ../mdadm.templates:8001 -msgid "Start arrays not listed in mdadm.conf?" -msgstr "Käynnistetäänkö pakat, joita ei ole listattu tiedostossa mdadm.conf?" - -#. Type: boolean -#. Description -#: ../mdadm.templates:8001 -msgid "" -"The specified array (${array}) is not listed in the configuration file " -"(${config}). Therefore, it cannot be started during boot, unless you correct " -"the configuration file and recreate the initial ramdisk." -msgstr "" -"Annettua pakkaa (${array}) ei ole listattu asetustiedostossa (${config}). " -"Niinpä sitä ei voida käynnistää käynnistettäessä järjestelmä, ellei " -"asetustiedostoa korjata ja käynnistysmuistilevyä (initrd) luoda uudelleen." - #. Type: boolean #. Description -#: ../mdadm.templates:8001 -msgid "" -"This warning is only relevant if you need arrays to be started from the " -"initial ramdisk to be able to boot. If you use kernel autostarting, or do " -"not need any arrays to be started as early as the initial ramdisk is loaded, " -"you can simply continue. Alternatively, choose not to continue and enter " -"'none' when prompted which arrays to start from the initial ramdisk." -msgstr "" -"Tämä varoitus on aiheellinen vain, jos järjestelmän käynnistäminen vaatii " -"pakkojen käynnistämistä käynnistysmuistilevyltä. Jos ytimen autokäynnistys " -"on käytössä tai pakkoja ei tarvita siinä vaiheessa, kun käynnistysmuistilevy " -"ladataan, voit jatkaa. Vaihtoehtoisesti voit olla jatkamatta ja syöttää " -"â€none†kysyttäessä käynnistysmuistilevyltä käynnistettäviä pakkoja." - -#. Type: boolean -#. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "Should mdadm run monthly redundancy checks of the MD arrays?" msgstr "Tulisiko mdadm:n tarkistaa kuukausittain MD-pakkojen eheys?" #. Type: boolean #. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "" "If the kernel supports it (versions greater than 2.6.14), mdadm can " "periodically check the redundancy of MD arrays (RAIDs). This may be a " @@ -161,7 +40,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "" "The default, if turned on, is to check on the first Sunday of every month at " "01:06." @@ -171,13 +50,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "Do you want to start the MD monitoring daemon?" msgstr "Haluatko käynnistää MD-seurannan?" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "" "The MD (RAID) monitor daemon sends email notifications in response to " "important MD events (such as a disk failure)." @@ -187,22 +66,108 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "Enabling this option is recommended." msgstr "Tämän valitseminen on suositeltavaa." #. Type: string #. Description -#: ../mdadm.templates:12001 +#: ../mdadm.templates:4001 msgid "Recipient for email notifications:" msgstr "Sähköpostiviestien vastaanottaja:" #. Type: string #. Description -#: ../mdadm.templates:12001 +#: ../mdadm.templates:4001 msgid "" "Please enter the email address of the user who should get the email " "notifications for important MD events." msgstr "" "Anna sähköpostiosoite, johon sähköpostitiedotteet tärkeistä MD-tapahtumista " "lähetetään." + +#~ msgid "MD arrays needed for the root file system:" +#~ msgstr "Juuritiedostojärjestelmän tarvitsemat MD-pakat:" + +#~ msgid "" +#~ "Please enter 'all', 'none', or a space-separated list of devices such as " +#~ "'md0 md1' or 'md/1 md/d0' (the leading '/dev/' can be omitted)." +#~ msgstr "" +#~ "Syötä â€all†(kaikki), â€none†(ei mitään) tai välilyönnein eroteltu lista " +#~ "laitteista, esimerkiksi â€md0 md1†tai â€md/1 md/d0†(edeltävä /dev/ " +#~ "voidaan jättää pois)." + +#~ msgid "for internal use - only the long description is needed." +#~ msgstr "vain sisäiseen käyttöön - vain pitkä kuvaus on tarpeellinen." + +#~ msgid "" +#~ "If the system's root file system is located on an MD array (RAID), it " +#~ "needs to be started early during the boot sequence. If it is located on a " +#~ "logical volume (LVM), which is on MD, all constituent arrays need to be " +#~ "started." +#~ msgstr "" +#~ "Jos järjestelmän juuritiedostojärjestelmä sijaitsee MD-levypakassa " +#~ "(RAID), pakka tulee käynnistää aikaisessa vaiheessa käynnistettäessä " +#~ "järjestelmää. Jos se sijaitsee loogisella taltiolla (LVM), joka on MD-" +#~ "pakassa, kaikki taltioon liittyvät pakat tulee käynnistää." + +#~ msgid "" +#~ "If you know exactly which arrays are needed to bring up the root file " +#~ "system, and you want to postpone starting all other arrays to a later " +#~ "point in the boot sequence, enter the arrays to start here. " +#~ "Alternatively, enter 'all' to simply start all available arrays." +#~ msgstr "" +#~ "Jos tiedät tarkalleen mitä pakkoja tarvitaan juuritiedostojärjestelmän " +#~ "käynnistämiseen ja haluat viivästyttää muiden pakkojen käynnistystä, " +#~ "syötä käynnistettävät pakat tähän. Vaihtoehtoisesti voit käynnistää " +#~ "kaikki pakat syöttämällä â€allâ€." + +#~ msgid "" +#~ "If you do not need or want to start any arrays for the root file system, " +#~ "leave the answer blank (or enter 'none'). This may be the case if you are " +#~ "using kernel autostart or do not need any arrays to boot." +#~ msgstr "" +#~ "Jos mitään pakkoja ei tarvitse käynnistää juuritiedostojärjestelmän " +#~ "käyttämiseksi, jätä kenttä tyhjäksi (tai syötä â€noneâ€). Tämä voi olla " +#~ "tilanne, jos käytät ytimen autokäynnistystä tai et tarvitse mitään " +#~ "pakkoja käynnistykseen." + +#~ msgid "An error occurred: device node does not exist" +#~ msgstr "Tapahtui virhe: laitetiedostoa ei ole olemassa" + +#~ msgid "An error occurred: not a block device" +#~ msgstr "Tapahtui virhe: ei lohkolaite" + +#~ msgid "An error occurred: not an MD array" +#~ msgstr "Tapahtui virhe: ei MD-pakka" + +#~ msgid "An error occurred: array not listed in mdadm.conf file" +#~ msgstr "Tapahtui virhe: pakkaa ei ole listattu tiedostossa mdadm.conf" + +#~ msgid "Start arrays not listed in mdadm.conf?" +#~ msgstr "" +#~ "Käynnistetäänkö pakat, joita ei ole listattu tiedostossa mdadm.conf?" + +#~ msgid "" +#~ "The specified array (${array}) is not listed in the configuration file " +#~ "(${config}). Therefore, it cannot be started during boot, unless you " +#~ "correct the configuration file and recreate the initial ramdisk." +#~ msgstr "" +#~ "Annettua pakkaa (${array}) ei ole listattu asetustiedostossa (${config}). " +#~ "Niinpä sitä ei voida käynnistää käynnistettäessä järjestelmä, ellei " +#~ "asetustiedostoa korjata ja käynnistysmuistilevyä (initrd) luoda uudelleen." + +#~ msgid "" +#~ "This warning is only relevant if you need arrays to be started from the " +#~ "initial ramdisk to be able to boot. If you use kernel autostarting, or do " +#~ "not need any arrays to be started as early as the initial ramdisk is " +#~ "loaded, you can simply continue. Alternatively, choose not to continue " +#~ "and enter 'none' when prompted which arrays to start from the initial " +#~ "ramdisk." +#~ msgstr "" +#~ "Tämä varoitus on aiheellinen vain, jos järjestelmän käynnistäminen vaatii " +#~ "pakkojen käynnistämistä käynnistysmuistilevyltä. Jos ytimen " +#~ "autokäynnistys on käytössä tai pakkoja ei tarvita siinä vaiheessa, kun " +#~ "käynnistysmuistilevy ladataan, voit jatkaa. Vaihtoehtoisesti voit olla " +#~ "jatkamatta ja syöttää â€none†kysyttäessä käynnistysmuistilevyltä " +#~ "käynnistettäviä pakkoja." diff --git a/debian/po/fr.po b/debian/po/fr.po index ce2459c4..df033b3c 100644 --- a/debian/po/fr.po +++ b/debian/po/fr.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: mdadm\n" "Report-Msgid-Bugs-To: mdadm@packages.debian.org\n" -"POT-Creation-Date: 2012-05-22 00:50+0100\n" +"POT-Creation-Date: 2016-07-05 14:12+0200\n" "PO-Revision-Date: 2008-02-15 20:42+0100\n" "Last-Translator: Florentin Duneau <fduneau@gmail.com>\n" "Language-Team: French <debian-l10n-french@lists.debian.org>\n" @@ -21,142 +21,15 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" "X-Generator: KBabel 1.11.4\n" -#. Type: string -#. Description -#: ../mdadm.templates:2001 -msgid "MD arrays needed for the root file system:" -msgstr "Ensembles MD requis par le système de fichiers racine :" - -#. Type: string -#. Description -#: ../mdadm.templates:2001 -msgid "" -"Please enter 'all', 'none', or a space-separated list of devices such as " -"'md0 md1' or 'md/1 md/d0' (the leading '/dev/' can be omitted)." -msgstr "" -"Veuillez indiquer « all », « none » ou une liste de périphériques, séparés " -"par des espaces, par exemple, « md0 md1 » ou « md/1 md/d0 » (vous pouvez " -"omettre « /dev/ »)." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "for internal use - only the long description is needed." -msgstr "" -"Pour une utilisation interne - seule la description longue est nécessaire" - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If the system's root file system is located on an MD array (RAID), it needs " -"to be started early during the boot sequence. If it is located on a logical " -"volume (LVM), which is on MD, all constituent arrays need to be started." -msgstr "" -"Si le système de fichiers racine se trouve sur un ensemble MD (RAID), il " -"doit être lancé au début de la procédure de démarrage. Si le système de " -"fichiers racine se trouve sur un volume logique (« LVM »), qui se trouve " -"aussi sur un volume MD, tous les composants de l'ensemble doivent être " -"démarrés." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If you know exactly which arrays are needed to bring up the root file " -"system, and you want to postpone starting all other arrays to a later point " -"in the boot sequence, enter the arrays to start here. Alternatively, enter " -"'all' to simply start all available arrays." -msgstr "" -"Si vous savez exactement quels sont les ensembles RAID nécessaires au " -"démarrage du système de fichiers racine et si vous souhaitez différer le " -"démarrage de tous les autres ensembles, veuillez les indiquer ici. Vous " -"pouvez aussi indiquer « all » pour démarrer tous les ensembles existants." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If you do not need or want to start any arrays for the root file system, " -"leave the answer blank (or enter 'none'). This may be the case if you are " -"using kernel autostart or do not need any arrays to boot." -msgstr "" -"Si vous n'avez pas besoin ou ne souhaitez pas démarrer d'ensemble RAID pour " -"le système de fichiers racine, veuillez laissez l'entrée vide (ou entrez " -"« none »). Ceci peut être le cas si vous utilisez l'option de démarrage " -"automatique (« autostart ») du noyau ou si vous n'avez besoin d'aucun " -"ensemble pour démarrer." - -#. Type: text -#. Description -#: ../mdadm.templates:4001 -msgid "An error occurred: device node does not exist" -msgstr "Erreur : périphérique inconnu" - -#. Type: text -#. Description -#: ../mdadm.templates:5001 -msgid "An error occurred: not a block device" -msgstr "Erreur : ce n'est pas un périphérique en mode bloc" - -#. Type: text -#. Description -#: ../mdadm.templates:6001 -msgid "An error occurred: not an MD array" -msgstr "Erreur : ce n'est pas un ensemble RAID" - -#. Type: text -#. Description -#: ../mdadm.templates:7001 -msgid "An error occurred: array not listed in mdadm.conf file" -msgstr "Erreur : ensemble non mentionné dans le fichier mdadm.conf" - -#. Type: boolean -#. Description -#: ../mdadm.templates:8001 -msgid "Start arrays not listed in mdadm.conf?" -msgstr "Faut-il démarrer les ensembles RAID non mentionnés dans mdadm.conf ?" - -#. Type: boolean -#. Description -#: ../mdadm.templates:8001 -msgid "" -"The specified array (${array}) is not listed in the configuration file " -"(${config}). Therefore, it cannot be started during boot, unless you correct " -"the configuration file and recreate the initial ramdisk." -msgstr "" -"L'ensemble (${array}) que vous avez spécifié n'est pas mentionné dans le " -"fichier de configuration ${config}. Il ne sera donc pas démarré à moins que " -"vous corrigiez le fichier de configuration et que vous génériez de nouveau " -"le disque mémoire initial (« ramdisk »)." - -#. Type: boolean -#. Description -#: ../mdadm.templates:8001 -msgid "" -"This warning is only relevant if you need arrays to be started from the " -"initial ramdisk to be able to boot. If you use kernel autostarting, or do " -"not need any arrays to be started as early as the initial ramdisk is loaded, " -"you can simply continue. Alternatively, choose not to continue and enter " -"'none' when prompted which arrays to start from the initial ramdisk." -msgstr "" -"Cet avertissement n'a de signification que si des ensembles RAID doivent " -"être lancés à partir du disque mémoire initial afin de pouvoir démarrer le " -"système. Si vous utilisez le démarrage automatique par le noyau, ou si vous " -"n'avez pas besoin de lancer d'ensemble RAID depuis le disque mémoire " -"initial, vous pouvez simplement poursuivre. Vous pouvez aussi choisir de ne " -"pas poursuivre et entrer « none » lorsqu'il vous sera demandé le nom des " -"ensembles RAID à démarrer à partir du disque mémoire initial." - #. Type: boolean #. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "Should mdadm run monthly redundancy checks of the MD arrays?" msgstr "Faut-il vérifier chaque mois la redondance des ensembles RAID ?" #. Type: boolean #. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "" "If the kernel supports it (versions greater than 2.6.14), mdadm can " "periodically check the redundancy of MD arrays (RAIDs). This may be a " @@ -175,7 +48,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "" "The default, if turned on, is to check on the first Sunday of every month at " "01:06." @@ -185,13 +58,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "Do you want to start the MD monitoring daemon?" msgstr "Faut-il démarrer le démon de surveillance MD ?" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "" "The MD (RAID) monitor daemon sends email notifications in response to " "important MD events (such as a disk failure)." @@ -201,22 +74,113 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "Enabling this option is recommended." msgstr "Il est recommandé d'activer cette option." #. Type: string #. Description -#: ../mdadm.templates:12001 +#: ../mdadm.templates:4001 msgid "Recipient for email notifications:" msgstr "Destinataire des notifications par courriel :" #. Type: string #. Description -#: ../mdadm.templates:12001 +#: ../mdadm.templates:4001 msgid "" "Please enter the email address of the user who should get the email " "notifications for important MD events." msgstr "" "Veuillez indiquer l'adresse électronique de l'utilisateur qui doit recevoir " "les notifications lors d'importants événements MD." + +#~ msgid "MD arrays needed for the root file system:" +#~ msgstr "Ensembles MD requis par le système de fichiers racine :" + +#~ msgid "" +#~ "Please enter 'all', 'none', or a space-separated list of devices such as " +#~ "'md0 md1' or 'md/1 md/d0' (the leading '/dev/' can be omitted)." +#~ msgstr "" +#~ "Veuillez indiquer « all », « none » ou une liste de périphériques, " +#~ "séparés par des espaces, par exemple, « md0 md1 » ou « md/1 md/d0 » (vous " +#~ "pouvez omettre « /dev/ »)." + +#~ msgid "for internal use - only the long description is needed." +#~ msgstr "" +#~ "Pour une utilisation interne - seule la description longue est nécessaire" + +#~ msgid "" +#~ "If the system's root file system is located on an MD array (RAID), it " +#~ "needs to be started early during the boot sequence. If it is located on a " +#~ "logical volume (LVM), which is on MD, all constituent arrays need to be " +#~ "started." +#~ msgstr "" +#~ "Si le système de fichiers racine se trouve sur un ensemble MD (RAID), il " +#~ "doit être lancé au début de la procédure de démarrage. Si le système de " +#~ "fichiers racine se trouve sur un volume logique (« LVM »), qui se trouve " +#~ "aussi sur un volume MD, tous les composants de l'ensemble doivent être " +#~ "démarrés." + +#~ msgid "" +#~ "If you know exactly which arrays are needed to bring up the root file " +#~ "system, and you want to postpone starting all other arrays to a later " +#~ "point in the boot sequence, enter the arrays to start here. " +#~ "Alternatively, enter 'all' to simply start all available arrays." +#~ msgstr "" +#~ "Si vous savez exactement quels sont les ensembles RAID nécessaires au " +#~ "démarrage du système de fichiers racine et si vous souhaitez différer le " +#~ "démarrage de tous les autres ensembles, veuillez les indiquer ici. Vous " +#~ "pouvez aussi indiquer « all » pour démarrer tous les ensembles existants." + +#~ msgid "" +#~ "If you do not need or want to start any arrays for the root file system, " +#~ "leave the answer blank (or enter 'none'). This may be the case if you are " +#~ "using kernel autostart or do not need any arrays to boot." +#~ msgstr "" +#~ "Si vous n'avez pas besoin ou ne souhaitez pas démarrer d'ensemble RAID " +#~ "pour le système de fichiers racine, veuillez laissez l'entrée vide (ou " +#~ "entrez « none »). Ceci peut être le cas si vous utilisez l'option de " +#~ "démarrage automatique (« autostart ») du noyau ou si vous n'avez besoin " +#~ "d'aucun ensemble pour démarrer." + +#~ msgid "An error occurred: device node does not exist" +#~ msgstr "Erreur : périphérique inconnu" + +#~ msgid "An error occurred: not a block device" +#~ msgstr "Erreur : ce n'est pas un périphérique en mode bloc" + +#~ msgid "An error occurred: not an MD array" +#~ msgstr "Erreur : ce n'est pas un ensemble RAID" + +#~ msgid "An error occurred: array not listed in mdadm.conf file" +#~ msgstr "Erreur : ensemble non mentionné dans le fichier mdadm.conf" + +#~ msgid "Start arrays not listed in mdadm.conf?" +#~ msgstr "" +#~ "Faut-il démarrer les ensembles RAID non mentionnés dans mdadm.conf ?" + +#~ msgid "" +#~ "The specified array (${array}) is not listed in the configuration file " +#~ "(${config}). Therefore, it cannot be started during boot, unless you " +#~ "correct the configuration file and recreate the initial ramdisk." +#~ msgstr "" +#~ "L'ensemble (${array}) que vous avez spécifié n'est pas mentionné dans le " +#~ "fichier de configuration ${config}. Il ne sera donc pas démarré à moins " +#~ "que vous corrigiez le fichier de configuration et que vous génériez de " +#~ "nouveau le disque mémoire initial (« ramdisk »)." + +#~ msgid "" +#~ "This warning is only relevant if you need arrays to be started from the " +#~ "initial ramdisk to be able to boot. If you use kernel autostarting, or do " +#~ "not need any arrays to be started as early as the initial ramdisk is " +#~ "loaded, you can simply continue. Alternatively, choose not to continue " +#~ "and enter 'none' when prompted which arrays to start from the initial " +#~ "ramdisk." +#~ msgstr "" +#~ "Cet avertissement n'a de signification que si des ensembles RAID doivent " +#~ "être lancés à partir du disque mémoire initial afin de pouvoir démarrer " +#~ "le système. Si vous utilisez le démarrage automatique par le noyau, ou si " +#~ "vous n'avez pas besoin de lancer d'ensemble RAID depuis le disque mémoire " +#~ "initial, vous pouvez simplement poursuivre. Vous pouvez aussi choisir de " +#~ "ne pas poursuivre et entrer « none » lorsqu'il vous sera demandé le nom " +#~ "des ensembles RAID à démarrer à partir du disque mémoire initial." diff --git a/debian/po/gl.po b/debian/po/gl.po index b454e818..85e76e3c 100644 --- a/debian/po/gl.po +++ b/debian/po/gl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: mdadm\n" "Report-Msgid-Bugs-To: mdadm@packages.debian.org\n" -"POT-Creation-Date: 2012-05-22 00:50+0100\n" +"POT-Creation-Date: 2016-07-05 14:12+0200\n" "PO-Revision-Date: 2008-02-06 23:45+0000\n" "Last-Translator: Jacobo Tarrio <jtarrio@debian.org>\n" "Language-Team: Galician <proxecto@trasno.net>\n" @@ -15,136 +15,16 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#. Type: string -#. Description -#: ../mdadm.templates:2001 -msgid "MD arrays needed for the root file system:" -msgstr "Arrays MD necesarios para o sistema de ficheiros raÃz" - -#. Type: string -#. Description -#: ../mdadm.templates:2001 -msgid "" -"Please enter 'all', 'none', or a space-separated list of devices such as " -"'md0 md1' or 'md/1 md/d0' (the leading '/dev/' can be omitted)." -msgstr "" -"Introduza \"all\" (todos), \"none\" (ningún) ou unha lista de dispositivos " -"separados por espazos, tales coma \"md0 md1\" ou \"md/1 md/0\" (pódese " -"omitir o \"/dev/\" do principio)." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "for internal use - only the long description is needed." -msgstr "para uso interno - só se precisa da descrición longa." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If the system's root file system is located on an MD array (RAID), it needs " -"to be started early during the boot sequence. If it is located on a logical " -"volume (LVM), which is on MD, all constituent arrays need to be started." -msgstr "" -"Se o sistema de ficheiros raÃz do sistema está ubicado nun array MD (RAID), " -"hai que o iniciar no principio da secuencia de inicio. Se está ubicado nun " -"volume lóxico (LVM) que está nun MD, hai que iniciar os arrays constituÃntes." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If you know exactly which arrays are needed to bring up the root file " -"system, and you want to postpone starting all other arrays to a later point " -"in the boot sequence, enter the arrays to start here. Alternatively, enter " -"'all' to simply start all available arrays." -msgstr "" -"Se sabe exactamente que arrays son necesarios para erguer o sistema de " -"ficheiros raÃz, e se quere pospor o inicio dos demáis arrays ata un punto " -"posterior da secuencia de inicio, introduza aquà os arrays a iniciar. " -"Alternativamente, introduza \"all\" para iniciar tódolos arrays dispoñibles." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If you do not need or want to start any arrays for the root file system, " -"leave the answer blank (or enter 'none'). This may be the case if you are " -"using kernel autostart or do not need any arrays to boot." -msgstr "" -"Se non quere ou precisa de iniciar ningún array para o sistema de ficheiros " -"raÃz, deixe a resposta en branco (ou introduza \"none\"). Este pode ser o " -"caso se está a empregar o autoinicio do núcleo ou non precisa de ningún " -"array para o inicio." - -#. Type: text -#. Description -#: ../mdadm.templates:4001 -msgid "An error occurred: device node does not exist" -msgstr "Houbo un erro: o nodo do dispositivo non existe" - -#. Type: text -#. Description -#: ../mdadm.templates:5001 -msgid "An error occurred: not a block device" -msgstr "Houbo un erro: non é un dispositivo de bloques" - -#. Type: text -#. Description -#: ../mdadm.templates:6001 -msgid "An error occurred: not an MD array" -msgstr "Houbo un erro: non é un array MD" - -#. Type: text -#. Description -#: ../mdadm.templates:7001 -msgid "An error occurred: array not listed in mdadm.conf file" -msgstr "Houbo un erro: o array non figura no ficheiro mdadm.conf" - -#. Type: boolean -#. Description -#: ../mdadm.templates:8001 -msgid "Start arrays not listed in mdadm.conf?" -msgstr "¿Iniciar os arrays que non figuran en mdadm.conf?" - -#. Type: boolean -#. Description -#: ../mdadm.templates:8001 -msgid "" -"The specified array (${array}) is not listed in the configuration file " -"(${config}). Therefore, it cannot be started during boot, unless you correct " -"the configuration file and recreate the initial ramdisk." -msgstr "" -"O array indicado (${array}) non figura no ficheiro de configuración " -"(${config}). Polo tanto, non se pode arrincar no inicio do sistema, a menos " -"que corrixa o ficheiro de configuración e volva crear o disco RAM inicial." - #. Type: boolean #. Description -#: ../mdadm.templates:8001 -msgid "" -"This warning is only relevant if you need arrays to be started from the " -"initial ramdisk to be able to boot. If you use kernel autostarting, or do " -"not need any arrays to be started as early as the initial ramdisk is loaded, " -"you can simply continue. Alternatively, choose not to continue and enter " -"'none' when prompted which arrays to start from the initial ramdisk." -msgstr "" -"Este aviso só é relevante se precisa de iniciar arrays desde o disco RAM " -"inicial para poder iniciar o sistema. Se emprega autoinicio do núcleo ou non " -"precisa de iniciar arrays tan pronto como se cargue o disco RAM inicial, " -"pode continuar. De xeito alternativo, escolla non continuar e introduza " -"\"none\" cando se lle pregunte que arrays quere iniciar do disco RAM inicial." - -#. Type: boolean -#. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "Should mdadm run monthly redundancy checks of the MD arrays?" msgstr "" "¿DeberÃa mdadm facer comprobacións mensuais de redundancia dos arrays MD?" #. Type: boolean #. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "" "If the kernel supports it (versions greater than 2.6.14), mdadm can " "periodically check the redundancy of MD arrays (RAIDs). This may be a " @@ -163,7 +43,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "" "The default, if turned on, is to check on the first Sunday of every month at " "01:06." @@ -173,13 +53,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "Do you want to start the MD monitoring daemon?" msgstr "¿Quere iniciar o servizo de monitorización de MD?" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "" "The MD (RAID) monitor daemon sends email notifications in response to " "important MD events (such as a disk failure)." @@ -189,22 +69,109 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "Enabling this option is recommended." msgstr "Recoméndase activar esta opción." #. Type: string #. Description -#: ../mdadm.templates:12001 +#: ../mdadm.templates:4001 msgid "Recipient for email notifications:" msgstr "Destinatario para os avisos por email:" #. Type: string #. Description -#: ../mdadm.templates:12001 +#: ../mdadm.templates:4001 msgid "" "Please enter the email address of the user who should get the email " "notifications for important MD events." msgstr "" "Introduza o enderezo de email do usuario que debe recibir os avisos por " "email de eventos importantes de MD." + +#~ msgid "MD arrays needed for the root file system:" +#~ msgstr "Arrays MD necesarios para o sistema de ficheiros raÃz" + +#~ msgid "" +#~ "Please enter 'all', 'none', or a space-separated list of devices such as " +#~ "'md0 md1' or 'md/1 md/d0' (the leading '/dev/' can be omitted)." +#~ msgstr "" +#~ "Introduza \"all\" (todos), \"none\" (ningún) ou unha lista de " +#~ "dispositivos separados por espazos, tales coma \"md0 md1\" ou \"md/1 " +#~ "md/0\" (pódese omitir o \"/dev/\" do principio)." + +#~ msgid "for internal use - only the long description is needed." +#~ msgstr "para uso interno - só se precisa da descrición longa." + +#~ msgid "" +#~ "If the system's root file system is located on an MD array (RAID), it " +#~ "needs to be started early during the boot sequence. If it is located on a " +#~ "logical volume (LVM), which is on MD, all constituent arrays need to be " +#~ "started." +#~ msgstr "" +#~ "Se o sistema de ficheiros raÃz do sistema está ubicado nun array MD " +#~ "(RAID), hai que o iniciar no principio da secuencia de inicio. Se está " +#~ "ubicado nun volume lóxico (LVM) que está nun MD, hai que iniciar os " +#~ "arrays constituÃntes." + +#~ msgid "" +#~ "If you know exactly which arrays are needed to bring up the root file " +#~ "system, and you want to postpone starting all other arrays to a later " +#~ "point in the boot sequence, enter the arrays to start here. " +#~ "Alternatively, enter 'all' to simply start all available arrays." +#~ msgstr "" +#~ "Se sabe exactamente que arrays son necesarios para erguer o sistema de " +#~ "ficheiros raÃz, e se quere pospor o inicio dos demáis arrays ata un punto " +#~ "posterior da secuencia de inicio, introduza aquà os arrays a iniciar. " +#~ "Alternativamente, introduza \"all\" para iniciar tódolos arrays " +#~ "dispoñibles." + +#~ msgid "" +#~ "If you do not need or want to start any arrays for the root file system, " +#~ "leave the answer blank (or enter 'none'). This may be the case if you are " +#~ "using kernel autostart or do not need any arrays to boot." +#~ msgstr "" +#~ "Se non quere ou precisa de iniciar ningún array para o sistema de " +#~ "ficheiros raÃz, deixe a resposta en branco (ou introduza \"none\"). Este " +#~ "pode ser o caso se está a empregar o autoinicio do núcleo ou non precisa " +#~ "de ningún array para o inicio." + +#~ msgid "An error occurred: device node does not exist" +#~ msgstr "Houbo un erro: o nodo do dispositivo non existe" + +#~ msgid "An error occurred: not a block device" +#~ msgstr "Houbo un erro: non é un dispositivo de bloques" + +#~ msgid "An error occurred: not an MD array" +#~ msgstr "Houbo un erro: non é un array MD" + +#~ msgid "An error occurred: array not listed in mdadm.conf file" +#~ msgstr "Houbo un erro: o array non figura no ficheiro mdadm.conf" + +#~ msgid "Start arrays not listed in mdadm.conf?" +#~ msgstr "¿Iniciar os arrays que non figuran en mdadm.conf?" + +#~ msgid "" +#~ "The specified array (${array}) is not listed in the configuration file " +#~ "(${config}). Therefore, it cannot be started during boot, unless you " +#~ "correct the configuration file and recreate the initial ramdisk." +#~ msgstr "" +#~ "O array indicado (${array}) non figura no ficheiro de configuración " +#~ "(${config}). Polo tanto, non se pode arrincar no inicio do sistema, a " +#~ "menos que corrixa o ficheiro de configuración e volva crear o disco RAM " +#~ "inicial." + +#~ msgid "" +#~ "This warning is only relevant if you need arrays to be started from the " +#~ "initial ramdisk to be able to boot. If you use kernel autostarting, or do " +#~ "not need any arrays to be started as early as the initial ramdisk is " +#~ "loaded, you can simply continue. Alternatively, choose not to continue " +#~ "and enter 'none' when prompted which arrays to start from the initial " +#~ "ramdisk." +#~ msgstr "" +#~ "Este aviso só é relevante se precisa de iniciar arrays desde o disco RAM " +#~ "inicial para poder iniciar o sistema. Se emprega autoinicio do núcleo ou " +#~ "non precisa de iniciar arrays tan pronto como se cargue o disco RAM " +#~ "inicial, pode continuar. De xeito alternativo, escolla non continuar e " +#~ "introduza \"none\" cando se lle pregunte que arrays quere iniciar do " +#~ "disco RAM inicial." diff --git a/debian/po/it.po b/debian/po/it.po index c2d5285e..62d6cf0f 100644 --- a/debian/po/it.po +++ b/debian/po/it.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: mdadm italian debconf\n" "Report-Msgid-Bugs-To: mdadm@packages.debian.org\n" -"POT-Creation-Date: 2012-05-22 00:50+0100\n" +"POT-Creation-Date: 2016-07-05 14:12+0200\n" "PO-Revision-Date: 2008-11-19 11:02+0100\n" "Last-Translator: Luca Monducci <luca.mo@tiscali.it>\n" "Language-Team: Italian <debian-l10n-italian@lists.debian.org>\n" @@ -16,138 +16,15 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#. Type: string -#. Description -#: ../mdadm.templates:2001 -msgid "MD arrays needed for the root file system:" -msgstr "Array MD necessari per il file system di root:" - -#. Type: string -#. Description -#: ../mdadm.templates:2001 -msgid "" -"Please enter 'all', 'none', or a space-separated list of devices such as " -"'md0 md1' or 'md/1 md/d0' (the leading '/dev/' can be omitted)." -msgstr "" -"Inserire \"all\", \"none\" oppure un elenco dei device separati da uno " -"spazio, per esempio \"md0 md1\" o \"md/1 md/d0\" (il \"/dev/\" iniziale può " -"essere omesso)." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "for internal use - only the long description is needed." -msgstr "uso interno - è necessaria solo la descrizione lunga." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If the system's root file system is located on an MD array (RAID), it needs " -"to be started early during the boot sequence. If it is located on a logical " -"volume (LVM), which is on MD, all constituent arrays need to be started." -msgstr "" -"Se il file system di root è su un array MD (RAID), è necessario attivare " -"tale array all'inizio della sequenza d'avvio. Se è su un volume logico " -"(LVM), il quale è su un MD, è necessario attivare tutti gli array che " -"costituiscono il volume." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If you know exactly which arrays are needed to bring up the root file " -"system, and you want to postpone starting all other arrays to a later point " -"in the boot sequence, enter the arrays to start here. Alternatively, enter " -"'all' to simply start all available arrays." -msgstr "" -"Se si conoscono esattamente quali sono gli array da attivare per il file " -"system di root e si vuole rimandare l'attivazione di tutti gli altri array a " -"una fase successiva della sequenza d'avvio, inserire adesso gli array da " -"attivare. In alternativa, inserire \"all\" per attivare tutti gli array " -"disponibili." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If you do not need or want to start any arrays for the root file system, " -"leave the answer blank (or enter 'none'). This may be the case if you are " -"using kernel autostart or do not need any arrays to boot." -msgstr "" -"Se non si ha bisogno o non si vuole attivare nessun array per il file system " -"di root, lasciare la risposta in bianco (oppure inserire \"none\"). Questo " -"potrebbe essere il caso se si utilizza l'attivazione automatica da kernel " -"oppure se non si ha bisogno di alcun array per l'avvio." - -#. Type: text -#. Description -#: ../mdadm.templates:4001 -msgid "An error occurred: device node does not exist" -msgstr "Errore: il nodo del device non esiste" - -#. Type: text -#. Description -#: ../mdadm.templates:5001 -msgid "An error occurred: not a block device" -msgstr "Errore: non è un device a blocchi" - -#. Type: text -#. Description -#: ../mdadm.templates:6001 -msgid "An error occurred: not an MD array" -msgstr "Errore: non è un array MD" - -#. Type: text -#. Description -#: ../mdadm.templates:7001 -msgid "An error occurred: array not listed in mdadm.conf file" -msgstr "Errore: array non elencato nel file mdadm.conf" - -#. Type: boolean -#. Description -#: ../mdadm.templates:8001 -msgid "Start arrays not listed in mdadm.conf?" -msgstr "Avviare gli array non elencati in mdadm.conf?" - -#. Type: boolean -#. Description -#: ../mdadm.templates:8001 -msgid "" -"The specified array (${array}) is not listed in the configuration file " -"(${config}). Therefore, it cannot be started during boot, unless you correct " -"the configuration file and recreate the initial ramdisk." -msgstr "" -"L'array specificato (${array}) non è presente nel file di configurazione " -"(${config}): quindi non può essere attivato durante l'avvio senza correggere " -"il file di configurazione e ricreare il ramdisk iniziale." - #. Type: boolean #. Description -#: ../mdadm.templates:8001 -msgid "" -"This warning is only relevant if you need arrays to be started from the " -"initial ramdisk to be able to boot. If you use kernel autostarting, or do " -"not need any arrays to be started as early as the initial ramdisk is loaded, " -"you can simply continue. Alternatively, choose not to continue and enter " -"'none' when prompted which arrays to start from the initial ramdisk." -msgstr "" -"Questo avviso è pertinente solo se è necessario attivare gli array dal " -"ramdisk iniziale per permettere l'avvio. Con l'avvio automatico da kernel o " -"se non è necessario attivare gli array così presto come al caricamento del " -"ramdisk iniziale, si può proseguire. In alternativa, scegliere di non " -"continuare e inserire \"none\" quando viene chiesto quali array attivare dal " -"ramdisk iniziale." - -#. Type: boolean -#. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "Should mdadm run monthly redundancy checks of the MD arrays?" msgstr "Far eseguire a mdadm i controlli mensili di ridondanza sugli array MD?" #. Type: boolean #. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "" "If the kernel supports it (versions greater than 2.6.14), mdadm can " "periodically check the redundancy of MD arrays (RAIDs). This may be a " @@ -166,7 +43,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "" "The default, if turned on, is to check on the first Sunday of every month at " "01:06." @@ -176,13 +53,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "Do you want to start the MD monitoring daemon?" msgstr "Avviare il demone di monitoraggio MD?" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "" "The MD (RAID) monitor daemon sends email notifications in response to " "important MD events (such as a disk failure)." @@ -192,22 +69,109 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "Enabling this option is recommended." msgstr "Si raccomanda l'attivazione di questa funzione." #. Type: string #. Description -#: ../mdadm.templates:12001 +#: ../mdadm.templates:4001 msgid "Recipient for email notifications:" msgstr "Destinatario delle email di notifica:" #. Type: string #. Description -#: ../mdadm.templates:12001 +#: ../mdadm.templates:4001 msgid "" "Please enter the email address of the user who should get the email " "notifications for important MD events." msgstr "" "Inserire l'indirizzo email dell'utente che deve ricevere le notifiche di " "eventi importanti legati al MD." + +#~ msgid "MD arrays needed for the root file system:" +#~ msgstr "Array MD necessari per il file system di root:" + +#~ msgid "" +#~ "Please enter 'all', 'none', or a space-separated list of devices such as " +#~ "'md0 md1' or 'md/1 md/d0' (the leading '/dev/' can be omitted)." +#~ msgstr "" +#~ "Inserire \"all\", \"none\" oppure un elenco dei device separati da uno " +#~ "spazio, per esempio \"md0 md1\" o \"md/1 md/d0\" (il \"/dev/\" iniziale " +#~ "può essere omesso)." + +#~ msgid "for internal use - only the long description is needed." +#~ msgstr "uso interno - è necessaria solo la descrizione lunga." + +#~ msgid "" +#~ "If the system's root file system is located on an MD array (RAID), it " +#~ "needs to be started early during the boot sequence. If it is located on a " +#~ "logical volume (LVM), which is on MD, all constituent arrays need to be " +#~ "started." +#~ msgstr "" +#~ "Se il file system di root è su un array MD (RAID), è necessario attivare " +#~ "tale array all'inizio della sequenza d'avvio. Se è su un volume logico " +#~ "(LVM), il quale è su un MD, è necessario attivare tutti gli array che " +#~ "costituiscono il volume." + +#~ msgid "" +#~ "If you know exactly which arrays are needed to bring up the root file " +#~ "system, and you want to postpone starting all other arrays to a later " +#~ "point in the boot sequence, enter the arrays to start here. " +#~ "Alternatively, enter 'all' to simply start all available arrays." +#~ msgstr "" +#~ "Se si conoscono esattamente quali sono gli array da attivare per il file " +#~ "system di root e si vuole rimandare l'attivazione di tutti gli altri " +#~ "array a una fase successiva della sequenza d'avvio, inserire adesso gli " +#~ "array da attivare. In alternativa, inserire \"all\" per attivare tutti " +#~ "gli array disponibili." + +#~ msgid "" +#~ "If you do not need or want to start any arrays for the root file system, " +#~ "leave the answer blank (or enter 'none'). This may be the case if you are " +#~ "using kernel autostart or do not need any arrays to boot." +#~ msgstr "" +#~ "Se non si ha bisogno o non si vuole attivare nessun array per il file " +#~ "system di root, lasciare la risposta in bianco (oppure inserire \"none" +#~ "\"). Questo potrebbe essere il caso se si utilizza l'attivazione " +#~ "automatica da kernel oppure se non si ha bisogno di alcun array per " +#~ "l'avvio." + +#~ msgid "An error occurred: device node does not exist" +#~ msgstr "Errore: il nodo del device non esiste" + +#~ msgid "An error occurred: not a block device" +#~ msgstr "Errore: non è un device a blocchi" + +#~ msgid "An error occurred: not an MD array" +#~ msgstr "Errore: non è un array MD" + +#~ msgid "An error occurred: array not listed in mdadm.conf file" +#~ msgstr "Errore: array non elencato nel file mdadm.conf" + +#~ msgid "Start arrays not listed in mdadm.conf?" +#~ msgstr "Avviare gli array non elencati in mdadm.conf?" + +#~ msgid "" +#~ "The specified array (${array}) is not listed in the configuration file " +#~ "(${config}). Therefore, it cannot be started during boot, unless you " +#~ "correct the configuration file and recreate the initial ramdisk." +#~ msgstr "" +#~ "L'array specificato (${array}) non è presente nel file di configurazione " +#~ "(${config}): quindi non può essere attivato durante l'avvio senza " +#~ "correggere il file di configurazione e ricreare il ramdisk iniziale." + +#~ msgid "" +#~ "This warning is only relevant if you need arrays to be started from the " +#~ "initial ramdisk to be able to boot. If you use kernel autostarting, or do " +#~ "not need any arrays to be started as early as the initial ramdisk is " +#~ "loaded, you can simply continue. Alternatively, choose not to continue " +#~ "and enter 'none' when prompted which arrays to start from the initial " +#~ "ramdisk." +#~ msgstr "" +#~ "Questo avviso è pertinente solo se è necessario attivare gli array dal " +#~ "ramdisk iniziale per permettere l'avvio. Con l'avvio automatico da kernel " +#~ "o se non è necessario attivare gli array così presto come al caricamento " +#~ "del ramdisk iniziale, si può proseguire. In alternativa, scegliere di non " +#~ "continuare e inserire \"none\" quando viene chiesto quali array attivare " +#~ "dal ramdisk iniziale." diff --git a/debian/po/ja.po b/debian/po/ja.po index eeefe8ed..7f9c4fb6 100644 --- a/debian/po/ja.po +++ b/debian/po/ja.po @@ -16,7 +16,7 @@ msgid "" msgstr "" "Project-Id-Version: mdadm 2.6.3+200709292116+4450e59-4\n" "Report-Msgid-Bugs-To: mdadm@packages.debian.org\n" -"POT-Creation-Date: 2012-05-22 00:50+0100\n" +"POT-Creation-Date: 2016-07-05 14:12+0200\n" "PO-Revision-Date: 2008-02-07 05:52+0900\n" "Last-Translator: Hideki Yamane (Debian-JP) <henrich@debian.or.jp>\n" "Language-Team: Japanese <debian-japanese@lists.debian.org>\n" @@ -25,135 +25,15 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#. Type: string -#. Description -#: ../mdadm.templates:2001 -msgid "MD arrays needed for the root file system:" -msgstr "ルートファイルシステムã«å¿…è¦ãª MD アレイ:" - -#. Type: string -#. Description -#: ../mdadm.templates:2001 -msgid "" -"Please enter 'all', 'none', or a space-separated list of devices such as " -"'md0 md1' or 'md/1 md/d0' (the leading '/dev/' can be omitted)." -msgstr "" -"'all' ã¾ãŸã¯ 'none'ã€ã‚ã‚‹ã„ã¯ãƒ‡ãƒã‚¤ã‚¹ã®ãƒªã‚¹ãƒˆã‚’ 'md0 md1' ã‚„ 'md/1 md/d0' ã®" -"よã†ã«ã‚¹ãƒšãƒ¼ã‚¹ã§åŒºåˆ‡ã£ã¦å…¥åŠ›ã—ã¦ãã ã•ã„ (å‰ã«ä»˜ã '/dev/' ã¯çœç•¥å¯èƒ½ã§ã™)。" - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "for internal use - only the long description is needed." -msgstr "内部ã§ã®åˆ©ç”¨ã«ã¤ã„㦠- ã§ã‚‚ã€é•·ã„説明ãŒå¿…è¦ã§ã™ã€‚" - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If the system's root file system is located on an MD array (RAID), it needs " -"to be started early during the boot sequence. If it is located on a logical " -"volume (LVM), which is on MD, all constituent arrays need to be started." -msgstr "" -"ã‚ãªãŸã®ã‚·ã‚¹ãƒ†ãƒ ã®ãƒ«ãƒ¼ãƒˆãƒ•ã‚¡ã‚¤ãƒ«ã‚·ã‚¹ãƒ†ãƒ ㌠MD アレイ (RAID) 上ã«é…ç½®ã•ã‚Œã¦ã„" -"ã‚‹ãªã‚‰ã°ã€ãƒ–ートシーケンスã®åˆæœŸæ®µéšŽã§ MD アレイを開始ã™ã‚‹å¿…è¦ãŒã‚ã‚Šã¾ã™ã€‚" -"ルートファイルシステム㌠MD ã®ã‚ˆã†ãªè«–ç†ãƒœãƒªãƒ¥ãƒ¼ãƒ (LVM) 上ã«ã‚ã‚‹å ´åˆã¯ã€æ§‹æˆ" -"ã—ã¦ã„るアレイ全ã¦ã®é–‹å§‹ãŒå¿…è¦ã§ã™ã€‚" - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If you know exactly which arrays are needed to bring up the root file " -"system, and you want to postpone starting all other arrays to a later point " -"in the boot sequence, enter the arrays to start here. Alternatively, enter " -"'all' to simply start all available arrays." -msgstr "" -"ã©ã®ã‚¢ãƒ¬ã‚¤ãŒãƒ«ãƒ¼ãƒˆãƒ•ã‚¡ã‚¤ãƒ«ã‚·ã‚¹ãƒ†ãƒ ã®ç«‹ã¡ä¸Šã’ã«å¿…è¦ã‹ã‚’æ£ç¢ºã«çŸ¥ã£ã¦ãŠã‚Šã€ãƒ–ー" -"トシーケンスã®å¾Œã®æ™‚点ã¾ã§æ„図ã—ã¦ã„ã‚‹ã‚‚ã®ä»¥å¤–å…¨ã¦ã®ã‚¢ãƒ¬ã‚¤èµ·å‹•ã‚’é…らã›ãŸã„å ´" -"åˆã€ã“ã“ã§æœ€åˆã«èµ·å‹•ã™ã‚‹ã‚¢ãƒ¬ã‚¤ã‚’入力ã—ã¦ãã ã•ã„。ãã†ã§ãªã„å ´åˆã€'all' ã¨å…¥" -"力ã—ã¦å˜ã«å…¨ã¦ã®åˆ©ç”¨å¯èƒ½ãªã‚¢ãƒ¬ã‚¤ã‚’最åˆã«ç«‹ã¡ä¸Šã’ã¦ãã ã•ã„。" - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If you do not need or want to start any arrays for the root file system, " -"leave the answer blank (or enter 'none'). This may be the case if you are " -"using kernel autostart or do not need any arrays to boot." -msgstr "" -"ルートファイルシステムã®ãŸã‚ã«ã€ã©ã®ã‚¢ãƒ¬ã‚¤ã‚‚å¿…è¦ãªã„ã€ã‚ã‚‹ã„ã¯ã©ã®ã‚¢ãƒ¬ã‚¤ã‚‚èµ·" -"å‹•ã—ãŸãã¯ç„¡ã„ã¨ã„ã†å ´åˆã¯ã€ç©ºç™½ã®ã¾ã¾ã« (ã‚ã‚‹ã„㯠'none' ã¨å…¥åŠ›) ã—ã¦ãã ã•" -"ã„。ã“ã‚Œã¯ã€ã‚«ãƒ¼ãƒãƒ«ã§è‡ªå‹•çš„ã«èµ·å‹•ã•ã‚Œã‚‹å ´åˆã‚„起動時ã«ã¯ã‚¢ãƒ¬ã‚¤ã¯ä¸è¦ã§ã‚ã‚‹ã¨" -"ã„ã†å ´åˆã§ã™ã€‚" - -#. Type: text -#. Description -#: ../mdadm.templates:4001 -msgid "An error occurred: device node does not exist" -msgstr "エラーãŒç™ºç”Ÿã—ã¾ã—ãŸ: デãƒã‚¤ã‚¹ãƒŽãƒ¼ãƒ‰ãŒå˜åœ¨ã—ã¾ã›ã‚“" - -#. Type: text -#. Description -#: ../mdadm.templates:5001 -msgid "An error occurred: not a block device" -msgstr "エラーãŒç™ºç”Ÿã—ã¾ã—ãŸ: ブãƒãƒƒã‚¯ãƒ‡ãƒã‚¤ã‚¹ã§ã¯ã‚ã‚Šã¾ã›ã‚“" - -#. Type: text -#. Description -#: ../mdadm.templates:6001 -msgid "An error occurred: not an MD array" -msgstr "エラーãŒç™ºç”Ÿã—ã¾ã—ãŸ: MD アレイã§ã¯ã‚ã‚Šã¾ã›ã‚“" - -#. Type: text -#. Description -#: ../mdadm.templates:7001 -msgid "An error occurred: array not listed in mdadm.conf file" -msgstr "エラーãŒç™ºç”Ÿã—ã¾ã—ãŸ: mdadm.conf ファイルã«è¨˜è¿°ã•ã‚Œã¦ã„ãªã„アレイã§ã™" - -#. Type: boolean -#. Description -#: ../mdadm.templates:8001 -msgid "Start arrays not listed in mdadm.conf?" -msgstr "mdadm.conf ã«è¨˜è¿°ã•ã‚Œã¦ã„ãªã„アレイを起動ã—ã¾ã™ã‹?" - -#. Type: boolean -#. Description -#: ../mdadm.templates:8001 -msgid "" -"The specified array (${array}) is not listed in the configuration file " -"(${config}). Therefore, it cannot be started during boot, unless you correct " -"the configuration file and recreate the initial ramdisk." -msgstr "" -"指定ã—ãŸã‚¢ãƒ¬ã‚¤ (${array}) ã¯è¨å®šãƒ•ã‚¡ã‚¤ãƒ« (${config}) ã«è¨˜è¿°ã•ã‚Œã¦ã„ã¾ã›ã‚“。ã" -"ã®ãŸã‚ã€è¨å®šãƒ•ã‚¡ã‚¤ãƒ«ã‚’ä¿®æ£ã—㦠initrd ã‚’å†ç”Ÿæˆã—ãªã‘ã‚Œã°ãƒ–ート時ã«èµ·å‹•ã§ãã¾" -"ã›ã‚“。" - #. Type: boolean #. Description -#: ../mdadm.templates:8001 -msgid "" -"This warning is only relevant if you need arrays to be started from the " -"initial ramdisk to be able to boot. If you use kernel autostarting, or do " -"not need any arrays to be started as early as the initial ramdisk is loaded, " -"you can simply continue. Alternatively, choose not to continue and enter " -"'none' when prompted which arrays to start from the initial ramdisk." -msgstr "" -"ã“ã®è¦å‘Šã¯ã€ãƒ–ートã§ãるよã†ã«ã‚¢ãƒ¬ã‚¤ã‚’ initrd ã‹ã‚‰èµ·å‹•ã™ã‚‹å¿…è¦ãŒã‚ã‚‹å ´åˆã ã‘" -"関係ã—ã¾ã™ã€‚カーãƒãƒ«ã§è‡ªå‹•çš„ã«ã‚¢ãƒ¬ã‚¤ã‚’èµ·å‹•ã™ã‚‹ã‚ˆã†ã«ã—ã¦ã„ã‚‹å ´åˆã€ã‚ã‚‹ã„㯠" -"initrd ãŒãƒãƒ¼ãƒ‰ã•ã‚Œã‚‹ç¨‹æ—©ã„段階ã§ã©ã®ã‚¢ãƒ¬ã‚¤ã‚‚èµ·å‹•ã—ãŸãã¯ãªã„å ´åˆã¯ãã®ã¾ã¾ç¶š" -"è¡Œã§ãã¾ã™ã€‚ä»–ã®é¸æŠžè‚¢ã¨ã—ã¦ã¯ã€èµ·å‹•ã®ç¶šè¡Œã‚’ä¸æ¢ã—ã€ã©ã®ã‚¢ãƒ¬ã‚¤ã‚’ initrd ã‹ã‚‰" -"èµ·å‹•ã™ã‚‹ã‹ã‚’å°‹ãられãŸéš›ã« 'none' ã¨å…¥åŠ›ã—ã¾ã™ã€‚" - -#. Type: boolean -#. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "Should mdadm run monthly redundancy checks of the MD arrays?" msgstr "mdadm ã¯ã€æ¯Žæœˆ MD アレイã®å†—長性ãƒã‚§ãƒƒã‚¯ã‚’è¡Œã„ã¾ã™ã‹?" #. Type: boolean #. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "" "If the kernel supports it (versions greater than 2.6.14), mdadm can " "periodically check the redundancy of MD arrays (RAIDs). This may be a " @@ -171,7 +51,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "" "The default, if turned on, is to check on the first Sunday of every month at " "01:06." @@ -180,13 +60,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "Do you want to start the MD monitoring daemon?" msgstr "MD 監視デーモンを起動ã—ã¾ã™ã‹?" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "" "The MD (RAID) monitor daemon sends email notifications in response to " "important MD events (such as a disk failure)." @@ -196,19 +76,19 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "Enabling this option is recommended." msgstr "ã“ã®æ©Ÿèƒ½ã‚’有効ã«ã™ã‚‹ã®ã‚’ãŠå‹§ã‚ã—ã¾ã™ã€‚" #. Type: string #. Description -#: ../mdadm.templates:12001 +#: ../mdadm.templates:4001 msgid "Recipient for email notifications:" msgstr "メール通知ã®å®›å…ˆ:" #. Type: string #. Description -#: ../mdadm.templates:12001 +#: ../mdadm.templates:4001 msgid "" "Please enter the email address of the user who should get the email " "notifications for important MD events." @@ -216,6 +96,91 @@ msgstr "" "MD 関連ã®é‡å¤§ãªã‚¤ãƒ™ãƒ³ãƒˆãŒç™ºç”Ÿã—ãŸéš›ã€ãƒ¡ãƒ¼ãƒ«ã§ã®é€šçŸ¥ã‚’å—ã‘å–ã‚‹å¿…è¦ãŒã‚るユーザ" "ã®ãƒ¡ãƒ¼ãƒ«ã‚¢ãƒ‰ãƒ¬ã‚¹ã‚’入力ã—ã¦ãã ã•ã„。" +#~ msgid "MD arrays needed for the root file system:" +#~ msgstr "ルートファイルシステムã«å¿…è¦ãª MD アレイ:" + +#~ msgid "" +#~ "Please enter 'all', 'none', or a space-separated list of devices such as " +#~ "'md0 md1' or 'md/1 md/d0' (the leading '/dev/' can be omitted)." +#~ msgstr "" +#~ "'all' ã¾ãŸã¯ 'none'ã€ã‚ã‚‹ã„ã¯ãƒ‡ãƒã‚¤ã‚¹ã®ãƒªã‚¹ãƒˆã‚’ 'md0 md1' ã‚„ 'md/1 md/d0' " +#~ "ã®ã‚ˆã†ã«ã‚¹ãƒšãƒ¼ã‚¹ã§åŒºåˆ‡ã£ã¦å…¥åŠ›ã—ã¦ãã ã•ã„ (å‰ã«ä»˜ã '/dev/' ã¯çœç•¥å¯èƒ½ã§" +#~ "ã™)。" + +#~ msgid "for internal use - only the long description is needed." +#~ msgstr "内部ã§ã®åˆ©ç”¨ã«ã¤ã„㦠- ã§ã‚‚ã€é•·ã„説明ãŒå¿…è¦ã§ã™ã€‚" + +#~ msgid "" +#~ "If the system's root file system is located on an MD array (RAID), it " +#~ "needs to be started early during the boot sequence. If it is located on a " +#~ "logical volume (LVM), which is on MD, all constituent arrays need to be " +#~ "started." +#~ msgstr "" +#~ "ã‚ãªãŸã®ã‚·ã‚¹ãƒ†ãƒ ã®ãƒ«ãƒ¼ãƒˆãƒ•ã‚¡ã‚¤ãƒ«ã‚·ã‚¹ãƒ†ãƒ ㌠MD アレイ (RAID) 上ã«é…ç½®ã•ã‚Œã¦" +#~ "ã„ã‚‹ãªã‚‰ã°ã€ãƒ–ートシーケンスã®åˆæœŸæ®µéšŽã§ MD アレイを開始ã™ã‚‹å¿…è¦ãŒã‚ã‚Šã¾" +#~ "ã™ã€‚ルートファイルシステム㌠MD ã®ã‚ˆã†ãªè«–ç†ãƒœãƒªãƒ¥ãƒ¼ãƒ (LVM) 上ã«ã‚ã‚‹å ´åˆ" +#~ "ã¯ã€æ§‹æˆã—ã¦ã„るアレイ全ã¦ã®é–‹å§‹ãŒå¿…è¦ã§ã™ã€‚" + +#~ msgid "" +#~ "If you know exactly which arrays are needed to bring up the root file " +#~ "system, and you want to postpone starting all other arrays to a later " +#~ "point in the boot sequence, enter the arrays to start here. " +#~ "Alternatively, enter 'all' to simply start all available arrays." +#~ msgstr "" +#~ "ã©ã®ã‚¢ãƒ¬ã‚¤ãŒãƒ«ãƒ¼ãƒˆãƒ•ã‚¡ã‚¤ãƒ«ã‚·ã‚¹ãƒ†ãƒ ã®ç«‹ã¡ä¸Šã’ã«å¿…è¦ã‹ã‚’æ£ç¢ºã«çŸ¥ã£ã¦ãŠã‚Šã€" +#~ "ブートシーケンスã®å¾Œã®æ™‚点ã¾ã§æ„図ã—ã¦ã„ã‚‹ã‚‚ã®ä»¥å¤–å…¨ã¦ã®ã‚¢ãƒ¬ã‚¤èµ·å‹•ã‚’é…らã›" +#~ "ãŸã„å ´åˆã€ã“ã“ã§æœ€åˆã«èµ·å‹•ã™ã‚‹ã‚¢ãƒ¬ã‚¤ã‚’入力ã—ã¦ãã ã•ã„。ãã†ã§ãªã„å ´" +#~ "åˆã€'all' ã¨å…¥åŠ›ã—ã¦å˜ã«å…¨ã¦ã®åˆ©ç”¨å¯èƒ½ãªã‚¢ãƒ¬ã‚¤ã‚’最åˆã«ç«‹ã¡ä¸Šã’ã¦ãã ã•ã„。" + +#~ msgid "" +#~ "If you do not need or want to start any arrays for the root file system, " +#~ "leave the answer blank (or enter 'none'). This may be the case if you are " +#~ "using kernel autostart or do not need any arrays to boot." +#~ msgstr "" +#~ "ルートファイルシステムã®ãŸã‚ã«ã€ã©ã®ã‚¢ãƒ¬ã‚¤ã‚‚å¿…è¦ãªã„ã€ã‚ã‚‹ã„ã¯ã©ã®ã‚¢ãƒ¬ã‚¤ã‚‚" +#~ "èµ·å‹•ã—ãŸãã¯ç„¡ã„ã¨ã„ã†å ´åˆã¯ã€ç©ºç™½ã®ã¾ã¾ã« (ã‚ã‚‹ã„㯠'none' ã¨å…¥åŠ›) ã—ã¦ã" +#~ "ã ã•ã„。ã“ã‚Œã¯ã€ã‚«ãƒ¼ãƒãƒ«ã§è‡ªå‹•çš„ã«èµ·å‹•ã•ã‚Œã‚‹å ´åˆã‚„起動時ã«ã¯ã‚¢ãƒ¬ã‚¤ã¯ä¸è¦ã§" +#~ "ã‚ã‚‹ã¨ã„ã†å ´åˆã§ã™ã€‚" + +#~ msgid "An error occurred: device node does not exist" +#~ msgstr "エラーãŒç™ºç”Ÿã—ã¾ã—ãŸ: デãƒã‚¤ã‚¹ãƒŽãƒ¼ãƒ‰ãŒå˜åœ¨ã—ã¾ã›ã‚“" + +#~ msgid "An error occurred: not a block device" +#~ msgstr "エラーãŒç™ºç”Ÿã—ã¾ã—ãŸ: ブãƒãƒƒã‚¯ãƒ‡ãƒã‚¤ã‚¹ã§ã¯ã‚ã‚Šã¾ã›ã‚“" + +#~ msgid "An error occurred: not an MD array" +#~ msgstr "エラーãŒç™ºç”Ÿã—ã¾ã—ãŸ: MD アレイã§ã¯ã‚ã‚Šã¾ã›ã‚“" + +#~ msgid "An error occurred: array not listed in mdadm.conf file" +#~ msgstr "" +#~ "エラーãŒç™ºç”Ÿã—ã¾ã—ãŸ: mdadm.conf ファイルã«è¨˜è¿°ã•ã‚Œã¦ã„ãªã„アレイã§ã™" + +#~ msgid "Start arrays not listed in mdadm.conf?" +#~ msgstr "mdadm.conf ã«è¨˜è¿°ã•ã‚Œã¦ã„ãªã„アレイを起動ã—ã¾ã™ã‹?" + +#~ msgid "" +#~ "The specified array (${array}) is not listed in the configuration file " +#~ "(${config}). Therefore, it cannot be started during boot, unless you " +#~ "correct the configuration file and recreate the initial ramdisk." +#~ msgstr "" +#~ "指定ã—ãŸã‚¢ãƒ¬ã‚¤ (${array}) ã¯è¨å®šãƒ•ã‚¡ã‚¤ãƒ« (${config}) ã«è¨˜è¿°ã•ã‚Œã¦ã„ã¾ã›" +#~ "ん。ãã®ãŸã‚ã€è¨å®šãƒ•ã‚¡ã‚¤ãƒ«ã‚’ä¿®æ£ã—㦠initrd ã‚’å†ç”Ÿæˆã—ãªã‘ã‚Œã°ãƒ–ート時ã«èµ·" +#~ "å‹•ã§ãã¾ã›ã‚“。" + +#~ msgid "" +#~ "This warning is only relevant if you need arrays to be started from the " +#~ "initial ramdisk to be able to boot. If you use kernel autostarting, or do " +#~ "not need any arrays to be started as early as the initial ramdisk is " +#~ "loaded, you can simply continue. Alternatively, choose not to continue " +#~ "and enter 'none' when prompted which arrays to start from the initial " +#~ "ramdisk." +#~ msgstr "" +#~ "ã“ã®è¦å‘Šã¯ã€ãƒ–ートã§ãるよã†ã«ã‚¢ãƒ¬ã‚¤ã‚’ initrd ã‹ã‚‰èµ·å‹•ã™ã‚‹å¿…è¦ãŒã‚ã‚‹å ´åˆã " +#~ "ã‘関係ã—ã¾ã™ã€‚カーãƒãƒ«ã§è‡ªå‹•çš„ã«ã‚¢ãƒ¬ã‚¤ã‚’èµ·å‹•ã™ã‚‹ã‚ˆã†ã«ã—ã¦ã„ã‚‹å ´åˆã€ã‚ã‚‹ã„" +#~ "㯠initrd ãŒãƒãƒ¼ãƒ‰ã•ã‚Œã‚‹ç¨‹æ—©ã„段階ã§ã©ã®ã‚¢ãƒ¬ã‚¤ã‚‚èµ·å‹•ã—ãŸãã¯ãªã„å ´åˆã¯ãã®" +#~ "ã¾ã¾ç¶šè¡Œã§ãã¾ã™ã€‚ä»–ã®é¸æŠžè‚¢ã¨ã—ã¦ã¯ã€èµ·å‹•ã®ç¶šè¡Œã‚’ä¸æ¢ã—ã€ã©ã®ã‚¢ãƒ¬ã‚¤ã‚’ " +#~ "initrd ã‹ã‚‰èµ·å‹•ã™ã‚‹ã‹ã‚’å°‹ãられãŸéš›ã« 'none' ã¨å…¥åŠ›ã—ã¾ã™ã€‚" + #~ msgid "" #~ "WARNING! If you are using hard disks which have RAID superblocks from " #~ "earlier installations in different RAID arrays, you MUST zero each " diff --git a/debian/po/nl.po b/debian/po/nl.po index d3e5f3da..34f473e6 100644 --- a/debian/po/nl.po +++ b/debian/po/nl.po @@ -16,7 +16,7 @@ msgid "" msgstr "" "Project-Id-Version: mdadm_2.6.3+200709292116+4450e59-4\n" "Report-Msgid-Bugs-To: mdadm@packages.debian.org\n" -"POT-Creation-Date: 2012-05-22 00:50+0100\n" +"POT-Creation-Date: 2016-07-05 14:12+0200\n" "PO-Revision-Date: 2008-02-19 14:04+0100\n" "Last-Translator: Frans Pop <elendil@planet.nl>\n" "Language-Team: Dutch <debian-l10n-dutch@lists.debian.org>\n" @@ -26,138 +26,15 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.11.4\n" -#. Type: string -#. Description -#: ../mdadm.templates:2001 -msgid "MD arrays needed for the root file system:" -msgstr "Voor het basisbestandssysteem benodigde RAID-reeksen:" - -#. Type: string -#. Description -#: ../mdadm.templates:2001 -msgid "" -"Please enter 'all', 'none', or a space-separated list of devices such as " -"'md0 md1' or 'md/1 md/d0' (the leading '/dev/' can be omitted)." -msgstr "" -"Geef in 'all' (alle), 'none' (geen) of één of meerdere apparaatbestanden " -"(gescheiden door spaties), bijvoorbeeld \"md0 md1\" of \"md/1 md/d0\" (de " -"prefix '/dev/' kan dus worden weggelaten)." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "for internal use - only the long description is needed." -msgstr "Voor intern gebruik - alleen de lange omschrijving wordt gebruikt." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If the system's root file system is located on an MD array (RAID), it needs " -"to be started early during the boot sequence. If it is located on a logical " -"volume (LVM), which is on MD, all constituent arrays need to be started." -msgstr "" -"Als het basisbestandssysteem van uw systeem zich op een RAID-volume bevindt, " -"dient dit vroeg in de opstartcyclus geactiveerd te worden. Als het zich op " -"een logisch volume (LVM) op RAID bevindt, dienen alle betrokken reeksen " -"geactiveerd te worden." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If you know exactly which arrays are needed to bring up the root file " -"system, and you want to postpone starting all other arrays to a later point " -"in the boot sequence, enter the arrays to start here. Alternatively, enter " -"'all' to simply start all available arrays." -msgstr "" -"Als u precies weet welke reeksen benodigd zijn voor het basisbestandssysteem " -"en u het activeren van alle overige reeksen wilt uitstellen tot later in de " -"opstartprocedure, geef dan hier de te activeren reeksen in. Anders kunt u " -"'all' ingeven om alle beschikbare reeksen te activeren." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If you do not need or want to start any arrays for the root file system, " -"leave the answer blank (or enter 'none'). This may be the case if you are " -"using kernel autostart or do not need any arrays to boot." -msgstr "" -"Als u geen reeksen hoeft of wenst te activeren voor het " -"basisbestandssysteem, laat dan het antwoord leeg (of geef 'none' in). Dit " -"kan het geval zijn als u \"kernel autostart\" gebruikt of geen reeksen nodig " -"heeft om uw systeem op te starten." - -#. Type: text -#. Description -#: ../mdadm.templates:4001 -msgid "An error occurred: device node does not exist" -msgstr "Er is een fout opgetreden: apparaatbestand bestaat niet" - -#. Type: text -#. Description -#: ../mdadm.templates:5001 -msgid "An error occurred: not a block device" -msgstr "Er is een fout opgetreden: geen blokapparaat" - -#. Type: text -#. Description -#: ../mdadm.templates:6001 -msgid "An error occurred: not an MD array" -msgstr "Er is een fout opgetreden: geen RAID reeks" - -#. Type: text -#. Description -#: ../mdadm.templates:7001 -msgid "An error occurred: array not listed in mdadm.conf file" -msgstr "Er is een fout opgetreden: reeks komt niet voor in bestand mdadm.conf" - -#. Type: boolean -#. Description -#: ../mdadm.templates:8001 -msgid "Start arrays not listed in mdadm.conf?" -msgstr "Reeksen activeren die niet in mdadm.conf voorkomen?" - -#. Type: boolean -#. Description -#: ../mdadm.templates:8001 -msgid "" -"The specified array (${array}) is not listed in the configuration file " -"(${config}). Therefore, it cannot be started during boot, unless you correct " -"the configuration file and recreate the initial ramdisk." -msgstr "" -"De reeks die u heeft opgegeven (${array}) komt niet voor in het " -"configuratiebestand (${config}). Tenzij u het configuratiebestand corrigeert " -"en de initiële ramdisk opnieuw aanmaakt, kan deze reeks tijdens het " -"opstarten van het systeem niet worden geactiveerd." - #. Type: boolean #. Description -#: ../mdadm.templates:8001 -msgid "" -"This warning is only relevant if you need arrays to be started from the " -"initial ramdisk to be able to boot. If you use kernel autostarting, or do " -"not need any arrays to be started as early as the initial ramdisk is loaded, " -"you can simply continue. Alternatively, choose not to continue and enter " -"'none' when prompted which arrays to start from the initial ramdisk." -msgstr "" -"Deze waarschuwing is alleen relevant als de reeksen geactiveerd moeten " -"worden vanuit een initiële ramdisk om het systeem te kunnen opstarten. Als u " -"\"kernel autostart\" gebruikt of er geen reeksen zijn die vanuit de initiële " -"ramdisk gestart moeten worden, kunt u gewoon doorgaan. Kies anders nu om " -"niet door te gaan en geef 'none' in bij de vraag welke reeksen vanuit de " -"initiële ramdisk gestart moeten worden." - -#. Type: boolean -#. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "Should mdadm run monthly redundancy checks of the MD arrays?" msgstr "Maandelijkse redundantiecontrole van RAID-reeksen uitvoeren?" #. Type: boolean #. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "" "If the kernel supports it (versions greater than 2.6.14), mdadm can " "periodically check the redundancy of MD arrays (RAIDs). This may be a " @@ -175,7 +52,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "" "The default, if turned on, is to check on the first Sunday of every month at " "01:06." @@ -185,13 +62,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "Do you want to start the MD monitoring daemon?" msgstr "Wilt u de achtergronddienst voor de RAID-monitor starten?" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "" "The MD (RAID) monitor daemon sends email notifications in response to " "important MD events (such as a disk failure)." @@ -202,22 +79,110 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "Enabling this option is recommended." msgstr "Gebruik van deze optie wordt aanbevolen." #. Type: string #. Description -#: ../mdadm.templates:12001 +#: ../mdadm.templates:4001 msgid "Recipient for email notifications:" msgstr "Adres voor e-mailberichten:" #. Type: string #. Description -#: ../mdadm.templates:12001 +#: ../mdadm.templates:4001 msgid "" "Please enter the email address of the user who should get the email " "notifications for important MD events." msgstr "" "Wat is het e-mailadres van de gebruiker die de e-mailberichten voor " "belangrijke gebeurtenissen met betrekking tot RAID dient te ontvangen." + +#~ msgid "MD arrays needed for the root file system:" +#~ msgstr "Voor het basisbestandssysteem benodigde RAID-reeksen:" + +#~ msgid "" +#~ "Please enter 'all', 'none', or a space-separated list of devices such as " +#~ "'md0 md1' or 'md/1 md/d0' (the leading '/dev/' can be omitted)." +#~ msgstr "" +#~ "Geef in 'all' (alle), 'none' (geen) of één of meerdere apparaatbestanden " +#~ "(gescheiden door spaties), bijvoorbeeld \"md0 md1\" of \"md/1 md/d0\" (de " +#~ "prefix '/dev/' kan dus worden weggelaten)." + +#~ msgid "for internal use - only the long description is needed." +#~ msgstr "Voor intern gebruik - alleen de lange omschrijving wordt gebruikt." + +#~ msgid "" +#~ "If the system's root file system is located on an MD array (RAID), it " +#~ "needs to be started early during the boot sequence. If it is located on a " +#~ "logical volume (LVM), which is on MD, all constituent arrays need to be " +#~ "started." +#~ msgstr "" +#~ "Als het basisbestandssysteem van uw systeem zich op een RAID-volume " +#~ "bevindt, dient dit vroeg in de opstartcyclus geactiveerd te worden. Als " +#~ "het zich op een logisch volume (LVM) op RAID bevindt, dienen alle " +#~ "betrokken reeksen geactiveerd te worden." + +#~ msgid "" +#~ "If you know exactly which arrays are needed to bring up the root file " +#~ "system, and you want to postpone starting all other arrays to a later " +#~ "point in the boot sequence, enter the arrays to start here. " +#~ "Alternatively, enter 'all' to simply start all available arrays." +#~ msgstr "" +#~ "Als u precies weet welke reeksen benodigd zijn voor het " +#~ "basisbestandssysteem en u het activeren van alle overige reeksen wilt " +#~ "uitstellen tot later in de opstartprocedure, geef dan hier de te " +#~ "activeren reeksen in. Anders kunt u 'all' ingeven om alle beschikbare " +#~ "reeksen te activeren." + +#~ msgid "" +#~ "If you do not need or want to start any arrays for the root file system, " +#~ "leave the answer blank (or enter 'none'). This may be the case if you are " +#~ "using kernel autostart or do not need any arrays to boot." +#~ msgstr "" +#~ "Als u geen reeksen hoeft of wenst te activeren voor het " +#~ "basisbestandssysteem, laat dan het antwoord leeg (of geef 'none' in). Dit " +#~ "kan het geval zijn als u \"kernel autostart\" gebruikt of geen reeksen " +#~ "nodig heeft om uw systeem op te starten." + +#~ msgid "An error occurred: device node does not exist" +#~ msgstr "Er is een fout opgetreden: apparaatbestand bestaat niet" + +#~ msgid "An error occurred: not a block device" +#~ msgstr "Er is een fout opgetreden: geen blokapparaat" + +#~ msgid "An error occurred: not an MD array" +#~ msgstr "Er is een fout opgetreden: geen RAID reeks" + +#~ msgid "An error occurred: array not listed in mdadm.conf file" +#~ msgstr "" +#~ "Er is een fout opgetreden: reeks komt niet voor in bestand mdadm.conf" + +#~ msgid "Start arrays not listed in mdadm.conf?" +#~ msgstr "Reeksen activeren die niet in mdadm.conf voorkomen?" + +#~ msgid "" +#~ "The specified array (${array}) is not listed in the configuration file " +#~ "(${config}). Therefore, it cannot be started during boot, unless you " +#~ "correct the configuration file and recreate the initial ramdisk." +#~ msgstr "" +#~ "De reeks die u heeft opgegeven (${array}) komt niet voor in het " +#~ "configuratiebestand (${config}). Tenzij u het configuratiebestand " +#~ "corrigeert en de initiële ramdisk opnieuw aanmaakt, kan deze reeks " +#~ "tijdens het opstarten van het systeem niet worden geactiveerd." + +#~ msgid "" +#~ "This warning is only relevant if you need arrays to be started from the " +#~ "initial ramdisk to be able to boot. If you use kernel autostarting, or do " +#~ "not need any arrays to be started as early as the initial ramdisk is " +#~ "loaded, you can simply continue. Alternatively, choose not to continue " +#~ "and enter 'none' when prompted which arrays to start from the initial " +#~ "ramdisk." +#~ msgstr "" +#~ "Deze waarschuwing is alleen relevant als de reeksen geactiveerd moeten " +#~ "worden vanuit een initiële ramdisk om het systeem te kunnen opstarten. " +#~ "Als u \"kernel autostart\" gebruikt of er geen reeksen zijn die vanuit de " +#~ "initiële ramdisk gestart moeten worden, kunt u gewoon doorgaan. Kies " +#~ "anders nu om niet door te gaan en geef 'none' in bij de vraag welke " +#~ "reeksen vanuit de initiële ramdisk gestart moeten worden." diff --git a/debian/po/pt.po b/debian/po/pt.po index e450997a..2b549e98 100644 --- a/debian/po/pt.po +++ b/debian/po/pt.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: mdadm 2.6.3+200709292116+4450e59-4\n" "Report-Msgid-Bugs-To: mdadm@packages.debian.org\n" -"POT-Creation-Date: 2012-05-22 00:50+0100\n" +"POT-Creation-Date: 2016-07-05 14:12+0200\n" "PO-Revision-Date: 2008-02-21 00:15+0000\n" "Last-Translator: Pedro Ribeiro <p.m42.ribeiro@gmail.com>\n" "Language-Team: Portuguese <traduz@debianpt.org>\n" @@ -16,138 +16,16 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -#. Type: string -#. Description -#: ../mdadm.templates:2001 -msgid "MD arrays needed for the root file system:" -msgstr "Grupos MD necessários para o sistema de ficheiros raiz:" - -#. Type: string -#. Description -#: ../mdadm.templates:2001 -msgid "" -"Please enter 'all', 'none', or a space-separated list of devices such as " -"'md0 md1' or 'md/1 md/d0' (the leading '/dev/' can be omitted)." -msgstr "" -"Por favor, introduza 'all', 'none', ou uma lista de dispositivos separados " -"por espaços, tais como 'md0 md1' ou 'md/1 md/d0' (o '/dev/' inicial pode ser " -"omitido)." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "for internal use - only the long description is needed." -msgstr "para uso interno - apenas a descrição longa é necessária" - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If the system's root file system is located on an MD array (RAID), it needs " -"to be started early during the boot sequence. If it is located on a logical " -"volume (LVM), which is on MD, all constituent arrays need to be started." -msgstr "" -"Se o sistema de ficheiros de raiz do sistema estiver num grupo MD (RAID), " -"necessita de ser iniciado mais cedo na sequência de arranque. Se o seu " -"sistema de ficheiros de raiz estiver num volume lógico (LVM) que está no MD, " -"todos os grupos constituintes necessitam de ser iniciados." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If you know exactly which arrays are needed to bring up the root file " -"system, and you want to postpone starting all other arrays to a later point " -"in the boot sequence, enter the arrays to start here. Alternatively, enter " -"'all' to simply start all available arrays." -msgstr "" -"Se souber exactamente que grupos são necessários para iniciar o sistema de " -"ficheiros raiz, e quiser adiar o inicio de todos os outros grupos para mais " -"tarde no processo de arranque, introduza os grupos aqui. Alternativamente, " -"introduza 'all' para iniciar todos os grupos disponÃveis." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If you do not need or want to start any arrays for the root file system, " -"leave the answer blank (or enter 'none'). This may be the case if you are " -"using kernel autostart or do not need any arrays to boot." -msgstr "" -"Se não necessita ou deseja iniciar grupos para o sistema de ficheiros raiz, " -"deixe a resposta em branco (ou introduza 'none'). Isto vale no caso de usar " -"o auto-arranque do kernel ou não necessitar de grupos para o arranque do " -"sistema." - -#. Type: text -#. Description -#: ../mdadm.templates:4001 -msgid "An error occurred: device node does not exist" -msgstr "Ocorreu um erro: o nó do dispositivo não existe" - -#. Type: text -#. Description -#: ../mdadm.templates:5001 -msgid "An error occurred: not a block device" -msgstr "Ocorreu um erro: não é um dispositivo de bloco" - -#. Type: text -#. Description -#: ../mdadm.templates:6001 -msgid "An error occurred: not an MD array" -msgstr "Ocorreu um erro: não é um grupo MD" - -#. Type: text -#. Description -#: ../mdadm.templates:7001 -msgid "An error occurred: array not listed in mdadm.conf file" -msgstr "Ocorreu um erro: o grupo não está listado no ficheiro mdadm.conf" - -#. Type: boolean -#. Description -#: ../mdadm.templates:8001 -msgid "Start arrays not listed in mdadm.conf?" -msgstr "Iniciar grupos não listados no mdadm.conf?" - -#. Type: boolean -#. Description -#: ../mdadm.templates:8001 -msgid "" -"The specified array (${array}) is not listed in the configuration file " -"(${config}). Therefore, it cannot be started during boot, unless you correct " -"the configuration file and recreate the initial ramdisk." -msgstr "" -"O grupo especificado (${array}) não está listado no ficheiro de configuração " -"(${config}). Portanto, não pode ser iniciado durante o processo de arranque, " -"a não ser que corrija o ficheiro de configuração e recrie o ramdisk inicial." - #. Type: boolean #. Description -#: ../mdadm.templates:8001 -msgid "" -"This warning is only relevant if you need arrays to be started from the " -"initial ramdisk to be able to boot. If you use kernel autostarting, or do " -"not need any arrays to be started as early as the initial ramdisk is loaded, " -"you can simply continue. Alternatively, choose not to continue and enter " -"'none' when prompted which arrays to start from the initial ramdisk." -msgstr "" -"Este aviso só é relevante se houver necessidade de iniciar grupos a partir " -"do ramdisk durante o arranque do sistema. Se usar o auto-arranque do kernel, " -"ou não necessitar de iniciar os grupos tão cedo no processo de arranque do " -"sistema, pode simplesmente continuar. Em alternativa, escolha não continuar " -"e introduza 'none' quando perguntado sobre quais grupos iniciar a partir do " -"ramdisk inicial." - -#. Type: boolean -#. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "Should mdadm run monthly redundancy checks of the MD arrays?" msgstr "" "O mdadm deve correr verificações de redundância nos grupos MD mensalmente?" #. Type: boolean #. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "" "If the kernel supports it (versions greater than 2.6.14), mdadm can " "periodically check the redundancy of MD arrays (RAIDs). This may be a " @@ -166,7 +44,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "" "The default, if turned on, is to check on the first Sunday of every month at " "01:06." @@ -176,13 +54,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "Do you want to start the MD monitoring daemon?" msgstr "Quer iniciar o deamon de monitorização do MD?" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "" "The MD (RAID) monitor daemon sends email notifications in response to " "important MD events (such as a disk failure)." @@ -193,22 +71,109 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "Enabling this option is recommended." msgstr "É recomendado activar esta opção." #. Type: string #. Description -#: ../mdadm.templates:12001 +#: ../mdadm.templates:4001 msgid "Recipient for email notifications:" msgstr "Destinatário de email para notificações:" #. Type: string #. Description -#: ../mdadm.templates:12001 +#: ../mdadm.templates:4001 msgid "" "Please enter the email address of the user who should get the email " "notifications for important MD events." msgstr "" "Por favor, introduza o endereço de email do utilizador que deve receber as " "notificações de eventos MD importantes." + +#~ msgid "MD arrays needed for the root file system:" +#~ msgstr "Grupos MD necessários para o sistema de ficheiros raiz:" + +#~ msgid "" +#~ "Please enter 'all', 'none', or a space-separated list of devices such as " +#~ "'md0 md1' or 'md/1 md/d0' (the leading '/dev/' can be omitted)." +#~ msgstr "" +#~ "Por favor, introduza 'all', 'none', ou uma lista de dispositivos " +#~ "separados por espaços, tais como 'md0 md1' ou 'md/1 md/d0' (o '/dev/' " +#~ "inicial pode ser omitido)." + +#~ msgid "for internal use - only the long description is needed." +#~ msgstr "para uso interno - apenas a descrição longa é necessária" + +#~ msgid "" +#~ "If the system's root file system is located on an MD array (RAID), it " +#~ "needs to be started early during the boot sequence. If it is located on a " +#~ "logical volume (LVM), which is on MD, all constituent arrays need to be " +#~ "started." +#~ msgstr "" +#~ "Se o sistema de ficheiros de raiz do sistema estiver num grupo MD (RAID), " +#~ "necessita de ser iniciado mais cedo na sequência de arranque. Se o seu " +#~ "sistema de ficheiros de raiz estiver num volume lógico (LVM) que está no " +#~ "MD, todos os grupos constituintes necessitam de ser iniciados." + +#~ msgid "" +#~ "If you know exactly which arrays are needed to bring up the root file " +#~ "system, and you want to postpone starting all other arrays to a later " +#~ "point in the boot sequence, enter the arrays to start here. " +#~ "Alternatively, enter 'all' to simply start all available arrays." +#~ msgstr "" +#~ "Se souber exactamente que grupos são necessários para iniciar o sistema " +#~ "de ficheiros raiz, e quiser adiar o inicio de todos os outros grupos para " +#~ "mais tarde no processo de arranque, introduza os grupos aqui. " +#~ "Alternativamente, introduza 'all' para iniciar todos os grupos " +#~ "disponÃveis." + +#~ msgid "" +#~ "If you do not need or want to start any arrays for the root file system, " +#~ "leave the answer blank (or enter 'none'). This may be the case if you are " +#~ "using kernel autostart or do not need any arrays to boot." +#~ msgstr "" +#~ "Se não necessita ou deseja iniciar grupos para o sistema de ficheiros " +#~ "raiz, deixe a resposta em branco (ou introduza 'none'). Isto vale no caso " +#~ "de usar o auto-arranque do kernel ou não necessitar de grupos para o " +#~ "arranque do sistema." + +#~ msgid "An error occurred: device node does not exist" +#~ msgstr "Ocorreu um erro: o nó do dispositivo não existe" + +#~ msgid "An error occurred: not a block device" +#~ msgstr "Ocorreu um erro: não é um dispositivo de bloco" + +#~ msgid "An error occurred: not an MD array" +#~ msgstr "Ocorreu um erro: não é um grupo MD" + +#~ msgid "An error occurred: array not listed in mdadm.conf file" +#~ msgstr "Ocorreu um erro: o grupo não está listado no ficheiro mdadm.conf" + +#~ msgid "Start arrays not listed in mdadm.conf?" +#~ msgstr "Iniciar grupos não listados no mdadm.conf?" + +#~ msgid "" +#~ "The specified array (${array}) is not listed in the configuration file " +#~ "(${config}). Therefore, it cannot be started during boot, unless you " +#~ "correct the configuration file and recreate the initial ramdisk." +#~ msgstr "" +#~ "O grupo especificado (${array}) não está listado no ficheiro de " +#~ "configuração (${config}). Portanto, não pode ser iniciado durante o " +#~ "processo de arranque, a não ser que corrija o ficheiro de configuração e " +#~ "recrie o ramdisk inicial." + +#~ msgid "" +#~ "This warning is only relevant if you need arrays to be started from the " +#~ "initial ramdisk to be able to boot. If you use kernel autostarting, or do " +#~ "not need any arrays to be started as early as the initial ramdisk is " +#~ "loaded, you can simply continue. Alternatively, choose not to continue " +#~ "and enter 'none' when prompted which arrays to start from the initial " +#~ "ramdisk." +#~ msgstr "" +#~ "Este aviso só é relevante se houver necessidade de iniciar grupos a " +#~ "partir do ramdisk durante o arranque do sistema. Se usar o auto-arranque " +#~ "do kernel, ou não necessitar de iniciar os grupos tão cedo no processo de " +#~ "arranque do sistema, pode simplesmente continuar. Em alternativa, escolha " +#~ "não continuar e introduza 'none' quando perguntado sobre quais grupos " +#~ "iniciar a partir do ramdisk inicial." diff --git a/debian/po/pt_BR.po b/debian/po/pt_BR.po index 118538b8..3f6df2fc 100644 --- a/debian/po/pt_BR.po +++ b/debian/po/pt_BR.po @@ -15,7 +15,7 @@ msgid "" msgstr "" "Project-Id-Version: mdadm\n" "Report-Msgid-Bugs-To: mdadm@packages.debian.org\n" -"POT-Creation-Date: 2012-05-22 00:50+0100\n" +"POT-Creation-Date: 2016-07-05 14:12+0200\n" "PO-Revision-Date: 2006-09-24 19:22-0300\n" "Last-Translator: Felipe Augusto van de Wiel (faw) <faw@cathedrallabs.org>\n" "Language-Team: l10n portuguese <debian-l10n-portuguese@lists.debian.org>\n" @@ -25,166 +25,9 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "pt_BR utf-8\n" -#. Type: string -#. Description -#: ../mdadm.templates:2001 -#, fuzzy -#| msgid "MD arrays needed for the root filesystem:" -msgid "MD arrays needed for the root file system:" -msgstr "Dispositivos MD necessários para o sistema de arquivos raiz:" - -#. Type: string -#. Description -#: ../mdadm.templates:2001 -#, fuzzy -#| msgid "" -#| "Please enter a space-separated list of devices, 'all', or 'none'. You may " -#| "omit the leading '/dev/' and just enter e.g. \"md0 md1\", or \"md/1 md/" -#| "d0\"." -msgid "" -"Please enter 'all', 'none', or a space-separated list of devices such as " -"'md0 md1' or 'md/1 md/d0' (the leading '/dev/' can be omitted)." -msgstr "" -"Por favor, informe uma lista separada por espaços dos dispositivos, 'all' ou " -"'none'. Você pode omitir a parte inicial '/dev/' e apenas informar, por " -"exemplo, \"md0 md1\", ou \"md/1 md/d0\"." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "for internal use - only the long description is needed." -msgstr "para uso interno - apenas a descrição longa é necessária." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -#, fuzzy -#| msgid "" -#| "If your system has its root filesystem on an MD array (RAID), it needs to " -#| "be started early during the boot sequence. If your root filesystem is on " -#| "a logical volume (LVM), which is on MD, all constituent arrays need to be " -#| "started." -msgid "" -"If the system's root file system is located on an MD array (RAID), it needs " -"to be started early during the boot sequence. If it is located on a logical " -"volume (LVM), which is on MD, all constituent arrays need to be started." -msgstr "" -"Se o seu sistema tem o sistema de arquivos raiz em um dispositivo MD (RAID), " -"este precisa ser iniciado mais cedo durante a seqüência de inicialização. Se " -"o sistema de arquivos raiz está em um volume lógico (LVM), que está em um " -"MD, todos os dispositivos que o constituem precisam ser iniciados." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -#, fuzzy -#| msgid "" -#| "If you know exactly which arrays are needed to bring up the root " -#| "filesystem, and you want to postpone starting all other arrays to a later " -#| "point in the boot sequence, enter the arrays to start here. " -#| "Alternatively, enter 'all' to simply start all available arrays." -msgid "" -"If you know exactly which arrays are needed to bring up the root file " -"system, and you want to postpone starting all other arrays to a later point " -"in the boot sequence, enter the arrays to start here. Alternatively, enter " -"'all' to simply start all available arrays." -msgstr "" -"Se você sabe exatamente quais dispositivos são necessários para ativar o " -"sistema de arquivos raiz, e você deseja adiar o inÃcio de todos os outros " -"dispositivos para um ponto posterior na seqüência de inicialização, informe " -"os dispositivos a serem iniciados aqui. Como alternativa, informe 'all' para " -"simplesmente iniciar todos os dispositivos disponÃveis." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -#, fuzzy -#| msgid "" -#| "If you do not need or want to start any arrays for the root filesystem, " -#| "leave the answer blank (or enter 'none'). This may be the case if you are " -#| "using kernel autostart or do not need any arrays to boot." -msgid "" -"If you do not need or want to start any arrays for the root file system, " -"leave the answer blank (or enter 'none'). This may be the case if you are " -"using kernel autostart or do not need any arrays to boot." -msgstr "" -"Se você não precisa ou não quer iniciar quaisquer dispositivos para o " -"sistema de arquivos raiz, deixe a resposta em branco (ou informe 'none'). " -"Este pode ser o caso se você está usando \"kernel autostart\" ou não precisa " -"de quaisquer dispositivos para a inicialização." - -#. Type: text -#. Description -#: ../mdadm.templates:4001 -msgid "An error occurred: device node does not exist" -msgstr "Um erro ocorreu: o dispositivo (\"device node\") não existe" - -#. Type: text -#. Description -#: ../mdadm.templates:5001 -msgid "An error occurred: not a block device" -msgstr "Um erro ocorreu: não é um dispositivo de blocos" - -#. Type: text -#. Description -#: ../mdadm.templates:6001 -msgid "An error occurred: not an MD array" -msgstr "Um erro ocorreu: não é um dispositivo MD" - -#. Type: text -#. Description -#: ../mdadm.templates:7001 -msgid "An error occurred: array not listed in mdadm.conf file" -msgstr "Um erro ocorreu: dispositivo não listado no arquivo mdadm.conf" - -#. Type: boolean -#. Description -#: ../mdadm.templates:8001 -#, fuzzy -#| msgid "Proceed with starting arrays not listed in mdadm.conf?" -msgid "Start arrays not listed in mdadm.conf?" -msgstr "Continuar com o inÃcio de dispositivos não listados no mdadm.conf?" - -#. Type: boolean -#. Description -#: ../mdadm.templates:8001 -#, fuzzy -#| msgid "" -#| "The array you have specified (${array}) is not listed in the " -#| "configuration file ${config}. Therefore it cannot be started during boot, " -#| "unless you correct the configuration file and recreate the initial " -#| "ramdisk." -msgid "" -"The specified array (${array}) is not listed in the configuration file " -"(${config}). Therefore, it cannot be started during boot, unless you correct " -"the configuration file and recreate the initial ramdisk." -msgstr "" -"O dispositivo que você especificou (${array}) não está listado no arquivo de " -"configuração ${config}. Portanto não pode ser iniciado durante a " -"inicialização, a menos que você corrija o arquivo de configuração e recrie o " -"\"ramdisk\" inicial." - #. Type: boolean #. Description -#: ../mdadm.templates:8001 -msgid "" -"This warning is only relevant if you need arrays to be started from the " -"initial ramdisk to be able to boot. If you use kernel autostarting, or do " -"not need any arrays to be started as early as the initial ramdisk is loaded, " -"you can simply continue. Alternatively, choose not to continue and enter " -"'none' when prompted which arrays to start from the initial ramdisk." -msgstr "" -"Este aviso só é relevante se você precisa de dispositivos que sejam " -"iniciados a partir do \"ramdisk\" inicial para que seja possÃvel inicializar " -"o computador. Se você usa \"kernel autostarting\", ou não precisa de " -"quaisquer dispositivos sendo iniciados tão logo o \"ramdisk\" inicial seja " -"carregado, você pode simplesmente continuar. Alternativamente, escolha não " -"continuar e informe 'none' quando perguntado quais dispositivos iniciar a " -"partir do \"ramdisk\" inicial." - -#. Type: boolean -#. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "Should mdadm run monthly redundancy checks of the MD arrays?" msgstr "" "O mdadm deve, mensalmente, executar checagens de redundância dos " @@ -192,7 +35,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 #, fuzzy #| msgid "" #| "If your kernel supports it (>> 2.6.14), mdadm can periodically check the " @@ -219,7 +62,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 #, fuzzy #| msgid "" #| "The default, if turned on, is to run the checks on the first Sunday of " @@ -233,13 +76,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "Do you want to start the MD monitoring daemon?" msgstr "Você deseja iniciar o \"daemon\" de monitoramento MD?" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 #, fuzzy #| msgid "" #| "The MD (RAID) monitor daemon sends email notifications in response to " @@ -255,19 +98,19 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "Enabling this option is recommended." msgstr "" #. Type: string #. Description -#: ../mdadm.templates:12001 +#: ../mdadm.templates:4001 msgid "Recipient for email notifications:" msgstr "Destinatário para os e-mails de notificações:" #. Type: string #. Description -#: ../mdadm.templates:12001 +#: ../mdadm.templates:4001 #, fuzzy #| msgid "" #| "Please enter the email address of the user who should get the email " @@ -279,6 +122,127 @@ msgstr "" "Por favor, informe o endereço de e-mail do usuário que deverá receber os e-" "mails de notificações para estes eventos MD importantes." +#, fuzzy +#~| msgid "MD arrays needed for the root filesystem:" +#~ msgid "MD arrays needed for the root file system:" +#~ msgstr "Dispositivos MD necessários para o sistema de arquivos raiz:" + +#, fuzzy +#~| msgid "" +#~| "Please enter a space-separated list of devices, 'all', or 'none'. You " +#~| "may omit the leading '/dev/' and just enter e.g. \"md0 md1\", or \"md/1 " +#~| "md/d0\"." +#~ msgid "" +#~ "Please enter 'all', 'none', or a space-separated list of devices such as " +#~ "'md0 md1' or 'md/1 md/d0' (the leading '/dev/' can be omitted)." +#~ msgstr "" +#~ "Por favor, informe uma lista separada por espaços dos dispositivos, 'all' " +#~ "ou 'none'. Você pode omitir a parte inicial '/dev/' e apenas informar, " +#~ "por exemplo, \"md0 md1\", ou \"md/1 md/d0\"." + +#~ msgid "for internal use - only the long description is needed." +#~ msgstr "para uso interno - apenas a descrição longa é necessária." + +#, fuzzy +#~| msgid "" +#~| "If your system has its root filesystem on an MD array (RAID), it needs " +#~| "to be started early during the boot sequence. If your root filesystem is " +#~| "on a logical volume (LVM), which is on MD, all constituent arrays need " +#~| "to be started." +#~ msgid "" +#~ "If the system's root file system is located on an MD array (RAID), it " +#~ "needs to be started early during the boot sequence. If it is located on a " +#~ "logical volume (LVM), which is on MD, all constituent arrays need to be " +#~ "started." +#~ msgstr "" +#~ "Se o seu sistema tem o sistema de arquivos raiz em um dispositivo MD " +#~ "(RAID), este precisa ser iniciado mais cedo durante a seqüência de " +#~ "inicialização. Se o sistema de arquivos raiz está em um volume lógico " +#~ "(LVM), que está em um MD, todos os dispositivos que o constituem precisam " +#~ "ser iniciados." + +#, fuzzy +#~| msgid "" +#~| "If you know exactly which arrays are needed to bring up the root " +#~| "filesystem, and you want to postpone starting all other arrays to a " +#~| "later point in the boot sequence, enter the arrays to start here. " +#~| "Alternatively, enter 'all' to simply start all available arrays." +#~ msgid "" +#~ "If you know exactly which arrays are needed to bring up the root file " +#~ "system, and you want to postpone starting all other arrays to a later " +#~ "point in the boot sequence, enter the arrays to start here. " +#~ "Alternatively, enter 'all' to simply start all available arrays." +#~ msgstr "" +#~ "Se você sabe exatamente quais dispositivos são necessários para ativar o " +#~ "sistema de arquivos raiz, e você deseja adiar o inÃcio de todos os outros " +#~ "dispositivos para um ponto posterior na seqüência de inicialização, " +#~ "informe os dispositivos a serem iniciados aqui. Como alternativa, informe " +#~ "'all' para simplesmente iniciar todos os dispositivos disponÃveis." + +#, fuzzy +#~| msgid "" +#~| "If you do not need or want to start any arrays for the root filesystem, " +#~| "leave the answer blank (or enter 'none'). This may be the case if you " +#~| "are using kernel autostart or do not need any arrays to boot." +#~ msgid "" +#~ "If you do not need or want to start any arrays for the root file system, " +#~ "leave the answer blank (or enter 'none'). This may be the case if you are " +#~ "using kernel autostart or do not need any arrays to boot." +#~ msgstr "" +#~ "Se você não precisa ou não quer iniciar quaisquer dispositivos para o " +#~ "sistema de arquivos raiz, deixe a resposta em branco (ou informe 'none'). " +#~ "Este pode ser o caso se você está usando \"kernel autostart\" ou não " +#~ "precisa de quaisquer dispositivos para a inicialização." + +#~ msgid "An error occurred: device node does not exist" +#~ msgstr "Um erro ocorreu: o dispositivo (\"device node\") não existe" + +#~ msgid "An error occurred: not a block device" +#~ msgstr "Um erro ocorreu: não é um dispositivo de blocos" + +#~ msgid "An error occurred: not an MD array" +#~ msgstr "Um erro ocorreu: não é um dispositivo MD" + +#~ msgid "An error occurred: array not listed in mdadm.conf file" +#~ msgstr "Um erro ocorreu: dispositivo não listado no arquivo mdadm.conf" + +#, fuzzy +#~| msgid "Proceed with starting arrays not listed in mdadm.conf?" +#~ msgid "Start arrays not listed in mdadm.conf?" +#~ msgstr "Continuar com o inÃcio de dispositivos não listados no mdadm.conf?" + +#, fuzzy +#~| msgid "" +#~| "The array you have specified (${array}) is not listed in the " +#~| "configuration file ${config}. Therefore it cannot be started during " +#~| "boot, unless you correct the configuration file and recreate the initial " +#~| "ramdisk." +#~ msgid "" +#~ "The specified array (${array}) is not listed in the configuration file " +#~ "(${config}). Therefore, it cannot be started during boot, unless you " +#~ "correct the configuration file and recreate the initial ramdisk." +#~ msgstr "" +#~ "O dispositivo que você especificou (${array}) não está listado no arquivo " +#~ "de configuração ${config}. Portanto não pode ser iniciado durante a " +#~ "inicialização, a menos que você corrija o arquivo de configuração e " +#~ "recrie o \"ramdisk\" inicial." + +#~ msgid "" +#~ "This warning is only relevant if you need arrays to be started from the " +#~ "initial ramdisk to be able to boot. If you use kernel autostarting, or do " +#~ "not need any arrays to be started as early as the initial ramdisk is " +#~ "loaded, you can simply continue. Alternatively, choose not to continue " +#~ "and enter 'none' when prompted which arrays to start from the initial " +#~ "ramdisk." +#~ msgstr "" +#~ "Este aviso só é relevante se você precisa de dispositivos que sejam " +#~ "iniciados a partir do \"ramdisk\" inicial para que seja possÃvel " +#~ "inicializar o computador. Se você usa \"kernel autostarting\", ou não " +#~ "precisa de quaisquer dispositivos sendo iniciados tão logo o \"ramdisk\" " +#~ "inicial seja carregado, você pode simplesmente continuar. " +#~ "Alternativamente, escolha não continuar e informe 'none' quando " +#~ "perguntado quais dispositivos iniciar a partir do \"ramdisk\" inicial." + #~ msgid "Initialise the superblock if you reuse hard disks" #~ msgstr "Inicialize o superbloco caso você reutilize discos rÃgidos" diff --git a/debian/po/ru.po b/debian/po/ru.po index a4aff77d..8bf8c5c2 100644 --- a/debian/po/ru.po +++ b/debian/po/ru.po @@ -15,7 +15,7 @@ msgid "" msgstr "" "Project-Id-Version: 2.6.3+200709292116+4450e59-4\n" "Report-Msgid-Bugs-To: mdadm@packages.debian.org\n" -"POT-Creation-Date: 2012-05-22 00:50+0100\n" +"POT-Creation-Date: 2016-07-05 14:12+0200\n" "PO-Revision-Date: 2008-02-07 21:02+0300\n" "Last-Translator: Yuri Kozlov <kozlov.y@gmail.com>\n" "Language-Team: Russian <debian-l10n-russian@lists.debian.org>\n" @@ -27,139 +27,16 @@ msgstr "" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" -#. Type: string -#. Description -#: ../mdadm.templates:2001 -msgid "MD arrays needed for the root file system:" -msgstr "MD-маÑÑивы, необходимые Ð´Ð»Ñ ÐºÐ¾Ñ€Ð½ÐµÐ²Ð¾Ð¹ файловой ÑиÑтемы:" - -#. Type: string -#. Description -#: ../mdadm.templates:2001 -msgid "" -"Please enter 'all', 'none', or a space-separated list of devices such as " -"'md0 md1' or 'md/1 md/d0' (the leading '/dev/' can be omitted)." -msgstr "" -"Введите ÑпиÑок уÑтройÑтв через пробел, Ñлово 'all' или 'none'. Ð’Ñ‹ можете не " -"указывать начальную чаÑÑ‚ÑŒ пути типа '/dev/', а проÑто вводить имена " -"уÑтройÑтв, например 'md0 md1' или 'md/1 md/d0'." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "for internal use - only the long description is needed." -msgstr "" -"Ð´Ð»Ñ Ð²Ð½ÑƒÑ‚Ñ€ÐµÐ½Ð½ÐµÐ³Ð¾ Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ð½Ð¸Ñ - нужно иÑпользовать только длинное опиÑание." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If the system's root file system is located on an MD array (RAID), it needs " -"to be started early during the boot sequence. If it is located on a logical " -"volume (LVM), which is on MD, all constituent arrays need to be started." -msgstr "" -"ЕÑли в ÑиÑтеме ÐºÐ¾Ñ€Ð½ÐµÐ²Ð°Ñ Ñ„Ð°Ð¹Ð»Ð¾Ð²Ð°Ñ ÑиÑтема раÑположена на MD-маÑÑиве (RAID), " -"он должен быть запущен в Ñамом начале процеÑÑа загрузки. ЕÑли ÐºÐ¾Ñ€Ð½ÐµÐ²Ð°Ñ " -"Ñ„Ð°Ð¹Ð»Ð¾Ð²Ð°Ñ ÑиÑтема раÑположена на логичеÑком томе (LVM), который раÑположен на " -"MD, то должны быть запущены вÑе ÑоÑтавлÑющие маÑÑивы." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If you know exactly which arrays are needed to bring up the root file " -"system, and you want to postpone starting all other arrays to a later point " -"in the boot sequence, enter the arrays to start here. Alternatively, enter " -"'all' to simply start all available arrays." -msgstr "" -"ЕÑли вы точно знаете, какие маÑÑивы требуютÑÑ Ð´Ð»Ñ Ð¿Ð¾Ð»ÑƒÑ‡ÐµÐ½Ð¸Ñ Ñ€Ð°Ð±Ð¾Ñ‚Ð¾ÑпоÑобной " -"корневой файловой ÑиÑтемы и хотите отложить запуÑк оÑтальных маÑÑивов на " -"более поздний момент в процеÑÑе загрузки, то введите их здеÑÑŒ. Иначе, " -"введите Ñлово 'all', чтобы проÑто запуÑтить вÑе доÑтупные маÑÑивы." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If you do not need or want to start any arrays for the root file system, " -"leave the answer blank (or enter 'none'). This may be the case if you are " -"using kernel autostart or do not need any arrays to boot." -msgstr "" -"ЕÑли вам Ñто не нужно, или вы хотите запуÑкать вÑе маÑÑивы Ð´Ð»Ñ ÐºÐ¾Ñ€Ð½ÐµÐ²Ð¾Ð¹ " -"файловой ÑиÑтемы, оÑтавьте Ñто поле пуÑтым (или введите Ñлово 'none'). Ðтот " -"вариант подходит, еÑли вы иÑпользуете автоматичеÑкий запуÑк из Ñдра или еÑли " -"Ð´Ð»Ñ Ð·Ð°Ð³Ñ€ÑƒÐ·ÐºÐ¸ маÑÑивы ненужны." - -#. Type: text -#. Description -#: ../mdadm.templates:4001 -msgid "An error occurred: device node does not exist" -msgstr "Произошла ошибка: нода уÑтройÑтва не ÑущеÑтвует" - -#. Type: text -#. Description -#: ../mdadm.templates:5001 -msgid "An error occurred: not a block device" -msgstr "Произошла ошибка: уÑтройÑтво не ÑвлÑетÑÑ Ð±Ð»Ð¾Ñ‡Ð½Ñ‹Ð¼" - -#. Type: text -#. Description -#: ../mdadm.templates:6001 -msgid "An error occurred: not an MD array" -msgstr "Произошла ошибка: Ñто не MD-маÑÑив" - -#. Type: text -#. Description -#: ../mdadm.templates:7001 -msgid "An error occurred: array not listed in mdadm.conf file" -msgstr "Произошла ошибка: маÑÑив не опиÑан в файле mdadm.conf" - -#. Type: boolean -#. Description -#: ../mdadm.templates:8001 -msgid "Start arrays not listed in mdadm.conf?" -msgstr "ЗапуÑтить маÑÑивы, неопиÑанные в mdadm.conf?" - -#. Type: boolean -#. Description -#: ../mdadm.templates:8001 -msgid "" -"The specified array (${array}) is not listed in the configuration file " -"(${config}). Therefore, it cannot be started during boot, unless you correct " -"the configuration file and recreate the initial ramdisk." -msgstr "" -"Указанный вами маÑÑив (${array}) не опиÑан в конфигурационном файле " -"(${config}). ПоÑтому он не может быть запущен при Ñтарте машины, пока вы не " -"иÑправите конфигурационный файл и не переÑоздадите первоначальный ramdisk." - -#. Type: boolean -#. Description -#: ../mdadm.templates:8001 -msgid "" -"This warning is only relevant if you need arrays to be started from the " -"initial ramdisk to be able to boot. If you use kernel autostarting, or do " -"not need any arrays to be started as early as the initial ramdisk is loaded, " -"you can simply continue. Alternatively, choose not to continue and enter " -"'none' when prompted which arrays to start from the initial ramdisk." -msgstr "" -"Данное предупреждение умеÑтно только, еÑли вам требуетÑÑ Ð·Ð°Ð¿ÑƒÑкать маÑÑивы " -"из первоначального ramdisk Ð´Ð»Ñ Ð·Ð°Ð³Ñ€ÑƒÐ·ÐºÐ¸ машины. ЕÑли вы иÑпользуете " -"автоматичеÑкий запуÑк из Ñдра или вам не нужны маÑÑивы Ð´Ð»Ñ Ð·Ð°Ð³Ñ€ÑƒÐ·ÐºÐ¸ на Ñтапе " -"загрузки первоначального ramdisk, вы можете проÑто продолжить. Иначе, " -"выберите не продолжать и введите 'none', когда вам предложат выбрать маÑÑивы " -"Ð´Ð»Ñ Ð·Ð°Ð¿ÑƒÑка из первоначального ramdisk." - #. Type: boolean #. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "Should mdadm run monthly redundancy checks of the MD arrays?" msgstr "" "Должен ли mdadm запуÑкать ежемеÑÑчную проверку избыточноÑти на MD-маÑÑивах?" #. Type: boolean #. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "" "If the kernel supports it (versions greater than 2.6.14), mdadm can " "periodically check the redundancy of MD arrays (RAIDs). This may be a " @@ -177,7 +54,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "" "The default, if turned on, is to check on the first Sunday of every month at " "01:06." @@ -187,13 +64,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "Do you want to start the MD monitoring daemon?" msgstr "ЗапуÑкать демон-монитор MD?" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "" "The MD (RAID) monitor daemon sends email notifications in response to " "important MD events (such as a disk failure)." @@ -203,22 +80,110 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "Enabling this option is recommended." msgstr "РекомендуетÑÑ Ð¾Ñ‚Ð²ÐµÑ‚Ð¸Ñ‚ÑŒ утвердительно." #. Type: string #. Description -#: ../mdadm.templates:12001 +#: ../mdadm.templates:4001 msgid "Recipient for email notifications:" msgstr "Получатель уведомительных пиÑем:" #. Type: string #. Description -#: ../mdadm.templates:12001 +#: ../mdadm.templates:4001 msgid "" "Please enter the email address of the user who should get the email " "notifications for important MD events." msgstr "" "Введите Ð°Ð´Ñ€ÐµÑ Ñлектронной почты пользователÑ, который будет получать " "почтовые ÑƒÐ²ÐµÐ´Ð¾Ð¼Ð»ÐµÐ½Ð¸Ñ Ð¾ важных изменениÑÑ… в ÑоÑтоÑнии MD." + +#~ msgid "MD arrays needed for the root file system:" +#~ msgstr "MD-маÑÑивы, необходимые Ð´Ð»Ñ ÐºÐ¾Ñ€Ð½ÐµÐ²Ð¾Ð¹ файловой ÑиÑтемы:" + +#~ msgid "" +#~ "Please enter 'all', 'none', or a space-separated list of devices such as " +#~ "'md0 md1' or 'md/1 md/d0' (the leading '/dev/' can be omitted)." +#~ msgstr "" +#~ "Введите ÑпиÑок уÑтройÑтв через пробел, Ñлово 'all' или 'none'. Ð’Ñ‹ можете " +#~ "не указывать начальную чаÑÑ‚ÑŒ пути типа '/dev/', а проÑто вводить имена " +#~ "уÑтройÑтв, например 'md0 md1' или 'md/1 md/d0'." + +#~ msgid "for internal use - only the long description is needed." +#~ msgstr "" +#~ "Ð´Ð»Ñ Ð²Ð½ÑƒÑ‚Ñ€ÐµÐ½Ð½ÐµÐ³Ð¾ Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ð½Ð¸Ñ - нужно иÑпользовать только длинное опиÑание." + +#~ msgid "" +#~ "If the system's root file system is located on an MD array (RAID), it " +#~ "needs to be started early during the boot sequence. If it is located on a " +#~ "logical volume (LVM), which is on MD, all constituent arrays need to be " +#~ "started." +#~ msgstr "" +#~ "ЕÑли в ÑиÑтеме ÐºÐ¾Ñ€Ð½ÐµÐ²Ð°Ñ Ñ„Ð°Ð¹Ð»Ð¾Ð²Ð°Ñ ÑиÑтема раÑположена на MD-маÑÑиве " +#~ "(RAID), он должен быть запущен в Ñамом начале процеÑÑа загрузки. ЕÑли " +#~ "ÐºÐ¾Ñ€Ð½ÐµÐ²Ð°Ñ Ñ„Ð°Ð¹Ð»Ð¾Ð²Ð°Ñ ÑиÑтема раÑположена на логичеÑком томе (LVM), который " +#~ "раÑположен на MD, то должны быть запущены вÑе ÑоÑтавлÑющие маÑÑивы." + +#~ msgid "" +#~ "If you know exactly which arrays are needed to bring up the root file " +#~ "system, and you want to postpone starting all other arrays to a later " +#~ "point in the boot sequence, enter the arrays to start here. " +#~ "Alternatively, enter 'all' to simply start all available arrays." +#~ msgstr "" +#~ "ЕÑли вы точно знаете, какие маÑÑивы требуютÑÑ Ð´Ð»Ñ Ð¿Ð¾Ð»ÑƒÑ‡ÐµÐ½Ð¸Ñ " +#~ "работоÑпоÑобной корневой файловой ÑиÑтемы и хотите отложить запуÑк " +#~ "оÑтальных маÑÑивов на более поздний момент в процеÑÑе загрузки, то " +#~ "введите их здеÑÑŒ. Иначе, введите Ñлово 'all', чтобы проÑто запуÑтить вÑе " +#~ "доÑтупные маÑÑивы." + +#~ msgid "" +#~ "If you do not need or want to start any arrays for the root file system, " +#~ "leave the answer blank (or enter 'none'). This may be the case if you are " +#~ "using kernel autostart or do not need any arrays to boot." +#~ msgstr "" +#~ "ЕÑли вам Ñто не нужно, или вы хотите запуÑкать вÑе маÑÑивы Ð´Ð»Ñ ÐºÐ¾Ñ€Ð½ÐµÐ²Ð¾Ð¹ " +#~ "файловой ÑиÑтемы, оÑтавьте Ñто поле пуÑтым (или введите Ñлово 'none'). " +#~ "Ðтот вариант подходит, еÑли вы иÑпользуете автоматичеÑкий запуÑк из Ñдра " +#~ "или еÑли Ð´Ð»Ñ Ð·Ð°Ð³Ñ€ÑƒÐ·ÐºÐ¸ маÑÑивы ненужны." + +#~ msgid "An error occurred: device node does not exist" +#~ msgstr "Произошла ошибка: нода уÑтройÑтва не ÑущеÑтвует" + +#~ msgid "An error occurred: not a block device" +#~ msgstr "Произошла ошибка: уÑтройÑтво не ÑвлÑетÑÑ Ð±Ð»Ð¾Ñ‡Ð½Ñ‹Ð¼" + +#~ msgid "An error occurred: not an MD array" +#~ msgstr "Произошла ошибка: Ñто не MD-маÑÑив" + +#~ msgid "An error occurred: array not listed in mdadm.conf file" +#~ msgstr "Произошла ошибка: маÑÑив не опиÑан в файле mdadm.conf" + +#~ msgid "Start arrays not listed in mdadm.conf?" +#~ msgstr "ЗапуÑтить маÑÑивы, неопиÑанные в mdadm.conf?" + +#~ msgid "" +#~ "The specified array (${array}) is not listed in the configuration file " +#~ "(${config}). Therefore, it cannot be started during boot, unless you " +#~ "correct the configuration file and recreate the initial ramdisk." +#~ msgstr "" +#~ "Указанный вами маÑÑив (${array}) не опиÑан в конфигурационном файле " +#~ "(${config}). ПоÑтому он не может быть запущен при Ñтарте машины, пока вы " +#~ "не иÑправите конфигурационный файл и не переÑоздадите первоначальный " +#~ "ramdisk." + +#~ msgid "" +#~ "This warning is only relevant if you need arrays to be started from the " +#~ "initial ramdisk to be able to boot. If you use kernel autostarting, or do " +#~ "not need any arrays to be started as early as the initial ramdisk is " +#~ "loaded, you can simply continue. Alternatively, choose not to continue " +#~ "and enter 'none' when prompted which arrays to start from the initial " +#~ "ramdisk." +#~ msgstr "" +#~ "Данное предупреждение умеÑтно только, еÑли вам требуетÑÑ Ð·Ð°Ð¿ÑƒÑкать " +#~ "маÑÑивы из первоначального ramdisk Ð´Ð»Ñ Ð·Ð°Ð³Ñ€ÑƒÐ·ÐºÐ¸ машины. ЕÑли вы " +#~ "иÑпользуете автоматичеÑкий запуÑк из Ñдра или вам не нужны маÑÑивы Ð´Ð»Ñ " +#~ "загрузки на Ñтапе загрузки первоначального ramdisk, вы можете проÑто " +#~ "продолжить. Иначе, выберите не продолжать и введите 'none', когда вам " +#~ "предложат выбрать маÑÑивы Ð´Ð»Ñ Ð·Ð°Ð¿ÑƒÑка из первоначального ramdisk." diff --git a/debian/po/sk.po b/debian/po/sk.po index 5d6d5a50..c84247ba 100644 --- a/debian/po/sk.po +++ b/debian/po/sk.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: mdadm 3.2.2-1\n" "Report-Msgid-Bugs-To: mdadm@packages.debian.org\n" -"POT-Creation-Date: 2012-05-22 00:50+0100\n" +"POT-Creation-Date: 2016-07-05 14:12+0200\n" "PO-Revision-Date: 2011-09-18 11:22+0200\n" "Last-Translator: Slavko <linux@slavino.sk>\n" "Language-Team: Slovak <debian-l10n-slovak@lists.debian.org>\n" @@ -19,135 +19,15 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" -#. Type: string -#. Description -#: ../mdadm.templates:2001 -msgid "MD arrays needed for the root file system:" -msgstr "Polia MD, potrebné pre koreň súborového systému:" - -#. Type: string -#. Description -#: ../mdadm.templates:2001 -msgid "" -"Please enter 'all', 'none', or a space-separated list of devices such as " -"'md0 md1' or 'md/1 md/d0' (the leading '/dev/' can be omitted)." -msgstr "" -"ProsÃm, zadajte „allâ€, „none†alebo medzerou oddelený zoznam zariadenÃ, " -"napr. „md0 md1†alebo „md/1 md/d0†(poÄiatoÄné „/dev/†môže byÅ¥ vynechané)." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "for internal use - only the long description is needed." -msgstr "na interné použitie – potrebný je len dlhý popis." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If the system's root file system is located on an MD array (RAID), it needs " -"to be started early during the boot sequence. If it is located on a logical " -"volume (LVM), which is on MD, all constituent arrays need to be started." -msgstr "" -"Ak je koreň súborového systému umiestnený na poli MD (RAID), musà byÅ¥ " -"spustený poÄas zavádzania systému. Ak je koreň umiestnený na logickom zväzku " -"(LVM), ktorý je na MD, musia byÅ¥ spustené vÅ¡etky súvisiace polia." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If you know exactly which arrays are needed to bring up the root file " -"system, and you want to postpone starting all other arrays to a later point " -"in the boot sequence, enter the arrays to start here. Alternatively, enter " -"'all' to simply start all available arrays." -msgstr "" -"Ak viete presne, ktoré polia sú potrebné na pripojenie koreňa súborového " -"systému a chcete odložiÅ¥ Å¡tart vÅ¡etkých ostatných polà na neskorÅ¡Ã okamih " -"zavádzania, zadajte tu polia, ktoré majú byÅ¥ spustené. Alebo zadajte „allâ€, " -"ÄÃm budú jednoducho spustené vÅ¡etky dostupné polia." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If you do not need or want to start any arrays for the root file system, " -"leave the answer blank (or enter 'none'). This may be the case if you are " -"using kernel autostart or do not need any arrays to boot." -msgstr "" -"Ak pre koreň súborového systému nepotrebujete alebo nechcete spúšťaÅ¥ žiadne " -"polia, nechajte odpoveÄ prázdnu (alebo zadajte „noneâ€). Tento prÃpad môže " -"nastaÅ¥, ak použÃvate automatický Å¡tart polà priamo v jadre alebo " -"nepotrebujete pri zavádzanà žiadne polia." - -#. Type: text -#. Description -#: ../mdadm.templates:4001 -msgid "An error occurred: device node does not exist" -msgstr "Nastala chyba: uzol zariadenia neexistuje" - -#. Type: text -#. Description -#: ../mdadm.templates:5001 -msgid "An error occurred: not a block device" -msgstr "Nastala chyba: nie je blokové zariadenie" - -#. Type: text -#. Description -#: ../mdadm.templates:6001 -msgid "An error occurred: not an MD array" -msgstr "Nastala chyba: nie je pole MD" - -#. Type: text -#. Description -#: ../mdadm.templates:7001 -msgid "An error occurred: array not listed in mdadm.conf file" -msgstr "Nastala chyba: pole nie je uvedené v súbore mdadm.conf" - -#. Type: boolean -#. Description -#: ../mdadm.templates:8001 -msgid "Start arrays not listed in mdadm.conf?" -msgstr "SpustiÅ¥ polia, ktoré nie sú uvedené v mdadm.conf?" - -#. Type: boolean -#. Description -#: ../mdadm.templates:8001 -msgid "" -"The specified array (${array}) is not listed in the configuration file " -"(${config}). Therefore, it cannot be started during boot, unless you correct " -"the configuration file and recreate the initial ramdisk." -msgstr "" -"Zadané pole (${array}) nie je uvedené v konfiguraÄnom súbore (${config}), a " -"preto nemôže byÅ¥ spustené poÄas zavádzania, až kým neopravÃte konfiguraÄný " -"súbor a nevytvorÃte nový poÄiatoÄný ramdisk (initrd)." - #. Type: boolean #. Description -#: ../mdadm.templates:8001 -msgid "" -"This warning is only relevant if you need arrays to be started from the " -"initial ramdisk to be able to boot. If you use kernel autostarting, or do " -"not need any arrays to be started as early as the initial ramdisk is loaded, " -"you can simply continue. Alternatively, choose not to continue and enter " -"'none' when prompted which arrays to start from the initial ramdisk." -msgstr "" -"Toto varovanie je dôležité, len ak potrebujete aby boli polia spúšťané z " -"poÄiatoÄného ramdisku, aby boli dostupné poÄas zavádzania. Ak použÃvate " -"automatické spúšťanie polà priamo z jadra, alebo ak nepotrebujte aby boli " -"polia spúšťané tak skoro (z poÄiatoÄného ramdisku), môžete prosto " -"pokraÄovaÅ¥. Alebo môžete zvoliÅ¥ nepokraÄovaÅ¥ a odpovedaÅ¥ „none†na otázku, " -"ktoré polia majú byÅ¥ spúšťané z poÄiatoÄného ramdisku." - -#. Type: boolean -#. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "Should mdadm run monthly redundancy checks of the MD arrays?" msgstr "Má mdadm spúšťaÅ¥ mesaÄnú kontrolu redundancie polà MD?" #. Type: boolean #. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "" "If the kernel supports it (versions greater than 2.6.14), mdadm can " "periodically check the redundancy of MD arrays (RAIDs). This may be a " @@ -165,7 +45,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "" "The default, if turned on, is to check on the first Sunday of every month at " "01:06." @@ -175,13 +55,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "Do you want to start the MD monitoring daemon?" msgstr "Chcete spustiÅ¥ démona monitorovania MD?" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "" "The MD (RAID) monitor daemon sends email notifications in response to " "important MD events (such as a disk failure)." @@ -191,22 +71,106 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "Enabling this option is recommended." msgstr "Povolenie tejto možnosti je odporúÄané." #. Type: string #. Description -#: ../mdadm.templates:12001 +#: ../mdadm.templates:4001 msgid "Recipient for email notifications:" msgstr "PrÃjemca emailových upozornenÃ:" #. Type: string #. Description -#: ../mdadm.templates:12001 +#: ../mdadm.templates:4001 msgid "" "Please enter the email address of the user who should get the email " "notifications for important MD events." msgstr "" "ProsÃm, zadajte emailovú adresu použÃvateľa, ktorý má dostávaÅ¥ emailové " "upozornenia na dôležité udalosti MD." + +#~ msgid "MD arrays needed for the root file system:" +#~ msgstr "Polia MD, potrebné pre koreň súborového systému:" + +#~ msgid "" +#~ "Please enter 'all', 'none', or a space-separated list of devices such as " +#~ "'md0 md1' or 'md/1 md/d0' (the leading '/dev/' can be omitted)." +#~ msgstr "" +#~ "ProsÃm, zadajte „allâ€, „none†alebo medzerou oddelený zoznam zariadenÃ, " +#~ "napr. „md0 md1†alebo „md/1 md/d0†(poÄiatoÄné „/dev/†môže byÅ¥ " +#~ "vynechané)." + +#~ msgid "for internal use - only the long description is needed." +#~ msgstr "na interné použitie – potrebný je len dlhý popis." + +#~ msgid "" +#~ "If the system's root file system is located on an MD array (RAID), it " +#~ "needs to be started early during the boot sequence. If it is located on a " +#~ "logical volume (LVM), which is on MD, all constituent arrays need to be " +#~ "started." +#~ msgstr "" +#~ "Ak je koreň súborového systému umiestnený na poli MD (RAID), musà byÅ¥ " +#~ "spustený poÄas zavádzania systému. Ak je koreň umiestnený na logickom " +#~ "zväzku (LVM), ktorý je na MD, musia byÅ¥ spustené vÅ¡etky súvisiace polia." + +#~ msgid "" +#~ "If you know exactly which arrays are needed to bring up the root file " +#~ "system, and you want to postpone starting all other arrays to a later " +#~ "point in the boot sequence, enter the arrays to start here. " +#~ "Alternatively, enter 'all' to simply start all available arrays." +#~ msgstr "" +#~ "Ak viete presne, ktoré polia sú potrebné na pripojenie koreňa súborového " +#~ "systému a chcete odložiÅ¥ Å¡tart vÅ¡etkých ostatných polà na neskorÅ¡Ã okamih " +#~ "zavádzania, zadajte tu polia, ktoré majú byÅ¥ spustené. Alebo zadajte " +#~ "„allâ€, ÄÃm budú jednoducho spustené vÅ¡etky dostupné polia." + +#~ msgid "" +#~ "If you do not need or want to start any arrays for the root file system, " +#~ "leave the answer blank (or enter 'none'). This may be the case if you are " +#~ "using kernel autostart or do not need any arrays to boot." +#~ msgstr "" +#~ "Ak pre koreň súborového systému nepotrebujete alebo nechcete spúšťaÅ¥ " +#~ "žiadne polia, nechajte odpoveÄ prázdnu (alebo zadajte „noneâ€). Tento " +#~ "prÃpad môže nastaÅ¥, ak použÃvate automatický Å¡tart polà priamo v jadre " +#~ "alebo nepotrebujete pri zavádzanà žiadne polia." + +#~ msgid "An error occurred: device node does not exist" +#~ msgstr "Nastala chyba: uzol zariadenia neexistuje" + +#~ msgid "An error occurred: not a block device" +#~ msgstr "Nastala chyba: nie je blokové zariadenie" + +#~ msgid "An error occurred: not an MD array" +#~ msgstr "Nastala chyba: nie je pole MD" + +#~ msgid "An error occurred: array not listed in mdadm.conf file" +#~ msgstr "Nastala chyba: pole nie je uvedené v súbore mdadm.conf" + +#~ msgid "Start arrays not listed in mdadm.conf?" +#~ msgstr "SpustiÅ¥ polia, ktoré nie sú uvedené v mdadm.conf?" + +#~ msgid "" +#~ "The specified array (${array}) is not listed in the configuration file " +#~ "(${config}). Therefore, it cannot be started during boot, unless you " +#~ "correct the configuration file and recreate the initial ramdisk." +#~ msgstr "" +#~ "Zadané pole (${array}) nie je uvedené v konfiguraÄnom súbore (${config}), " +#~ "a preto nemôže byÅ¥ spustené poÄas zavádzania, až kým neopravÃte " +#~ "konfiguraÄný súbor a nevytvorÃte nový poÄiatoÄný ramdisk (initrd)." + +#~ msgid "" +#~ "This warning is only relevant if you need arrays to be started from the " +#~ "initial ramdisk to be able to boot. If you use kernel autostarting, or do " +#~ "not need any arrays to be started as early as the initial ramdisk is " +#~ "loaded, you can simply continue. Alternatively, choose not to continue " +#~ "and enter 'none' when prompted which arrays to start from the initial " +#~ "ramdisk." +#~ msgstr "" +#~ "Toto varovanie je dôležité, len ak potrebujete aby boli polia spúšťané z " +#~ "poÄiatoÄného ramdisku, aby boli dostupné poÄas zavádzania. Ak použÃvate " +#~ "automatické spúšťanie polà priamo z jadra, alebo ak nepotrebujte aby boli " +#~ "polia spúšťané tak skoro (z poÄiatoÄného ramdisku), môžete prosto " +#~ "pokraÄovaÅ¥. Alebo môžete zvoliÅ¥ nepokraÄovaÅ¥ a odpovedaÅ¥ „none†na " +#~ "otázku, ktoré polia majú byÅ¥ spúšťané z poÄiatoÄného ramdisku." diff --git a/debian/po/sv.po b/debian/po/sv.po index 8257c8dd..ed9f1f21 100644 --- a/debian/po/sv.po +++ b/debian/po/sv.po @@ -14,7 +14,7 @@ msgid "" msgstr "" "Project-Id-Version: mdadm_2.6.7-3_sv\n" "Report-Msgid-Bugs-To: mdadm@packages.debian.org\n" -"POT-Creation-Date: 2012-05-22 00:50+0100\n" +"POT-Creation-Date: 2016-07-05 14:12+0200\n" "PO-Revision-Date: 2008-07-23 18:34+0200\n" "Last-Translator: Martin Ågren <martin.agren@gmail.com>\n" "Language-Team: Swedish <debian-l10n-swedish@lists.debian.org>\n" @@ -25,135 +25,15 @@ msgstr "" "X-Generator: KBabel 1.11.4\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#. Type: string -#. Description -#: ../mdadm.templates:2001 -msgid "MD arrays needed for the root file system:" -msgstr "MD-kedjor som behövs för rotfilsystemet:" - -#. Type: string -#. Description -#: ../mdadm.templates:2001 -msgid "" -"Please enter 'all', 'none', or a space-separated list of devices such as " -"'md0 md1' or 'md/1 md/d0' (the leading '/dev/' can be omitted)." -msgstr "" -"Ange \"all\", \"none\" eller en blankstegsseparerad lista på enheter, såsom " -"\"md0 md1\" eller \"md/1 md/0\" (det inledande \"/dev\" kan uteslutas)." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "for internal use - only the long description is needed." -msgstr "för intern användning - endast den långa beskrivningen behövs." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If the system's root file system is located on an MD array (RAID), it needs " -"to be started early during the boot sequence. If it is located on a logical " -"volume (LVM), which is on MD, all constituent arrays need to be started." -msgstr "" -"Om ditt system har sitt rotfilsystem på en MD-kedja (RAID) behöver den " -"startas upp tidigt under uppstartssekvensen. Om ditt rotfilsystem finns på " -"en logisk volym (LVM), vilket är på MD, behöver alla bestående kedjor " -"startas." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If you know exactly which arrays are needed to bring up the root file " -"system, and you want to postpone starting all other arrays to a later point " -"in the boot sequence, enter the arrays to start here. Alternatively, enter " -"'all' to simply start all available arrays." -msgstr "" -"Om du vet exakt vilka kedjor som behövs för att ta upp rotfilsystemet, och " -"du vill skjuta upp uppstarten för alla andra kedjor till en senare tidspunkt " -"i uppstartssekvensen, ange vilka kedjor som ska starta här. Alternativt, " -"ange \"all\" för att helt enkelt starta alla tillgängliga kedjor." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If you do not need or want to start any arrays for the root file system, " -"leave the answer blank (or enter 'none'). This may be the case if you are " -"using kernel autostart or do not need any arrays to boot." -msgstr "" -"Om du inte behöver eller vill starta några kedjor för rotfilsystemet, lämna " -"svaret blankt (eller ange \"none\"). Detta kan vara fallet om du använder " -"kärnans automatstart eller inte behöver några kedjor för att starta upp." - -#. Type: text -#. Description -#: ../mdadm.templates:4001 -msgid "An error occurred: device node does not exist" -msgstr "Ett fel inträffade: enhetsnoden finns inte" - -#. Type: text -#. Description -#: ../mdadm.templates:5001 -msgid "An error occurred: not a block device" -msgstr "Ett fel inträffade: inte en blockenhet" - -#. Type: text -#. Description -#: ../mdadm.templates:6001 -msgid "An error occurred: not an MD array" -msgstr "Ett fel inträffade: inte en MD-kedja" - -#. Type: text -#. Description -#: ../mdadm.templates:7001 -msgid "An error occurred: array not listed in mdadm.conf file" -msgstr "Ett fel inträffade: kedjan är inte listad i filen mdadm.conf" - -#. Type: boolean -#. Description -#: ../mdadm.templates:8001 -msgid "Start arrays not listed in mdadm.conf?" -msgstr "Starta kedjor som inte är listade i mdadm.conf?" - -#. Type: boolean -#. Description -#: ../mdadm.templates:8001 -msgid "" -"The specified array (${array}) is not listed in the configuration file " -"(${config}). Therefore, it cannot be started during boot, unless you correct " -"the configuration file and recreate the initial ramdisk." -msgstr "" -"Kedjan du har angivit (${array}) är inte listad i konfigurationsfilen " -"(${config}). Därför kan den inte startas under systemets uppstart, såvida du " -"inte rättar till konfigurationsfilen och återskapar den initiala ramdisken." - #. Type: boolean #. Description -#: ../mdadm.templates:8001 -msgid "" -"This warning is only relevant if you need arrays to be started from the " -"initial ramdisk to be able to boot. If you use kernel autostarting, or do " -"not need any arrays to be started as early as the initial ramdisk is loaded, " -"you can simply continue. Alternatively, choose not to continue and enter " -"'none' when prompted which arrays to start from the initial ramdisk." -msgstr "" -"Den här varningen är endast relevant om du behöver kedjor som ska startas " -"från den initiala ramdisken för att kunna starta upp systemet. Om du " -"använder kärnans automatstart, eller inte behöver starta några kedjor så " -"tidigt som när de initiala ramdisken läses in, kan du helt enkelt fortsätta. " -"Alternativt, välj att inte fortsätta och ange \"none\" när frågan om vilka " -"kedjor som ska startas från den initiala ramdisken ställs." - -#. Type: boolean -#. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "Should mdadm run monthly redundancy checks of the MD arrays?" msgstr "Ska mdadm köra månatliga redundanskontroller av MD-kedjorna?" #. Type: boolean #. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "" "If the kernel supports it (versions greater than 2.6.14), mdadm can " "periodically check the redundancy of MD arrays (RAIDs). This may be a " @@ -172,7 +52,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "" "The default, if turned on, is to check on the first Sunday of every month at " "01:06." @@ -182,13 +62,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "Do you want to start the MD monitoring daemon?" msgstr "Vill du starta MD-övervakningsdemonen?" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "" "The MD (RAID) monitor daemon sends email notifications in response to " "important MD events (such as a disk failure)." @@ -198,22 +78,109 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "Enabling this option is recommended." msgstr "Att aktivera denna funktion rekommenderas." #. Type: string #. Description -#: ../mdadm.templates:12001 +#: ../mdadm.templates:4001 msgid "Recipient for email notifications:" msgstr "Mottagare av e-postnotifieringar:" #. Type: string #. Description -#: ../mdadm.templates:12001 +#: ../mdadm.templates:4001 msgid "" "Please enter the email address of the user who should get the email " "notifications for important MD events." msgstr "" "Ange e-postadressen till den användare som ska ta emot e-postnotifieringar " "för dessa viktiga MD-händelser." + +#~ msgid "MD arrays needed for the root file system:" +#~ msgstr "MD-kedjor som behövs för rotfilsystemet:" + +#~ msgid "" +#~ "Please enter 'all', 'none', or a space-separated list of devices such as " +#~ "'md0 md1' or 'md/1 md/d0' (the leading '/dev/' can be omitted)." +#~ msgstr "" +#~ "Ange \"all\", \"none\" eller en blankstegsseparerad lista på enheter, " +#~ "såsom \"md0 md1\" eller \"md/1 md/0\" (det inledande \"/dev\" kan " +#~ "uteslutas)." + +#~ msgid "for internal use - only the long description is needed." +#~ msgstr "för intern användning - endast den långa beskrivningen behövs." + +#~ msgid "" +#~ "If the system's root file system is located on an MD array (RAID), it " +#~ "needs to be started early during the boot sequence. If it is located on a " +#~ "logical volume (LVM), which is on MD, all constituent arrays need to be " +#~ "started." +#~ msgstr "" +#~ "Om ditt system har sitt rotfilsystem på en MD-kedja (RAID) behöver den " +#~ "startas upp tidigt under uppstartssekvensen. Om ditt rotfilsystem finns " +#~ "på en logisk volym (LVM), vilket är på MD, behöver alla bestående kedjor " +#~ "startas." + +#~ msgid "" +#~ "If you know exactly which arrays are needed to bring up the root file " +#~ "system, and you want to postpone starting all other arrays to a later " +#~ "point in the boot sequence, enter the arrays to start here. " +#~ "Alternatively, enter 'all' to simply start all available arrays." +#~ msgstr "" +#~ "Om du vet exakt vilka kedjor som behövs för att ta upp rotfilsystemet, " +#~ "och du vill skjuta upp uppstarten för alla andra kedjor till en senare " +#~ "tidspunkt i uppstartssekvensen, ange vilka kedjor som ska starta här. " +#~ "Alternativt, ange \"all\" för att helt enkelt starta alla tillgängliga " +#~ "kedjor." + +#~ msgid "" +#~ "If you do not need or want to start any arrays for the root file system, " +#~ "leave the answer blank (or enter 'none'). This may be the case if you are " +#~ "using kernel autostart or do not need any arrays to boot." +#~ msgstr "" +#~ "Om du inte behöver eller vill starta några kedjor för rotfilsystemet, " +#~ "lämna svaret blankt (eller ange \"none\"). Detta kan vara fallet om du " +#~ "använder kärnans automatstart eller inte behöver några kedjor för att " +#~ "starta upp." + +#~ msgid "An error occurred: device node does not exist" +#~ msgstr "Ett fel inträffade: enhetsnoden finns inte" + +#~ msgid "An error occurred: not a block device" +#~ msgstr "Ett fel inträffade: inte en blockenhet" + +#~ msgid "An error occurred: not an MD array" +#~ msgstr "Ett fel inträffade: inte en MD-kedja" + +#~ msgid "An error occurred: array not listed in mdadm.conf file" +#~ msgstr "Ett fel inträffade: kedjan är inte listad i filen mdadm.conf" + +#~ msgid "Start arrays not listed in mdadm.conf?" +#~ msgstr "Starta kedjor som inte är listade i mdadm.conf?" + +#~ msgid "" +#~ "The specified array (${array}) is not listed in the configuration file " +#~ "(${config}). Therefore, it cannot be started during boot, unless you " +#~ "correct the configuration file and recreate the initial ramdisk." +#~ msgstr "" +#~ "Kedjan du har angivit (${array}) är inte listad i konfigurationsfilen " +#~ "(${config}). Därför kan den inte startas under systemets uppstart, såvida " +#~ "du inte rättar till konfigurationsfilen och återskapar den initiala " +#~ "ramdisken." + +#~ msgid "" +#~ "This warning is only relevant if you need arrays to be started from the " +#~ "initial ramdisk to be able to boot. If you use kernel autostarting, or do " +#~ "not need any arrays to be started as early as the initial ramdisk is " +#~ "loaded, you can simply continue. Alternatively, choose not to continue " +#~ "and enter 'none' when prompted which arrays to start from the initial " +#~ "ramdisk." +#~ msgstr "" +#~ "Den här varningen är endast relevant om du behöver kedjor som ska startas " +#~ "från den initiala ramdisken för att kunna starta upp systemet. Om du " +#~ "använder kärnans automatstart, eller inte behöver starta några kedjor så " +#~ "tidigt som när de initiala ramdisken läses in, kan du helt enkelt " +#~ "fortsätta. Alternativt, välj att inte fortsätta och ange \"none\" när " +#~ "frågan om vilka kedjor som ska startas från den initiala ramdisken ställs." diff --git a/debian/po/templates.pot b/debian/po/templates.pot index beb000aa..3860e909 100644 --- a/debian/po/templates.pot +++ b/debian/po/templates.pot @@ -1,6 +1,6 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. +# This file is distributed under the same license as the mdadm package. # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. # #, fuzzy @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: mdadm\n" "Report-Msgid-Bugs-To: mdadm@packages.debian.org\n" -"POT-Creation-Date: 2012-05-22 00:50+0100\n" +"POT-Creation-Date: 2016-07-05 14:12+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -17,113 +17,15 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#. Type: string -#. Description -#: ../mdadm.templates:2001 -msgid "MD arrays needed for the root file system:" -msgstr "" - -#. Type: string -#. Description -#: ../mdadm.templates:2001 -msgid "" -"Please enter 'all', 'none', or a space-separated list of devices such as " -"'md0 md1' or 'md/1 md/d0' (the leading '/dev/' can be omitted)." -msgstr "" - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "for internal use - only the long description is needed." -msgstr "" - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If the system's root file system is located on an MD array (RAID), it needs " -"to be started early during the boot sequence. If it is located on a logical " -"volume (LVM), which is on MD, all constituent arrays need to be started." -msgstr "" - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If you know exactly which arrays are needed to bring up the root file " -"system, and you want to postpone starting all other arrays to a later point " -"in the boot sequence, enter the arrays to start here. Alternatively, enter " -"'all' to simply start all available arrays." -msgstr "" - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If you do not need or want to start any arrays for the root file system, " -"leave the answer blank (or enter 'none'). This may be the case if you are " -"using kernel autostart or do not need any arrays to boot." -msgstr "" - -#. Type: text -#. Description -#: ../mdadm.templates:4001 -msgid "An error occurred: device node does not exist" -msgstr "" - -#. Type: text -#. Description -#: ../mdadm.templates:5001 -msgid "An error occurred: not a block device" -msgstr "" - -#. Type: text -#. Description -#: ../mdadm.templates:6001 -msgid "An error occurred: not an MD array" -msgstr "" - -#. Type: text -#. Description -#: ../mdadm.templates:7001 -msgid "An error occurred: array not listed in mdadm.conf file" -msgstr "" - -#. Type: boolean -#. Description -#: ../mdadm.templates:8001 -msgid "Start arrays not listed in mdadm.conf?" -msgstr "" - -#. Type: boolean -#. Description -#: ../mdadm.templates:8001 -msgid "" -"The specified array (${array}) is not listed in the configuration file " -"(${config}). Therefore, it cannot be started during boot, unless you correct " -"the configuration file and recreate the initial ramdisk." -msgstr "" - -#. Type: boolean -#. Description -#: ../mdadm.templates:8001 -msgid "" -"This warning is only relevant if you need arrays to be started from the " -"initial ramdisk to be able to boot. If you use kernel autostarting, or do " -"not need any arrays to be started as early as the initial ramdisk is loaded, " -"you can simply continue. Alternatively, choose not to continue and enter " -"'none' when prompted which arrays to start from the initial ramdisk." -msgstr "" - #. Type: boolean #. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "Should mdadm run monthly redundancy checks of the MD arrays?" msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "" "If the kernel supports it (versions greater than 2.6.14), mdadm can " "periodically check the redundancy of MD arrays (RAIDs). This may be a " @@ -135,7 +37,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "" "The default, if turned on, is to check on the first Sunday of every month at " "01:06." @@ -143,13 +45,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "Do you want to start the MD monitoring daemon?" msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "" "The MD (RAID) monitor daemon sends email notifications in response to " "important MD events (such as a disk failure)." @@ -157,19 +59,19 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "Enabling this option is recommended." msgstr "" #. Type: string #. Description -#: ../mdadm.templates:12001 +#: ../mdadm.templates:4001 msgid "Recipient for email notifications:" msgstr "" #. Type: string #. Description -#: ../mdadm.templates:12001 +#: ../mdadm.templates:4001 msgid "" "Please enter the email address of the user who should get the email " "notifications for important MD events." diff --git a/debian/po/vi.po b/debian/po/vi.po index 0e4933ca..cf6c4b17 100644 --- a/debian/po/vi.po +++ b/debian/po/vi.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: mdadm 2.6.3+200709292116+4450e59-4\n" "Report-Msgid-Bugs-To: mdadm@packages.debian.org\n" -"POT-Creation-Date: 2012-05-22 00:50+0100\n" +"POT-Creation-Date: 2016-07-05 14:12+0200\n" "PO-Revision-Date: 2008-02-23 17:40+1030\n" "Last-Translator: Clytie Siddall <clytie@riverland.net.au>\n" "Language-Team: Vietnamese <vi-VN@googlegroups.com>\n" @@ -17,140 +17,16 @@ msgstr "" "Plural-Forms: nplurals=1; plural=0;\n" "X-Generator: LocFactoryEditor 1.7b3\n" -#. Type: string -#. Description -#: ../mdadm.templates:2001 -msgid "MD arrays needed for the root file system:" -msgstr "Các mảng MD cần thiết cho hệ thống táºp tin gốc:" - -#. Type: string -#. Description -#: ../mdadm.templates:2001 -msgid "" -"Please enter 'all', 'none', or a space-separated list of devices such as " -"'md0 md1' or 'md/1 md/d0' (the leading '/dev/' can be omitted)." -msgstr "" -"Hãy nháºp « all » (tất cả), « none » (không có), hoặc má»™t danh sách các thiết " -"bị định giá»›i bằng dấu cách nhÆ° « md0 md1 » hoặc « md/1 md/d0 » (có thể bá» " -"sót phần « /dev/ » Ä‘i trÆ°á»›c)." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "for internal use - only the long description is needed." -msgstr "để sá» dụng ná»™i bá»™ — chỉ cần thiết mô tả dà i." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If the system's root file system is located on an MD array (RAID), it needs " -"to be started early during the boot sequence. If it is located on a logical " -"volume (LVM), which is on MD, all constituent arrays need to be started." -msgstr "" -"Nếu hệ thống táºp tin gốc của hệ thống nằm trên má»™t mảng MD (RAID) thì cần " -"phải khởi chạy nó sá»›m trong tiến trình khởi Ä‘á»™ng. Nếu nó nằm trên má»™t khối " -"tin hợp lý (LVM) mà lần lượt nằm trên má»™t MD thì cần phải khởi chạy tất cả " -"các mảng thà nh phần." - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If you know exactly which arrays are needed to bring up the root file " -"system, and you want to postpone starting all other arrays to a later point " -"in the boot sequence, enter the arrays to start here. Alternatively, enter " -"'all' to simply start all available arrays." -msgstr "" -"Nếu bạn biết chÃnh xác những mảng nà o cần thiết để kÃch hoạt hệ thống táºp " -"tin gốc, và bạn muốn hoãn việc khởi chạy các mảng khác tá»›i má»™t Ä‘iểm sau " -"trong dãy khởi Ä‘á»™ng, hãy nháºp và o đây các mảng cần khởi chạy. Hoặc nháºp « " -"all » (tất cả) để khởi chạy Ä‘Æ¡n giản tất cả các mảng sẵn sà ng. " - -#. Type: text -#. Description -#: ../mdadm.templates:3001 -msgid "" -"If you do not need or want to start any arrays for the root file system, " -"leave the answer blank (or enter 'none'). This may be the case if you are " -"using kernel autostart or do not need any arrays to boot." -msgstr "" -"Nếu bạn không cần hoặc muốn khởi chạy mảng nà o cho hệ thống táºp tin gốc, hãy " -"bá» trống câu trả lá»i nà y (hoặc nháºp « none » [không có]). TrÆ°á»ng hợp nà y có " -"thể xảy ra nếu bạn sá» dụng khả năng tá»± Ä‘á»™ng khởi Ä‘á»™ng hạt nhân (kernel " -"autostart), hoặc không cần mảng nà o để khởi Ä‘á»™ng máy tÃnh." - -#. Type: text -#. Description -#: ../mdadm.templates:4001 -msgid "An error occurred: device node does not exist" -msgstr "Gặp lá»—i: nút thiết bị không tồn tại" - -#. Type: text -#. Description -#: ../mdadm.templates:5001 -msgid "An error occurred: not a block device" -msgstr "Gặp lá»—i: không phải là má»™t thiết bị khối" - -#. Type: text -#. Description -#: ../mdadm.templates:6001 -msgid "An error occurred: not an MD array" -msgstr "Gặp lá»—i: không phải là má»™t mảng MD" - -#. Type: text -#. Description -#: ../mdadm.templates:7001 -msgid "An error occurred: array not listed in mdadm.conf file" -msgstr "Gặp lá»—i: mảng không được liệt kê trong táºp tin cấu hình « mdadm.conf »" - -#. Type: boolean -#. Description -#: ../mdadm.templates:8001 -msgid "Start arrays not listed in mdadm.conf?" -msgstr "" -"Khởi chạy các mảng không được liệt kê trong táºp tin cấu hình « mdadm.conf » " -"không?" - -#. Type: boolean -#. Description -#: ../mdadm.templates:8001 -msgid "" -"The specified array (${array}) is not listed in the configuration file " -"(${config}). Therefore, it cannot be started during boot, unless you correct " -"the configuration file and recreate the initial ramdisk." -msgstr "" -"Mảng bạn đã xác định (${array}) không được liệt kê trong táºp tin cấu hình " -"${config}. Vì váºy nó không thể được khởi chạy trong khi khởi Ä‘á»™ng, nếu bạn " -"không sá»a táºp tin cấu hình và tạo lại Ä‘Ä©a RAM đầu tiên." - -#. Type: boolean -#. Description -#: ../mdadm.templates:8001 -msgid "" -"This warning is only relevant if you need arrays to be started from the " -"initial ramdisk to be able to boot. If you use kernel autostarting, or do " -"not need any arrays to be started as early as the initial ramdisk is loaded, " -"you can simply continue. Alternatively, choose not to continue and enter " -"'none' when prompted which arrays to start from the initial ramdisk." -msgstr "" -"Cảnh báo nà y chỉ là thÃch hợp nếu bạn cần thiết mảng được khởi chạy từ Ä‘Ä©a " -"RAM đầu tiên, để có thể khởi Ä‘á»™ng được. Nếu bạn sá» dụng khả năng tá»± Ä‘á»™ng " -"khởi chạy hạt nhân (kernel autostart), hoặc không cần mảng nà o được khởi " -"chạy má»™t khi nạp Ä‘Ä©a RAM đầu tiên, bạn Ä‘Æ¡n giản có thể tiếp tục lại. Hoặc " -"chá»n không tiếp tục, và nháºp « none » (không có) khi được nhắc nháºp những " -"mảng nà o cần khởi chạy từ Ä‘Ä©a RAM đầu tiên." - #. Type: boolean #. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "Should mdadm run monthly redundancy checks of the MD arrays?" msgstr "" "mdadm có nên chạy việc kiểm tra thừa hà ng tháng trên những mảng MD không?" #. Type: boolean #. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "" "If the kernel supports it (versions greater than 2.6.14), mdadm can " "periodically check the redundancy of MD arrays (RAIDs). This may be a " @@ -168,7 +44,7 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:10001 +#: ../mdadm.templates:2001 msgid "" "The default, if turned on, is to check on the first Sunday of every month at " "01:06." @@ -178,13 +54,13 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "Do you want to start the MD monitoring daemon?" msgstr "Bạn có muốn khởi chạy trình ná»n theo dõi MD không?" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "" "The MD (RAID) monitor daemon sends email notifications in response to " "important MD events (such as a disk failure)." @@ -194,22 +70,110 @@ msgstr "" #. Type: boolean #. Description -#: ../mdadm.templates:11001 +#: ../mdadm.templates:3001 msgid "Enabling this option is recommended." msgstr "Khuyên bạn hiệu lá»±c tùy chá»n nà y." #. Type: string #. Description -#: ../mdadm.templates:12001 +#: ../mdadm.templates:4001 msgid "Recipient for email notifications:" msgstr "NgÆ°á»i nháºn thÆ° thông báo :" #. Type: string #. Description -#: ../mdadm.templates:12001 +#: ../mdadm.templates:4001 msgid "" "Please enter the email address of the user who should get the email " "notifications for important MD events." msgstr "" "Hãy nháºp địa chỉ thÆ° của ngÆ°á»i dùng nên nháºn thÆ° thông báo vá» dữ kiện MD " "quan trá»ng." + +#~ msgid "MD arrays needed for the root file system:" +#~ msgstr "Các mảng MD cần thiết cho hệ thống táºp tin gốc:" + +#~ msgid "" +#~ "Please enter 'all', 'none', or a space-separated list of devices such as " +#~ "'md0 md1' or 'md/1 md/d0' (the leading '/dev/' can be omitted)." +#~ msgstr "" +#~ "Hãy nháºp « all » (tất cả), « none » (không có), hoặc má»™t danh sách các " +#~ "thiết bị định giá»›i bằng dấu cách nhÆ° « md0 md1 » hoặc « md/1 md/d0 » (có " +#~ "thể bá» sót phần « /dev/ » Ä‘i trÆ°á»›c)." + +#~ msgid "for internal use - only the long description is needed." +#~ msgstr "để sá» dụng ná»™i bá»™ — chỉ cần thiết mô tả dà i." + +#~ msgid "" +#~ "If the system's root file system is located on an MD array (RAID), it " +#~ "needs to be started early during the boot sequence. If it is located on a " +#~ "logical volume (LVM), which is on MD, all constituent arrays need to be " +#~ "started." +#~ msgstr "" +#~ "Nếu hệ thống táºp tin gốc của hệ thống nằm trên má»™t mảng MD (RAID) thì cần " +#~ "phải khởi chạy nó sá»›m trong tiến trình khởi Ä‘á»™ng. Nếu nó nằm trên má»™t " +#~ "khối tin hợp lý (LVM) mà lần lượt nằm trên má»™t MD thì cần phải khởi chạy " +#~ "tất cả các mảng thà nh phần." + +#~ msgid "" +#~ "If you know exactly which arrays are needed to bring up the root file " +#~ "system, and you want to postpone starting all other arrays to a later " +#~ "point in the boot sequence, enter the arrays to start here. " +#~ "Alternatively, enter 'all' to simply start all available arrays." +#~ msgstr "" +#~ "Nếu bạn biết chÃnh xác những mảng nà o cần thiết để kÃch hoạt hệ thống táºp " +#~ "tin gốc, và bạn muốn hoãn việc khởi chạy các mảng khác tá»›i má»™t Ä‘iểm sau " +#~ "trong dãy khởi Ä‘á»™ng, hãy nháºp và o đây các mảng cần khởi chạy. Hoặc nháºp « " +#~ "all » (tất cả) để khởi chạy Ä‘Æ¡n giản tất cả các mảng sẵn sà ng. " + +#~ msgid "" +#~ "If you do not need or want to start any arrays for the root file system, " +#~ "leave the answer blank (or enter 'none'). This may be the case if you are " +#~ "using kernel autostart or do not need any arrays to boot." +#~ msgstr "" +#~ "Nếu bạn không cần hoặc muốn khởi chạy mảng nà o cho hệ thống táºp tin gốc, " +#~ "hãy bá» trống câu trả lá»i nà y (hoặc nháºp « none » [không có]). TrÆ°á»ng hợp " +#~ "nà y có thể xảy ra nếu bạn sá» dụng khả năng tá»± Ä‘á»™ng khởi Ä‘á»™ng hạt nhân " +#~ "(kernel autostart), hoặc không cần mảng nà o để khởi Ä‘á»™ng máy tÃnh." + +#~ msgid "An error occurred: device node does not exist" +#~ msgstr "Gặp lá»—i: nút thiết bị không tồn tại" + +#~ msgid "An error occurred: not a block device" +#~ msgstr "Gặp lá»—i: không phải là má»™t thiết bị khối" + +#~ msgid "An error occurred: not an MD array" +#~ msgstr "Gặp lá»—i: không phải là má»™t mảng MD" + +#~ msgid "An error occurred: array not listed in mdadm.conf file" +#~ msgstr "" +#~ "Gặp lá»—i: mảng không được liệt kê trong táºp tin cấu hình « mdadm.conf »" + +#~ msgid "Start arrays not listed in mdadm.conf?" +#~ msgstr "" +#~ "Khởi chạy các mảng không được liệt kê trong táºp tin cấu hình « mdadm.conf " +#~ "» không?" + +#~ msgid "" +#~ "The specified array (${array}) is not listed in the configuration file " +#~ "(${config}). Therefore, it cannot be started during boot, unless you " +#~ "correct the configuration file and recreate the initial ramdisk." +#~ msgstr "" +#~ "Mảng bạn đã xác định (${array}) không được liệt kê trong táºp tin cấu hình " +#~ "${config}. Vì váºy nó không thể được khởi chạy trong khi khởi Ä‘á»™ng, nếu " +#~ "bạn không sá»a táºp tin cấu hình và tạo lại Ä‘Ä©a RAM đầu tiên." + +#~ msgid "" +#~ "This warning is only relevant if you need arrays to be started from the " +#~ "initial ramdisk to be able to boot. If you use kernel autostarting, or do " +#~ "not need any arrays to be started as early as the initial ramdisk is " +#~ "loaded, you can simply continue. Alternatively, choose not to continue " +#~ "and enter 'none' when prompted which arrays to start from the initial " +#~ "ramdisk." +#~ msgstr "" +#~ "Cảnh báo nà y chỉ là thÃch hợp nếu bạn cần thiết mảng được khởi chạy từ " +#~ "Ä‘Ä©a RAM đầu tiên, để có thể khởi Ä‘á»™ng được. Nếu bạn sá» dụng khả năng tá»± " +#~ "Ä‘á»™ng khởi chạy hạt nhân (kernel autostart), hoặc không cần mảng nà o được " +#~ "khởi chạy má»™t khi nạp Ä‘Ä©a RAM đầu tiên, bạn Ä‘Æ¡n giản có thể tiếp tục lại. " +#~ "Hoặc chá»n không tiếp tục, và nháºp « none » (không có) khi được nhắc nháºp " +#~ "những mảng nà o cần khởi chạy từ Ä‘Ä©a RAM đầu tiên." diff --git a/debian/rules b/debian/rules index 7b21d228..3a1b5a6f 100755 --- a/debian/rules +++ b/debian/rules @@ -6,6 +6,7 @@ #export DH_VERBOSE=1 +export CROSS_COMPILE=$(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)- LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS) CXFLAGS = $(shell dpkg-buildflags --get CFLAGS) \ $(shell dpkg-buildflags --get CPPFLAGS) @@ -45,7 +46,7 @@ clean: install-arch: build-arch dh_testdir - dh_clean -k + dh_prep dh_installdirs $(MAKE) install install-systemd DESTDIR=$(DESTDIR) @@ -53,8 +54,10 @@ install-arch: build-arch mkdir -p $(DESTDIR)/etc/mdadm install -Dm0755 debian/initramfs/hook \ $(DESTDIR)/usr/share/initramfs-tools/hooks/mdadm - install -Dm0755 debian/initramfs/script.local-top \ - $(DESTDIR)/usr/share/initramfs-tools/scripts/local-top/mdadm + install -Dm0755 debian/initramfs/script.local-block \ + $(DESTDIR)/usr/share/initramfs-tools/scripts/local-block/mdadm + install -Dm0755 debian/initramfs/script.local-bottom \ + $(DESTDIR)/usr/share/initramfs-tools/scripts/local-bottom/mdadm install -Dm0644 debian/mdadm.modules \ $(DESTDIR)/etc/modprobe.d/mdadm.conf @@ -73,7 +76,6 @@ binary-arch: install-arch dh_installdebconf dh_installdocs dh_installexamples -pmdadm mdadm.conf-example misc/syslog-events - dh_installinit --init-script=mdadm-raid --no-restart-on-upgrade -- start 25 S . start 60 0 6 . dh_installinit --init-script=mdadm-waitidle --no-start -- stop 98 0 6 . dh_link -pmdadm /dev/null /lib/systemd/system/mdadm-waitidle.service dh_installinit -- defaults 25 diff --git a/external-reshape-design.txt b/external-reshape-design.txt index 4eb04a2f..10c57ccb 100644 --- a/external-reshape-design.txt +++ b/external-reshape-design.txt @@ -166,7 +166,7 @@ sync_action monitor. 8/ mdadm::Grow_reshape() calls ->manage_reshape to oversee the rest of the reshape. - + 9/ mdadm::<format>->manage_reshape(): saves data that will be overwritten by the kernel to either the backup file or the metadata specific location, advances sync_max, waits for reshape, ping mdmon, repeat. @@ -194,7 +194,7 @@ sync_action kernel-managed-metadata this protection is provided by ->reshape_safe, but that does not protect us in the case of user-space-managed-metadata. - + 10/ mdadm::<format>->manage_reshape(): Once reshape completes changes the raid level back to the nominal raid level (if necessary) @@ -272,9 +272,9 @@ sync_action ->set_array_state to record the the reshape is complete. For container-wide reshape, this happens once for each member array. - - - + + + ... [1]: Linux kernel design patterns - part 3, Neil Brown http://lwn.net/Articles/336262/ @@ -20,6 +20,9 @@ ANNOUNCE-3.2.6 ANNOUNCE-3.3 ANNOUNCE-3.3.1 ANNOUNCE-3.3.2 +ANNOUNCE-3.3.3 +ANNOUNCE-3.3.4 +ANNOUNCE-3.4 Assemble.c Build.c COPYING @@ -44,6 +47,7 @@ bitmap.h config.c crc32.c crc32.h +crc32c.c dlink.c dlink.h external-reshape-design.txt @@ -234,8 +238,10 @@ tests/18imsm-r0_2d-takeover-r10_4d tests/18imsm-r10_4d-takeover-r0_2d tests/18imsm-r1_2d-takeover-r0_1d tests/19raid6auto-repair +tests/19raid6check tests/19raid6repair tests/19repair-does-not-destroy +tests/20raid5journal tests/ToTest tests/check tests/env-ddf-template diff --git a/managemon.c b/managemon.c index 1c9eccc4..6d1b3d85 100644 --- a/managemon.c +++ b/managemon.c @@ -134,7 +134,7 @@ static void free_aa(struct active_array *aa) /* Note that this doesn't close fds if they are being used * by a clone. ->container will be set for a clone */ - dprintf("%s: sys_name: %s\n", __func__, aa->info.sys_name); + dprintf("sys_name: %s\n", aa->info.sys_name); if (!aa->container) close_aa(aa); while (aa->info.devs) { @@ -273,8 +273,7 @@ static void add_disk_to_container(struct supertype *st, struct mdinfo *sd) .state = 0, }; - dprintf("%s: add %d:%d to container\n", - __func__, sd->disk.major, sd->disk.minor); + dprintf("add %d:%d to container\n", sd->disk.major, sd->disk.minor); sd->next = st->devs; st->devs = sd; @@ -325,8 +324,8 @@ static void remove_disk_from_container(struct supertype *st, struct mdinfo *sd) .raid_disk = -1, .state = 0, }; - dprintf("%s: remove %d:%d from container\n", - __func__, sd->disk.major, sd->disk.minor); + dprintf("remove %d:%d from container\n", + sd->disk.major, sd->disk.minor); st->update_tail = &update; st->ss->remove_from_super(st, &dk); @@ -402,6 +401,22 @@ static void manage_container(struct mdstat_ent *mdstat, } } +static int sysfs_open2(char *devnum, char *name, char *attr) +{ + int fd = sysfs_open(devnum, name, attr); + if (fd >= 0) { + /* seq_file in the kernel allocates buffer space + * on the first read. Do that now so 'monitor' + * never needs too. + */ + char buf[200]; + if (read(fd, buf, sizeof(buf)) < 0) + /* pretend not to ignore return value */ + return fd; + } + return fd; +} + static int disk_init_and_add(struct mdinfo *disk, struct mdinfo *clone, struct active_array *aa) { @@ -409,10 +424,11 @@ static int disk_init_and_add(struct mdinfo *disk, struct mdinfo *clone, return -1; *disk = *clone; - disk->recovery_fd = sysfs_open(aa->info.sys_name, disk->sys_name, "recovery_start"); + disk->recovery_fd = sysfs_open2(aa->info.sys_name, disk->sys_name, + "recovery_start"); if (disk->recovery_fd < 0) return -1; - disk->state_fd = sysfs_open(aa->info.sys_name, disk->sys_name, "state"); + disk->state_fd = sysfs_open2(aa->info.sys_name, disk->sys_name, "state"); if (disk->state_fd < 0) { close(disk->recovery_fd); return -1; @@ -525,7 +541,7 @@ static void manage_member(struct mdstat_ent *mdstat, /* prevent the kernel from activating the disk(s) before we * finish adding them */ - dprintf("%s: freezing %s\n", __func__, a->info.sys_name); + dprintf("freezing %s\n", a->info.sys_name); sysfs_set_str(&a->info, NULL, "sync_action", "frozen"); /* Add device to array and set offset/size/slot. @@ -550,8 +566,7 @@ static void manage_member(struct mdstat_ent *mdstat, if (sysfs_set_str(&a->info, NULL, "sync_action", "recover") == 0) newa->prev_action = recover; - dprintf("%s: recovery started on %s\n", __func__, - a->info.sys_name); + dprintf("recovery started on %s\n", a->info.sys_name); out: while (newdev) { d = newdev->next; @@ -692,12 +707,13 @@ static void manage_new(struct mdstat_ent *mdstat, } } - new->action_fd = sysfs_open(new->info.sys_name, NULL, "sync_action"); - new->info.state_fd = sysfs_open(new->info.sys_name, NULL, "array_state"); - new->resync_start_fd = sysfs_open(new->info.sys_name, NULL, "resync_start"); - new->metadata_fd = sysfs_open(new->info.sys_name, NULL, "metadata_version"); - new->sync_completed_fd = sysfs_open(new->info.sys_name, NULL, "sync_completed"); - dprintf("%s: inst: %s action: %d state: %d\n", __func__, inst, + new->action_fd = sysfs_open2(new->info.sys_name, NULL, "sync_action"); + new->info.state_fd = sysfs_open2(new->info.sys_name, NULL, "array_state"); + new->resync_start_fd = sysfs_open2(new->info.sys_name, NULL, "resync_start"); + new->metadata_fd = sysfs_open2(new->info.sys_name, NULL, "metadata_version"); + new->sync_completed_fd = sysfs_open2(new->info.sys_name, NULL, "sync_completed"); + + dprintf("inst: %s action: %d state: %d\n", inst, new->action_fd, new->info.state_fd); if (sigterm) @@ -176,7 +176,7 @@ void map_read(struct map_ent **melp) { FILE *f; char buf[8192]; - char path[200]; + char path[201]; int uuid[4]; char devnm[32]; char metadata[30]; @@ -455,12 +455,19 @@ void RebuildMap(void) sep = ""; } } - if (strchr(name, ':')) - /* probably a uniquifying + if (strchr(name, ':')) { + /* Probably a uniquifying * hostname prefix. Allow - * without a suffix + * without a suffix, and strip + * hostname if it is us. */ + if (homehost && unum == -1 && + strncmp(name, homehost, + strlen(homehost)) == 0 && + name[strlen(homehost)] == ':') + name += strlen(homehost)+1; unum = -1; + } while (conflict) { if (unum >= 0) @@ -40,7 +40,7 @@ MULTIPATH (a set of different interfaces to the same device), and FAULTY (a layer over a single device into which errors can be injected). .SS MD METADATA -Each device in an array may have some +Each device in an array may have some .I metadata stored in the device. This metadata is sometimes called a .BR superblock . @@ -176,7 +176,7 @@ device is rounded down to a multiple of this chunksize. A RAID0 array (which has zero redundancy) is also known as a striped array. A RAID0 array is configured at creation with a -.B "Chunk Size" +.B "Chunk Size" which must be a power of two (prior to Linux 2.6.31), and at least 4 kibibytes. @@ -874,6 +874,26 @@ The list is particularly useful when recovering to a spare. If a few blocks cannot be read from the other devices, the bulk of the recovery can complete and those few bad blocks will be recorded in the bad block list. +.SS RAID456 WRITE JOURNAL + +Due to non-atomicity nature of RAID write operations, interruption of +write operations (system crash, etc.) to RAID456 array can lead to +inconsistent parity and data loss (so called RAID-5 write hole). + +To plug the write hole, from Linux 4.4 (to be confirmed), +.I md +supports write ahead journal for RAID456. When the array is created, +an additional journal device can be added to the array through +.IR write-journal +option. The RAID write journal works similar to file system journals. +Before writing to the data disks, md persists data AND parity of the +stripe to the journal device. After crashes, md searches the journal +device for incomplete write operations, and replay them to the data +disks. + +When the journal device fails, the RAID array is forced to run in +read-only mode. + .SS WRITE-BEHIND From Linux 2.6.14, @@ -1024,7 +1044,7 @@ number of times MD will service a full-stripe-write before servicing a stripe that requires some "prereading". For fairness this defaults to 1. Valid values are 0 to stripe_cache_size. Setting this to 0 maximizes sequential-write throughput at the cost of fairness to threads -doing small or random writes. +doing small or random writes. .SS KERNEL PARAMETERS @@ -78,6 +78,12 @@ #define MD_DISK_ACTIVE 1 /* disk is running but may not be in sync */ #define MD_DISK_SYNC 2 /* disk is in sync with the raid set */ #define MD_DISK_REMOVED 3 /* disk is in sync with the raid set */ +#define MD_DISK_CLUSTER_ADD 4 /* Initiate a disk add across the cluster + * For clustered enviroments only. + */ +#define MD_DISK_CANDIDATE 5 /* disk is added as spare (local) until confirmed + * For clustered enviroments only. + */ #define MD_DISK_WRITEMOSTLY 9 /* disk is "write-mostly" is RAID1 config. * read requests will only be sent here in @@ -85,6 +91,12 @@ */ #define MD_DISK_REPLACEMENT 17 +#define MD_DISK_JOURNAL 18 /* disk is used as the write journal in RAID-5/6 */ + +#define MD_DISK_ROLE_SPARE 0xffff +#define MD_DISK_ROLE_FAULTY 0xfffe +#define MD_DISK_ROLE_JOURNAL 0xfffd +#define MD_DISK_ROLE_MAX 0xff00 /* max value of regular disk role */ typedef struct mdp_device_descriptor_s { __u32 number; /* 0 Device number in the entire set */ @@ -106,6 +118,7 @@ typedef struct mdp_device_descriptor_s { #define MD_SB_BLOCK_CONTAINER_RESHAPE 3 /* block container wide reshapes */ #define MD_SB_BLOCK_VOLUME 4 /* block activation of array, other arrays * in container can be activated */ +#define MD_SB_CLUSTERED 5 /* MD is clustered */ #define MD_SB_BITMAP_PRESENT 8 /* bitmap may be present nearby */ typedef struct mdp_superblock_s { @@ -195,4 +208,62 @@ static inline __u64 md_event(mdp_super_t *sb) { return (ev<<32)| sb->events_lo; } +struct r5l_payload_header { + __u16 type; + __u16 flags; +} __attribute__ ((__packed__)); + +enum r5l_payload_type { + R5LOG_PAYLOAD_DATA = 0, + R5LOG_PAYLOAD_PARITY = 1, + R5LOG_PAYLOAD_FLUSH = 2, +}; + +struct r5l_payload_data_parity { + struct r5l_payload_header header; + __u32 size; /* sector. data/parity size. each 4k has a checksum */ + __u64 location; /* sector. For data, it's raid sector. For + parity, it's stripe sector */ + __u32 checksum[]; +} __attribute__ ((__packed__)); + +enum r5l_payload_data_parity_flag { + R5LOG_PAYLOAD_FLAG_DISCARD = 1, /* payload is discard */ + /* + * RESHAPED/RESHAPING is only set when there is reshape activity. Note, + * both data/parity of a stripe should have the same flag set + * + * RESHAPED: reshape is running, and this stripe finished reshape + * RESHAPING: reshape is running, and this stripe isn't reshaped + * */ + R5LOG_PAYLOAD_FLAG_RESHAPED = 2, + R5LOG_PAYLOAD_FLAG_RESHAPING = 3, +}; + +struct r5l_payload_flush { + struct r5l_payload_header header; + __u32 size; /* flush_stripes size, bytes */ + __u64 flush_stripes[]; +} __attribute__ ((__packed__)); + +enum r5l_payload_flush_flag { + R5LOG_PAYLOAD_FLAG_FLUSH_STRIPE = 1, /* data represents whole stripe */ +}; + +struct r5l_meta_block { + __u32 magic; + __u32 checksum; + __u8 version; + __u8 __zero_pading_1; + __u16 __zero_pading_2; + __u32 meta_size; /* whole size of the block */ + + __u64 seq; + __u64 position; /* sector, start from rdev->data_offset, current position */ + struct r5l_payload_header payloads[]; +} __attribute__ ((__packed__)); + +#define R5LOG_VERSION 0x1 +#define R5LOG_MAGIC 0x6433c509 + #endif @@ -44,6 +44,7 @@ #define STOP_ARRAY _IO (MD_MAJOR, 0x32) #define STOP_ARRAY_RO _IO (MD_MAJOR, 0x33) #define RESTART_ARRAY_RW _IO (MD_MAJOR, 0x34) +#define CLUSTERED_DISK_NACK _IO (MD_MAJOR, 0x35) typedef struct mdu_version_s { int major; @@ -58,7 +59,7 @@ typedef struct mdu_array_info_s { int major_version; int minor_version; int patch_version; - int ctime; + unsigned int ctime; int level; int size; int nr_disks; @@ -69,7 +70,7 @@ typedef struct mdu_array_info_s { /* * Generic state information */ - int utime; /* 0 Superblock update time */ + unsigned int utime; /* 0 Superblock update time */ int state; /* 1 State bits (clean, ...) */ int active_disks; /* 2 Number of currently active disks */ int working_disks; /* 3 Number of working disks */ @@ -5,7 +5,7 @@ .\" the Free Software Foundation; either version 2 of the License, or .\" (at your option) any later version. .\" See file COPYING in distribution for details. -.TH MDADM 8 "" v3.3.2 +.TH MDADM 8 "" v3.4 .SH NAME mdadm \- manage MD devices .I aka @@ -214,7 +214,7 @@ to detect and assemble arrays \(em possibly in an .P If a device is given before any options, or if the first option is -and of +one of .BR \-\-add , .BR \-\-re\-add , .BR \-\-add\-spare , @@ -267,13 +267,13 @@ the exact meaning of this option in different contexts. .TP .BR \-c ", " \-\-config= Specify the config file or directory. Default is to use -.B /etc/mdadm.conf +.B /etc/mdadm/mdadm.conf and -.BR /etc/mdadm.conf.d , +.BR /etc/mdadm/mdadm.conf.d , or if those are missing then -.B /etc/mdadm/mdadm.conf +.B /etc/mdadm.conf and -.BR /etc/mdadm/mdadm.conf.d . +.BR /etc/mdadm.conf.d . If the config file given is .B "partitions" then nothing will be read, but @@ -393,6 +393,13 @@ will be allowed to use 'local' names (i.e. not ending in '_' followed by a digit string). See below under .BR "Auto Assembly" . +The special name "\fBany\fP" can be used as a wild card. If an array +is created with +.B --homehost=any +then the name "\fBany\fP" will be stored in the array and it can be +assembled in the same way on any host. If an array is assembled with +this option, then the homehost recorded on the array will be ignored. + .TP .B \-\-prefer= When @@ -415,6 +422,12 @@ This functionality is currently only provided by and .BR \-\-monitor . +.TP +.B \-\-home\-cluster= +specifies the cluster name for the md device. The md device can be assembled +only on the cluster which matches the name specified. If this option is not +provided, mdadm tries to detect the cluster name automatically. + .SH For create, build, or grow: .TP @@ -694,7 +707,12 @@ and so is replicated on all devices. If the word .B "none" is given with .B \-\-grow -mode, then any bitmap that is present is removed. +mode, then any bitmap that is present is removed. If the word +.B "clustered" +is given, the array is created for a clustered environment. One bitmap +is created for each node as defined by the +.B \-\-nodes +parameter and are stored internally. To help catch typing errors, the filename must contain at least one slash ('/') if it is a real file (not 'internal' or 'none'). @@ -966,6 +984,18 @@ However for RAID0, it is not possible to add spares. So to increase the number of devices in a RAID0, it is necessary to set the new number of devices, and to add the new devices, in the same command. +.TP +.BR \-\-nodes +Only works when the array is for clustered environment. It specifies +the maximum number of nodes in the cluster that will use this device +simultaneously. If not specified, this defaults to 4. + +.TP +.BR \-\-write-journal +Specify journal device for the RAID-4/5/6 array. The journal device +should be a SSD with reasonable lifetime. + + .SH For assemble: .TP @@ -1080,7 +1110,9 @@ argument given to this flag can be one of .BR summaries , .BR uuid , .BR name , +.BR nodes , .BR homehost , +.BR home-cluster , .BR resync , .BR byteorder , .BR devicesize , @@ -1135,6 +1167,13 @@ of the array as stored in the superblock. This is only supported for version-1 superblocks. The +.B nodes +option will change the +.I nodes +of the array as stored in the bitmap superblock. This option only +works for a clustered environment. + +The .B homehost option will change the .I homehost @@ -1143,6 +1182,11 @@ same as updating the UUID. For version-1 superblocks, this involves updating the name. The +.B home\-cluster +option will change the cluster name as recorded in the superblock and +bitmap. This option only works for clustered environment. + +The .B resync option will cause the array to be marked .I dirty @@ -1389,6 +1433,15 @@ will avoid reading from these devices if possible. .BR \-\-readwrite Subsequent devices that are added or re\-added will have the 'write-mostly' flag cleared. +.TP +.BR \-\-cluster\-confirm +Confirm the existence of the device. This is issued in response to an \-\-add +request by a node in a cluster. When a node adds a device it sends a message +to all nodes in the cluster to look for a device with a UUID. This translates +to a udev notification with the UUID of the device to be added and the slot +number. The receiving node must acknowledge this message +with \-\-cluster\-confirm. Valid arguments are <slot>:<devicename> in case +the device is found or <slot>:missing in case the device is not found. .P Each of these options requires that the first device listed is the array @@ -1796,9 +1849,9 @@ The config file is only used if explicitly named with or requested with (a possibly implicit) .BR \-\-scan . In the later case, -.B /etc/mdadm.conf -or .B /etc/mdadm/mdadm.conf +or +.B /etc/mdadm.conf is used. If @@ -2196,11 +2249,11 @@ option. Currently only .B name is supported. -The +The .B name option updates the subarray name in the metadata, it may not affect the device node name or the device node symlink until the subarray is -re\-assembled. If updating +re\-assembled. If updating .B name would change the UUID of an active subarray this operation is blocked, and the command will end in an error. @@ -3092,7 +3145,7 @@ uses this to find arrays when is given in Misc mode, and to monitor array reconstruction on Monitor mode. -.SS /etc/mdadm.conf +.SS /etc/mdadm/mdadm.conf (or /etc/mdadm.conf) The config file lists which devices may be scanned to see if they contain MD super block, and gives identifying information @@ -3100,7 +3153,7 @@ they contain MD super block, and gives identifying information .BR mdadm.conf (5) for more details. -.SS /etc/mdadm.conf.d +.SS /etc/mdadm/mdadm.conf.d (or /etc/mdadm.conf.d) A directory containing configuration files which are read in lexical order. @@ -38,6 +38,7 @@ static int misc_list(struct mddev_dev *devlist, struct mddev_ident *ident, char *dump_directory, struct supertype *ss, struct context *c); +const char Name[] = "mdadm"; int main(int argc, char *argv[]) { @@ -73,6 +74,7 @@ int main(int argc, char *argv[]) .require_homehost = 1, }; struct shape s = { + .journaldisks = 0, .level = UnSet, .layout = UnSet, .bitmap_chunk = UnSet, @@ -188,6 +190,7 @@ int main(int argc, char *argv[]) case 'a': case Add: case AddSpare: + case AddJournal: case 'r': case Remove: case Replace: @@ -195,6 +198,7 @@ int main(int argc, char *argv[]) case 'f': case Fail: case ReAdd: /* re-add */ + case ClusterConfirm: if (!mode) { newmode = MANAGE; shortopt = short_bitmap_options; @@ -336,13 +340,11 @@ int main(int argc, char *argv[]) } if (devs_found > 0 && mode == MANAGE && !devmode) { - pr_err("Must give one of -a/-r/-f" - " for subsequent devices at %s\n", optarg); + pr_err("Must give one of -a/-r/-f for subsequent devices at %s\n", optarg); exit(2); } if (devs_found > 0 && mode == GROW && !devmode) { - pr_err("Must give -a/--add for" - " devices to add: %s\n", optarg); + pr_err("Must give -a/--add for devices to add: %s\n", optarg); exit(2); } dv = xmalloc(sizeof(*dv)); @@ -369,8 +371,7 @@ int main(int argc, char *argv[]) case O(BUILD,'c'): /* chunk or rounding */ case O(BUILD,ChunkSize): /* chunk or rounding */ if (s.chunk) { - pr_err("chunk/rounding may only be specified once. " - "Second value is %s.\n", optarg); + pr_err("chunk/rounding may only be specified once. Second value is %s.\n", optarg); exit(2); } s.chunk = parse_size(optarg); @@ -420,8 +421,7 @@ int main(int argc, char *argv[]) case O(CREATE,'z'): case O(BUILD,'z'): /* size */ if (s.size > 0) { - pr_err("size may only be specified once. " - "Second value is %s.\n", optarg); + pr_err("size may only be specified once. Second value is %s.\n", optarg); exit(2); } if (strcmp(optarg, "max")==0) @@ -441,8 +441,7 @@ int main(int argc, char *argv[]) case O(GROW,'Z'): /* array size */ if (array_size > 0) { - pr_err("array-size may only be specified once. " - "Second value is %s.\n", optarg); + pr_err("array-size may only be specified once. Second value is %s.\n", optarg); exit(2); } if (strcmp(optarg, "max") == 0) @@ -461,8 +460,7 @@ int main(int argc, char *argv[]) case O(CREATE,DataOffset): case O(GROW,DataOffset): if (data_offset != INVALID_SECTORS) { - pr_err("data-offset may only be specified one. " - "Second value is %s.\n", optarg); + pr_err("data-offset may only be specified one. Second value is %s.\n", optarg); exit(2); } if (mode == CREATE && @@ -481,8 +479,7 @@ int main(int argc, char *argv[]) case O(CREATE,'l'): case O(BUILD,'l'): /* set raid level*/ if (s.level != UnSet) { - pr_err("raid level may only be set once. " - "Second value is %s.\n", optarg); + pr_err("raid level may only be set once. Second value is %s.\n", optarg); exit(2); } s.level = map_name(pers, optarg); @@ -510,8 +507,7 @@ int main(int argc, char *argv[]) case O(GROW, 'p'): /* new layout */ case O(GROW, Layout): if (s.layout_str) { - pr_err("layout may only be sent once. " - "Second value was %s\n", optarg); + pr_err("layout may only be sent once. Second value was %s\n", optarg); exit(2); } s.layout_str = optarg; @@ -523,8 +519,7 @@ int main(int argc, char *argv[]) case O(BUILD,'p'): /* faulty layout */ case O(BUILD,Layout): if (s.layout != UnSet) { - pr_err("layout may only be sent once. " - "Second value was %s\n", optarg); + pr_err("layout may only be sent once. Second value was %s\n", optarg); exit(2); } switch(s.level) { @@ -596,7 +591,23 @@ int main(int argc, char *argv[]) } ident.raid_disks = s.raiddisks; continue; - + case O(ASSEMBLE, Nodes): + case O(CREATE, Nodes): + c.nodes = parse_num(optarg); + if (c.nodes <= 0) { + pr_err("invalid number for the number of cluster nodes: %s\n", + optarg); + exit(2); + } + continue; + case O(CREATE, ClusterName): + case O(ASSEMBLE, ClusterName): + c.homecluster = optarg; + if (strlen(c.homecluster) > 64) { + pr_err("Cluster name too big.\n"); + exit(ERANGE); + } + continue; case O(CREATE,'x'): /* number of spare (eXtra) disks */ if (s.sparedisks) { pr_err("spare-devices set twice: %d and %s\n", @@ -655,8 +666,7 @@ int main(int argc, char *argv[]) case O(CREATE,'u'): /* uuid of array */ case O(ASSEMBLE,'u'): /* uuid of array */ if (ident.uuid_set) { - pr_err("uuid cannot be set twice. " - "Second value %s.\n", optarg); + pr_err("uuid cannot be set twice. Second value %s.\n", optarg); exit(2); } if (parse_uuid(optarg, ident.uuid)) @@ -671,8 +681,7 @@ int main(int argc, char *argv[]) case O(ASSEMBLE,'N'): case O(MISC,'N'): if (ident.name[0]) { - pr_err("name cannot be set twice. " - "Second value %s.\n", optarg); + pr_err("name cannot be set twice. Second value %s.\n", optarg); exit(2); } if (mode == MISC && !c.subarray) { @@ -690,8 +699,7 @@ int main(int argc, char *argv[]) case O(ASSEMBLE,'m'): /* super-minor for array */ case O(ASSEMBLE,SuperMinor): if (ident.super_minor != UnSet) { - pr_err("super-minor cannot be set twice. " - "Second value: %s.\n", optarg); + pr_err("super-minor cannot be set twice. Second value: %s.\n", optarg); exit(2); } if (strcmp(optarg, "dev")==0) @@ -714,14 +722,12 @@ int main(int argc, char *argv[]) case O(ASSEMBLE,'U'): /* update the superblock */ case O(MISC,'U'): if (c.update) { - pr_err("Can only update one aspect" - " of superblock, both %s and %s given.\n", + pr_err("Can only update one aspect of superblock, both %s and %s given.\n", c.update, optarg); exit(2); } if (mode == MISC && !c.subarray) { - pr_err("Only subarrays can be" - " updated in misc mode\n"); + pr_err("Only subarrays can be updated in misc mode\n"); exit(2); } c.update = optarg; @@ -739,6 +745,10 @@ int main(int argc, char *argv[]) continue; if (strcmp(c.update, "homehost")==0) continue; + if (strcmp(c.update, "home-cluster")==0) + continue; + if (strcmp(c.update, "nodes")==0) + continue; if (strcmp(c.update, "devicesize")==0) continue; if (strcmp(c.update, "no-bitmap")==0) @@ -747,22 +757,22 @@ int main(int argc, char *argv[]) continue; if (strcmp(c.update, "no-bbl") == 0) continue; + if (strcmp(c.update, "force-no-bbl") == 0) + continue; if (strcmp(c.update, "metadata") == 0) continue; if (strcmp(c.update, "revert-reshape") == 0) continue; if (strcmp(c.update, "byteorder")==0) { if (ss) { - pr_err("must not set metadata" - " type with --update=byteorder.\n"); + pr_err("must not set metadata type with --update=byteorder.\n"); exit(2); } for(i=0; !ss && superlist[i]; i++) ss = superlist[i]->match_metadata_desc( "0.swap"); if (!ss) { - pr_err("INTERNAL ERROR" - " cannot find 0.swap\n"); + pr_err("INTERNAL ERROR cannot find 0.swap\n"); exit(2); } @@ -771,38 +781,38 @@ int main(int argc, char *argv[]) if (strcmp(c.update,"?") == 0 || strcmp(c.update, "help") == 0) { outf = stdout; - fprintf(outf, Name ": "); + fprintf(outf, "%s: ", Name); } else { outf = stderr; fprintf(outf, - Name ": '--update=%s' is invalid. ", - c.update); + "%s: '--update=%s' is invalid. ", + Name, c.update); } fprintf(outf, "Valid --update options are:\n" - " 'sparc2.2', 'super-minor', 'uuid', 'name', 'resync',\n" - " 'summaries', 'homehost', 'byteorder', 'devicesize',\n" - " 'no-bitmap', 'metadata', 'revert-reshape'\n"); + " 'sparc2.2', 'super-minor', 'uuid', 'name', 'nodes', 'resync',\n" + " 'summaries', 'homehost', 'home-cluster', 'byteorder', 'devicesize',\n" + " 'no-bitmap', 'metadata', 'revert-reshape'\n" + " 'bbl', 'no-bbl', 'force-no-bbl'\n" + ); exit(outf == stdout ? 0 : 2); case O(MANAGE,'U'): /* update=devicesize is allowed with --re-add */ if (devmode != 'A') { - pr_err("--update in Manage mode only" - " allowed with --re-add.\n"); + pr_err("--update in Manage mode only allowed with --re-add.\n"); exit(1); } if (c.update) { - pr_err("Can only update one aspect" - " of superblock, both %s and %s given.\n", + pr_err("Can only update one aspect of superblock, both %s and %s given.\n", c.update, optarg); exit(2); } c.update = optarg; if (strcmp(c.update, "devicesize") != 0 && strcmp(c.update, "bbl") != 0 && + strcmp(c.update, "force-no-bbl") != 0 && strcmp(c.update, "no-bbl") != 0) { - pr_err("only 'devicesize', 'bbl' and 'no-bbl' can be" - " updated with --re-add\n"); + pr_err("only 'devicesize', 'bbl', 'no-bbl', and 'force-no-bbl' can be updated with --re-add\n"); exit(2); } continue; @@ -824,8 +834,7 @@ int main(int argc, char *argv[]) case O(MONITOR,ConfigFile): case O(CREATE,ConfigFile): if (configfile) { - pr_err("configfile cannot be set twice. " - "Second value is %s.\n", optarg); + pr_err("configfile cannot be set twice. Second value is %s.\n", optarg); exit(2); } configfile = optarg; @@ -920,6 +929,13 @@ int main(int argc, char *argv[]) case O(MANAGE,AddSpare): /* add drive - never re-add */ devmode = 'S'; continue; + case O(MANAGE,AddJournal): /* add journal */ + if (s.journaldisks && (s.level < 4 || s.level > 6)) { + pr_err("--add-journal is only supported for RAID level 4/5/6.\n"); + exit(2); + } + devmode = 'j'; + continue; case O(MANAGE,ReAdd): devmode = 'A'; continue; @@ -936,6 +952,9 @@ int main(int argc, char *argv[]) * remove the device */ devmode = 'f'; continue; + case O(MANAGE, ClusterConfirm): + devmode = 'c'; + continue; case O(MANAGE,Replace): /* Mark these devices for replacement */ devmode = 'R'; @@ -991,8 +1010,7 @@ int main(int argc, char *argv[]) case O(MISC ,Action): if (opt == KillSubarray || opt == UpdateSubarray) { if (c.subarray) { - pr_err("subarray can only" - " be specified once\n"); + pr_err("subarray can only be specified once\n"); exit(2); } c.subarray = optarg; @@ -1039,12 +1057,10 @@ int main(int argc, char *argv[]) continue; case O(MISC, UdevRules): if (devmode && devmode != opt) { - pr_err("--udev-rules must" - " be the only option.\n"); + pr_err("--udev-rules must be the only option.\n"); } else { if (udev_filename) - pr_err("only specify one udev " - "rule filename. %s ignored.\n", + pr_err("only specify one udev rule filename. %s ignored.\n", optarg); else udev_filename = optarg; @@ -1117,6 +1133,15 @@ int main(int argc, char *argv[]) s.bitmap_file = optarg; continue; } + if (strcmp(optarg, "clustered")== 0) { + s.bitmap_file = optarg; + /* Set the default number of cluster nodes + * to 4 if not already set by user + */ + if (c.nodes < 1) + c.nodes = 4; + continue; + } /* probable typo */ pr_err("bitmap file must contain a '/', or be 'internal', or 'none'\n" " not '%s'\n", optarg); @@ -1157,6 +1182,23 @@ int main(int argc, char *argv[]) case O(INCREMENTAL, IncrementalPath): remove_path = optarg; continue; + case O(CREATE, WriteJournal): + if (s.journaldisks) { + pr_err("Please specify only one journal device for the array.\n"); + pr_err("Ignoring --write-journal %s...\n", optarg); + continue; + } + dv = xmalloc(sizeof(*dv)); + dv->devname = optarg; + dv->disposition = 'j'; /* WriteJournal */ + dv->used = 0; + dv->next = NULL; + *devlistend = dv; + devlistend = &dv->next; + devs_found++; + + s.journaldisks = 1; + continue; } /* We have now processed all the valid options. Anything else is * an error @@ -1184,6 +1226,11 @@ int main(int argc, char *argv[]) exit(0); } + if (s.journaldisks && (s.level < 4 || s.level > 6)) { + pr_err("--write-journal is only supported for RAID level 4/5/6.\n"); + exit(2); + } + if (!mode && devs_found) { mode = MISC; devmode = 'Q'; @@ -1236,15 +1283,13 @@ int main(int argc, char *argv[]) /* non-existent device is OK */ mdfd = open_mddev(devlist->devname, 0); if (mdfd == -2) { - pr_err("device %s exists but is not an " - "md array.\n", devlist->devname); + pr_err("device %s exists but is not an md array.\n", devlist->devname); exit(1); } if ((int)ident.super_minor == -2) { struct stat stb; if (mdfd < 0) { - pr_err("--super-minor=dev given, and " - "listed device %s doesn't exist.\n", + pr_err("--super-minor=dev given, and listed device %s doesn't exist.\n", devlist->devname); exit(1); } @@ -1269,7 +1314,7 @@ int main(int argc, char *argv[]) } } - if (c.homehost == NULL) + if (c.homehost == NULL && c.require_homehost) c.homehost = conf_get_homehost(&c.require_homehost); if (c.homehost == NULL || strcasecmp(c.homehost, "<system>")==0) { if (gethostname(sys_hostname, sizeof(sys_hostname)) == 0) { @@ -1282,6 +1327,20 @@ int main(int argc, char *argv[]) c.require_homehost = 0; } + rv = 0; + + set_hooks(); /* set hooks from libs */ + + if (c.homecluster == NULL && (c.nodes > 0)) { + c.homecluster = conf_get_homecluster(); + if (c.homecluster == NULL) + rv = get_cluster_name(&c.homecluster); + if (rv) { + pr_err("The md can't get cluster name\n"); + exit(1); + } + } + if (c.backup_file && data_offset != INVALID_SECTORS) { pr_err("--backup-file and --data-offset are incompatible\n"); exit(2); @@ -1301,7 +1360,6 @@ int main(int argc, char *argv[]) /* --scan implied --brief unless -vv */ c.brief = 1; - rv = 0; switch(mode) { case MANAGE: /* readonly, add/remove, readwrite, runstop */ @@ -1388,8 +1446,9 @@ int main(int argc, char *argv[]) } if (s.bitmap_file) { - if (strcmp(s.bitmap_file, "internal")==0) { - pr_err("'internal' bitmaps not supported with --build\n"); + if (strcmp(s.bitmap_file, "internal")==0 || + strcmp(s.bitmap_file, "clustered") == 0) { + pr_err("'internal' and 'clustered' bitmaps not supported with --build\n"); rv |= 1; break; } @@ -1399,6 +1458,21 @@ int main(int argc, char *argv[]) case CREATE: if (c.delay == 0) c.delay = DEFAULT_BITMAP_DELAY; + + if (c.nodes) { + if (!s.bitmap_file || strcmp(s.bitmap_file, "clustered") != 0) { + pr_err("--nodes argument only compatible with --bitmap=clustered\n"); + rv = 1; + break; + } + + if (s.level != 1) { + pr_err("--bitmap=clustered is currently supported with RAID mirror only\n"); + rv = 1; + break; + } + } + if (s.write_behind && !s.bitmap_file) { pr_err("write-behind mode requires a bitmap.\n"); rv = 1; @@ -1464,8 +1538,6 @@ int main(int argc, char *argv[]) else c.delay = 60; } - if (c.delay == 0) - c.delay = 60; rv= Monitor(devlist, mailaddr, program, &c, daemonise, oneshot, dosyslog, pidfile, increments, @@ -1482,8 +1554,7 @@ int main(int argc, char *argv[]) struct mdinfo sra; int err; if (s.raiddisks || s.level != UnSet) { - pr_err("cannot change array size in same operation " - "as changing raiddisks or level.\n" + pr_err("cannot change array size in same operation as changing raiddisks or level.\n" " Change size first, then check that data is still intact.\n"); rv = 1; break; @@ -1495,11 +1566,9 @@ int main(int argc, char *argv[]) err = sysfs_set_num(&sra, NULL, "array_size", array_size / 2); if (err < 0) { if (errno == E2BIG) - pr_err("--array-size setting" - " is too large.\n"); + pr_err("--array-size setting is too large.\n"); else - pr_err("current kernel does" - " not support setting --array-size\n"); + pr_err("current kernel does not support setting --array-size\n"); rv = 1; break; } @@ -1507,8 +1576,7 @@ int main(int argc, char *argv[]) if (devs_found > 1 && s.raiddisks == 0 && s.level == UnSet) { /* must be '-a'. */ if (s.size > 0 || s.chunk || s.layout_str != NULL || s.bitmap_file) { - pr_err("--add cannot be used with " - "other geometry changes in --grow mode\n"); + pr_err("--add cannot be used with other geometry changes in --grow mode\n"); rv = 1; break; } @@ -1521,9 +1589,7 @@ int main(int argc, char *argv[]) } else if (s.bitmap_file) { if (s.size > 0 || s.raiddisks || s.chunk || s.layout_str != NULL || devs_found > 1) { - pr_err("--bitmap changes cannot be " - "used with other geometry changes " - "in --grow mode\n"); + pr_err("--bitmap changes cannot be used with other geometry changes in --grow mode\n"); rv = 1; break; } @@ -1600,8 +1666,7 @@ static int scan_assemble(struct supertype *ss, int failures, successes; if (conf_verify_devnames(array_list)) { - pr_err("Duplicate MD device names in " - "conf file were found.\n"); + pr_err("Duplicate MD device names in conf file were found.\n"); return 1; } if (devlist == NULL) { @@ -1614,9 +1679,7 @@ static int scan_assemble(struct supertype *ss, a->autof = c->autof; } if (map_lock(&map)) - pr_err("%s: failed to get " - "exclusive lock on mapfile\n", - __func__); + pr_err("failed to get exclusive lock on mapfile\n"); do { failures = 0; successes = 0; @@ -1706,7 +1769,7 @@ static int misc_scan(char devmode, struct context *c) if (!name) { pr_err("cannot find device file for %s\n", - e->dev); + e->devnm); continue; } if (devmode == 'D') @@ -1741,7 +1804,7 @@ static int stop_scan(int verbose) if (!name) { pr_err("cannot find device file for %s\n", - e->dev); + e->devnm); continue; } mdfd = open_mddev(name, 1); diff --git a/mdadm.conf-example b/mdadm.conf-example index d9d8d396..35a75d12 100644 --- a/mdadm.conf-example +++ b/mdadm.conf-example @@ -15,9 +15,9 @@ # ARRAY lines specify information about how to identify arrays so # so that they can be activated # -# You can have more than one device line and use wild cards. The first +# You can have more than one device line and use wild cards. The first # example includes SCSI the first partition of SCSI disks /dev/sdb, -# /dev/sdc, /dev/sdd, /dev/sdj, /dev/sdk, and /dev/sdl. The second +# /dev/sdc, /dev/sdd, /dev/sdj, /dev/sdk, and /dev/sdl. The second # line looks for array slices on IDE disks. # #DEVICE /dev/sd[bcdjkl]1 diff --git a/mdadm.conf.5 b/mdadm.conf.5 index 18512cb0..542e2635 100644 --- a/mdadm.conf.5 +++ b/mdadm.conf.5 @@ -8,7 +8,7 @@ .SH NAME mdadm.conf \- configuration for management of Software RAID with mdadm .SH SYNOPSIS -/etc/mdadm.conf +/etc/mdadm/mdadm.conf .SH DESCRIPTION .PP .I mdadm @@ -35,6 +35,7 @@ extern __off64_t lseek64 __P ((int __fd, __off64_t __offset, int __whence)); #include <sys/types.h> #include <sys/stat.h> +#include <stdint.h> #include <stdlib.h> #include <time.h> #include <sys/time.h> @@ -51,6 +52,32 @@ extern __off64_t lseek64 __P ((int __fd, __off64_t __offset, int __whence)); #define srandom srand #endif +#ifdef NO_COROSYNC +#define CS_OK 1 +typedef uint64_t cmap_handle_t; +#else +#include <corosync/cmap.h> +#endif + +#ifndef NO_DLM +#include <libdlm.h> +#include <errno.h> +#else +#define LKF_NOQUEUE 0x00000001 +#define LKF_CONVERT 0x00000004 +#define LKM_PWMODE 4 +#define EUNLOCK 0x10002 + +typedef void *dlm_lshandle_t; + +struct dlm_lksb { + int sb_status; + uint32_t sb_lkid; + char sb_flags; + char *sb_lvbptr; +}; +#endif + #include <linux/kdev_t.h> /*#include <linux/fs.h> */ #include <sys/mount.h> @@ -162,6 +189,31 @@ extern __off64_t lseek64 __P ((int __fd, __off64_t __offset, int __whence)); #endif /* __KLIBC__ */ /* + * Check at compile time that something is of a particular type. + * Always evaluates to 1 so you may use it easily in comparisons. +*/ + +#define typecheck(type,x) \ +({ type __dummy; \ + typeof(x) __dummy2; \ + (void)(&__dummy == &__dummy2); \ + 1; \ +}) + +/* + * These inlines deal with timer wrapping correctly. + * + * time_after(a,b) returns true if the time a is after time b. +*/ + +#define time_after(a,b) \ + (typecheck(unsigned int, a) && \ + typecheck(unsigned int, b) && \ + ((int)((b) - (a)) < 0)) + +#define time_before(a,b) time_after(b,a) + +/* * min()/max()/clamp() macros that also do * strict type-checking.. See the * "unnecessary" pointer comparison. @@ -180,6 +232,8 @@ extern __off64_t lseek64 __P ((int __fd, __off64_t __offset, int __whence)); #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0])) +extern const char Name[]; + /* general information that might be extracted from a superblock */ struct mdinfo { mdu_array_info_t array; @@ -208,6 +262,9 @@ struct mdinfo { * for native metadata it is * reshape_active field mirror */ + int journal_device_required; + int journal_clean; + /* During reshape we can sometimes change the data_offset to avoid * over-writing still-valid data. We need to know if there is space. * So getinfo_super will fill in space_before and space_after in sectors. @@ -249,6 +306,8 @@ struct mdinfo { #define DS_UNBLOCK 2048 int prev_state, curr_state, next_state; + /* info read from sysfs */ + char sysfs_array_state[20]; }; struct createinfo { @@ -262,8 +321,6 @@ struct createinfo { struct supertype *supertype; }; -#define Name "mdadm" - enum mode { ASSEMBLE=1, BUILD, @@ -313,6 +370,7 @@ enum special_options { ManageOpt, Add, AddSpare, + AddJournal, Remove, Fail, Replace, @@ -344,6 +402,10 @@ enum special_options { Dump, Restore, Action, + Nodes, + ClusterName, + ClusterConfirm, + WriteJournal, }; enum prefix_standard { @@ -351,6 +413,12 @@ enum prefix_standard { IEC }; +enum bitmap_update { + NoUpdate, + NameUpdate, + NodeNumUpdate, +}; + /* structures read from config file */ /* List of mddevice names and identifiers * Identifiers can be: @@ -418,11 +486,14 @@ struct context { char *backup_file; int invalid_backup; char *action; + int nodes; + char *homecluster; }; struct shape { int raiddisks; int sparedisks; + int journaldisks; int level; int layout; char *layout_str; @@ -453,7 +524,6 @@ typedef struct mapping { } mapping_t; struct mdstat_ent { - char *dev; char devnm[32]; int active; char *level; @@ -491,18 +561,8 @@ extern int map_update(struct map_ent **mpp, char *devnm, char *metadata, int uuid[4], char *path); extern void map_remove(struct map_ent **map, char *devnm); extern struct map_ent *map_by_uuid(struct map_ent **map, int uuid[4]); -#ifdef MDASSEMBLE -static inline struct map_ent *map_by_devnm(struct map_ent **map, char *name) -{ - return NULL; -} -static inline void map_free(struct map_ent *map) -{ -} -#else extern struct map_ent *map_by_devnm(struct map_ent **map, char *devnm); extern void map_free(struct map_ent *map); -#endif extern struct map_ent *map_by_name(struct map_ent **map, char *name); extern void map_read(struct map_ent **melp); extern int map_write(struct map_ent *mel); @@ -532,6 +592,7 @@ enum sysfs_read_flags { GET_SIZE = (1 << 22), GET_STATE = (1 << 23), GET_ERROR = (1 << 24), + GET_ARRAY_STATE = (1 << 25), }; /* If fd >= 0, get the array it is open on, @@ -539,6 +600,7 @@ enum sysfs_read_flags { */ extern int sysfs_open(char *devnm, char *devname, char *attr); extern void sysfs_init(struct mdinfo *mdi, int fd, char *devnm); +extern void sysfs_init_dev(struct mdinfo *mdi, unsigned long devid); extern void sysfs_free(struct mdinfo *sra); extern struct mdinfo *sysfs_read(int fd, char *devnm, unsigned long options); extern int sysfs_attr_match(const char *attr, const char *str); @@ -758,7 +820,8 @@ extern struct superswitch { * readwrite - clear the WriteMostly1 bit in the superblock devflags * no-bitmap - clear any record that a bitmap is present. * bbl - add a bad-block-log if possible - * no-bbl - remove and bad-block-log is it is empty. + * no-bbl - remove any bad-block-log is it is empty. + * force-no-bbl - remove any bad-block-log even if empty. * revert-reshape - If a reshape is in progress, modify metadata so * it will resume going in the opposite direction. */ @@ -841,11 +904,11 @@ extern struct superswitch { /* Seek 'fd' to start of write-intent-bitmap. Must be an * md-native format bitmap */ - void (*locate_bitmap)(struct supertype *st, int fd); + int (*locate_bitmap)(struct supertype *st, int fd); /* if add_internal_bitmap succeeded for existing array, this * writes it out. */ - int (*write_bitmap)(struct supertype *st, int fd); + int (*write_bitmap)(struct supertype *st, int fd, enum bitmap_update update); /* Free the superblock and any other allocated data */ void (*free_super)(struct supertype *st); @@ -1029,6 +1092,8 @@ struct supertype { */ int devcnt; int retry_soon; + int nodes; + char *cluster_name; struct mdinfo *devs; @@ -1275,6 +1340,7 @@ extern int parse_uuid(char *str, int uuid[4]); extern int parse_layout_10(char *layout); extern int parse_layout_faulty(char *layout); extern long parse_num(char *num); +extern int parse_cluster_confirm_arg(char *inp, char **devname, int *slot); extern int check_ext2(int fd, char *name); extern int check_reiser(int fd, char *name); extern int check_raid(int fd, char *name); @@ -1305,6 +1371,7 @@ extern char *conf_get_mailaddr(void); extern char *conf_get_mailfrom(void); extern char *conf_get_program(void); extern char *conf_get_homehost(int *require_homehostp); +extern char *conf_get_homecluster(void); extern char *conf_line(FILE *file); extern char *conf_word(FILE *file, int allow_key); extern void print_quoted(char *str); @@ -1414,6 +1481,45 @@ extern char *fd2devnm(int fd); extern int in_initrd(void); +struct cmap_hooks { + void *cmap_handle; /* corosync lib related */ + + int (*initialize)(cmap_handle_t *handle); + int (*get_string)(cmap_handle_t handle, + const char *string, + char **name); + int (*finalize)(cmap_handle_t handle); +}; + +extern void set_cmap_hooks(void); +extern void set_hooks(void); + +struct dlm_hooks { + void *dlm_handle; /* dlm lib related */ + + dlm_lshandle_t (*create_lockspace)(const char *name, + unsigned int mode); + int (*release_lockspace)(const char *name, dlm_lshandle_t ls, + int force); + int (*ls_lock)(dlm_lshandle_t lockspace, uint32_t mode, + struct dlm_lksb *lksb, uint32_t flags, + const void *name, unsigned int namelen, + uint32_t parent, void (*astaddr) (void *astarg), + void *astarg, void (*bastaddr) (void *astarg), + void *range); + int (*ls_unlock)(dlm_lshandle_t lockspace, uint32_t lkid, + uint32_t flags, struct dlm_lksb *lksb, + void *astarg); + int (*ls_get_fd)(dlm_lshandle_t ls); + int (*dispatch)(int fd); +}; + +extern int get_cluster_name(char **name); +extern int dlm_funs_ready(void); +extern int cluster_get_dlmlock(int *lockid); +extern int cluster_release_dlmlock(int lockid); +extern void set_dlm_hooks(void); + #define _ROUND_UP(val, base) (((val) + (base) - 1) & ~(base - 1)) #define ROUND_UP(val, base) _ROUND_UP(val, (typeof(val))(base)) #define ROUND_UP_PTR(ptr, base) ((typeof(ptr)) \ @@ -1440,9 +1546,13 @@ static inline char *to_subarray(struct mdstat_ent *ent, char *container) #ifdef DEBUG #define dprintf(fmt, arg...) \ + fprintf(stderr, "%s: %s: "fmt, Name, __func__, ##arg) +#define dprintf_cont(fmt, arg...) \ fprintf(stderr, fmt, ##arg) #else #define dprintf(fmt, arg...) \ + ({ if (0) fprintf(stderr, "%s: %s: " fmt, Name, __func__, ##arg); 0; }) +#define dprintf_cont(fmt, arg...) \ ({ if (0) fprintf(stderr, fmt, ##arg); 0; }) #endif #include <assert.h> @@ -1457,7 +1567,11 @@ static inline int xasprintf(char **strp, const char *fmt, ...) { return ret; } -#define pr_err(fmt ...) fprintf(stderr, Name ": " fmt) +#ifdef DEBUG +#define pr_err(fmt, args...) fprintf(stderr, "%s: %s: "fmt, Name, __func__, ##args) +#else +#define pr_err(fmt, args...) fprintf(stderr, "%s: "fmt, Name, ##args) +#endif #define cont_err(fmt ...) fprintf(stderr, " " fmt) void *xmalloc(size_t len); @@ -1,6 +1,6 @@ Summary: mdadm is used for controlling Linux md devices (aka RAID arrays) Name: mdadm -Version: 3.3.2 +Version: 3.4 Release: 1 Source: http://www.kernel.org/pub/linux/utils/raid/mdadm/mdadm-%{version}.tar.gz URL: http://neil.brown.name/blog/mdadm diff --git a/mdassemble.8 b/mdassemble.8 index ae6f6d45..6cb005c5 100644 --- a/mdassemble.8 +++ b/mdassemble.8 @@ -1,5 +1,5 @@ .\" -*- nroff -*- -.TH MDASSEMBLE 8 "" v3.3.2 +.TH MDASSEMBLE 8 "" v3.4 .SH NAME mdassemble \- assemble MD devices .I aka @@ -40,7 +40,7 @@ There are no options to .SH FILES -.SS /etc/mdadm.conf +.SS /etc/mdadm/mdadm.conf The config file lists which devices may be scanned to see if they contain MD super block, and gives identifying information @@ -53,7 +53,7 @@ supports all configuration parameters defined in .B mdadm.conf with the exception of .B auto= -which is supported only if mdadm was built with the +which is supported only if mdadm was built with the .B \-DMDASSEMBLE_AUTO define. diff --git a/mdassemble.c b/mdassemble.c index 674be11f..78d363a3 100644 --- a/mdassemble.c +++ b/mdassemble.c @@ -26,6 +26,8 @@ #include "mdadm.h" #include "md_p.h" +char const Name[] = "mdassemble"; + #ifndef MDASSEMBLE_AUTO /* from mdopen.c */ int open_mddev(char *dev, int report_errors/*unused*/) @@ -48,18 +50,6 @@ int create_mddev(char *dev, char *name, int autof/*unused*/, int trustworthy, return open_mddev(dev, 0); } #endif -int map_update(struct map_ent **mpp, char *devnm, char *metadata, - int *uuid, char *path) -{ - return 0; -} -struct map_ent *map_by_name(struct map_ent **mpp, char *name) -{ - return NULL; -} -int map_lock(struct map_ent **melp){return 0;} -void map_unlock(struct map_ent **melp){} -struct map_ent *map_by_uuid(struct map_ent **map, int uuid[4]){return NULL;} int rv; int mdfd = -1; @@ -1,5 +1,5 @@ .\" See file COPYING in distribution for details. -.TH MDMON 8 "" v3.3.2 +.TH MDMON 8 "" v3.4 .SH NAME mdmon \- monitor MD external metadata arrays @@ -67,6 +67,8 @@ #include "mdadm.h" #include "mdmon.h" +char const Name[] = "mdmon"; + struct active_array *discard_this; struct active_array *pending_discard; @@ -233,7 +235,7 @@ static int make_control_sock(char *devname) addr.sun_family = PF_LOCAL; strcpy(addr.sun_path, path); umask(077); /* ensure no world write access */ - if (bind(sfd, &addr, sizeof(addr)) < 0) { + if (bind(sfd, (struct sockaddr*)&addr, sizeof(addr)) < 0) { close(sfd); return -1; } @@ -18,8 +18,7 @@ * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. */ -#undef pr_err -#define pr_err(fmt ...) fprintf(stderr, "mdmon: " fmt) +extern const char Name[]; enum array_state { clear, inactive, suspended, readonly, read_auto, clean, active, write_pending, active_idle, bad_word}; @@ -173,8 +173,7 @@ int create_mddev(char *dev, char *name, int autof, int trustworthy, /* name *must* be mdXX or md_dXX in this context */ if (num < 0 || (strcmp(cname, "md") != 0 && strcmp(cname, "md_d") != 0)) { - pr_err("%s is an invalid name " - "for an md device. Try /dev/md/%s\n", + pr_err("%s is an invalid name for an md device. Try /dev/md/%s\n", dev, dev+5); return -1; } @@ -191,13 +190,11 @@ int create_mddev(char *dev, char *name, int autof, int trustworthy, * empty. */ if (strchr(cname, '/') != NULL) { - pr_err("%s is an invalid name " - "for an md device.\n", dev); + pr_err("%s is an invalid name for an md device.\n", dev); return -1; } if (cname[0] == 0) { - pr_err("%s is an invalid name " - "for an md device (empty!).", dev); + pr_err("%s is an invalid name for an md device (empty!).", dev); return -1; } if (num < 0) { @@ -226,8 +223,7 @@ int create_mddev(char *dev, char *name, int autof, int trustworthy, if (name && name[0] == 0) name = NULL; if (name && trustworthy == METADATA && use_mdp == 1) { - pr_err("%s is not allowed for a %s container. " - "Consider /dev/md%d.\n", dev, name, num); + pr_err("%s is not allowed for a %s container. Consider /dev/md%d.\n", dev, name, num); return -1; } if (name && trustworthy == METADATA) @@ -432,8 +428,7 @@ int open_mddev(char *dev, int report_errors) if (md_get_version(mdfd) <= 0) { close(mdfd); if (report_errors) - pr_err("%s does not appear to be " - "an md device\n", dev); + pr_err("%s does not appear to be an md device\n", dev); return -2; } return mdfd; @@ -114,7 +114,6 @@ void free_mdstat(struct mdstat_ent *ms) { while (ms) { struct mdstat_ent *t; - free(ms->dev); free(ms->level); free(ms->pattern); free(ms->metadata_version); @@ -169,7 +168,7 @@ struct mdstat_ent *mdstat_read(int hold, int start) strcpy(devnm, line); ent = xmalloc(sizeof(*ent)); - ent->dev = ent->level = ent->pattern= NULL; + ent->level = ent->pattern= NULL; ent->next = NULL; ent->percent = RESYNC_NONE; ent->active = -1; @@ -179,7 +178,6 @@ struct mdstat_ent *mdstat_read(int hold, int start) ent->devcnt = 0; ent->members = NULL; - ent->dev = xstrdup(line); strcpy(ent->devnm, devnm); for (w=dl_next(line); w!= line ; w=dl_next(w)) { diff --git a/misc/mdcheck b/misc/mdcheck index 33570b97..2c8f54d6 100644 --- a/misc/mdcheck +++ b/misc/mdcheck @@ -77,6 +77,7 @@ find /var/lib/mdcheck -name "MD_UUID*" -type f -mtime +180 -exec rm {} \; cnt=0 for dev in /dev/md?* do + [ -e "$dev" ] || continue sys=`sysname $dev` if [ ! -f "$sys/md/sync_action" ] then # cannot check this array @@ -87,7 +88,7 @@ do continue fi - mdadm --detail --export "$dev" > $tmp || continue + mdadm --detail --export "$dev" | grep '^MD_UUID=' > $tmp || continue source $tmp fl="/var/lib/mdcheck/MD_UUID_$MD_UUID" if [ -z "$cont" ] @@ -42,11 +42,11 @@ static void add_fd(fd_set *fds, int *maxfd, int fd) if (fd < 0) return; if (fstat(fd, &st) == -1) { - dprintf("%s: Invalid fd %d\n", __func__, fd); + dprintf("Invalid fd %d\n", fd); return; } if (st.st_nlink == 0) { - dprintf("%s: fd %d was deleted\n", __func__, fd); + dprintf("fd %d was deleted\n", fd); return; } if (fd > *maxfd) @@ -82,8 +82,7 @@ static void read_resync_start(int fd, unsigned long long *v) n = read_attr(buf, 30, fd); if (n <= 0) { - dprintf("%s: Failed to read resync_start (%d)\n", - __func__, fd); + dprintf("Failed to read resync_start (%d)\n", fd); return; } if (strncmp(buf, "none", 4) == 0) @@ -260,8 +259,8 @@ static int read_and_act(struct active_array *a) } gettimeofday(&tv, NULL); - dprintf("%s(%d): %ld.%06ld state:%s prev:%s action:%s prev: %s start:%llu\n", - __func__, a->info.container_member, + dprintf("(%d): %ld.%06ld state:%s prev:%s action:%s prev: %s start:%llu\n", + a->info.container_member, tv.tv_sec, tv.tv_usec, array_states[a->curr_state], array_states[a->prev_state], @@ -422,21 +421,21 @@ static int read_and_act(struct active_array *a) a->last_checkpoint = sync_completed; a->container->ss->sync_metadata(a->container); - dprintf("%s(%d): state:%s action:%s next(", __func__, a->info.container_member, + dprintf("(%d): state:%s action:%s next(", a->info.container_member, array_states[a->curr_state], sync_actions[a->curr_action]); /* Effect state changes in the array */ if (a->next_state != bad_word) { - dprintf(" state:%s", array_states[a->next_state]); + dprintf_cont(" state:%s", array_states[a->next_state]); write_attr(array_states[a->next_state], a->info.state_fd); } if (a->next_action != bad_action) { write_attr(sync_actions[a->next_action], a->action_fd); - dprintf(" action:%s", sync_actions[a->next_action]); + dprintf_cont(" action:%s", sync_actions[a->next_action]); } for (mdi = a->info.devs; mdi ; mdi = mdi->next) { if (mdi->next_state & DS_UNBLOCK) { - dprintf(" %d:-blocked", mdi->disk.raid_disk); + dprintf_cont(" %d:-blocked", mdi->disk.raid_disk); write_attr("-blocked", mdi->state_fd); } @@ -449,7 +448,7 @@ static int read_and_act(struct active_array *a) */ remove_result = write_attr("remove", mdi->state_fd); if (remove_result > 0) { - dprintf(" %d:removed", mdi->disk.raid_disk); + dprintf_cont(" %d:removed", mdi->disk.raid_disk); close(mdi->state_fd); close(mdi->recovery_fd); mdi->state_fd = -1; @@ -458,10 +457,10 @@ static int read_and_act(struct active_array *a) } if (mdi->next_state & DS_INSYNC) { write_attr("+in_sync", mdi->state_fd); - dprintf(" %d:+in_sync", mdi->disk.raid_disk); + dprintf_cont(" %d:+in_sync", mdi->disk.raid_disk); } } - dprintf(" )\n"); + dprintf_cont(" )\n"); /* move curr_ to prev_ */ a->prev_state = a->curr_state; @@ -170,7 +170,7 @@ int connect_monitor(char *devname) addr.sun_family = PF_LOCAL; strcpy(addr.sun_path, path); - if (connect(sfd, &addr, sizeof(addr)) < 0) { + if (connect(sfd, (struct sockaddr*)&addr, sizeof(addr)) < 0) { close(sfd); return -1; } @@ -395,7 +395,7 @@ int block_monitor(char *container, const int freeze) sysfs_free(sra); sra = sysfs_read(-1, e2->devnm, GET_VERSION); if (unblock_subarray(sra, freeze)) - pr_err("Failed to unfreeze %s\n", e2->dev); + pr_err("Failed to unfreeze %s\n", e2->devnm); } ping_monitor(container); /* cleared frozen */ @@ -431,7 +431,7 @@ void unblock_monitor(char *container, const int unfreeze) if (sra->array.level > 0) to_ping++; if (unblock_subarray(sra, unfreeze)) - pr_err("Failed to unfreeze %s\n", e->dev); + pr_err("Failed to unfreeze %s\n", e->devnm); } if (to_ping) ping_monitor(container); diff --git a/platform-intel.c b/platform-intel.c index f347382a..88818f34 100644 --- a/platform-intel.c +++ b/platform-intel.c @@ -33,8 +33,6 @@ static int devpath_to_ll(const char *dev_path, const char *entry, unsigned long long *val); -static __u16 devpath_to_vendor(const char *dev_path); - static void free_sys_dev(struct sys_dev **list) { while (*list) { @@ -57,22 +55,34 @@ struct sys_dev *find_driver_devices(const char *bus, const char *driver) struct dirent *de; struct sys_dev *head = NULL; struct sys_dev *list = NULL; + struct sys_dev *vmd = NULL; enum sys_dev_type type; unsigned long long dev_id; + unsigned long long class; if (strcmp(driver, "isci") == 0) type = SYS_DEV_SAS; else if (strcmp(driver, "ahci") == 0) type = SYS_DEV_SATA; + else if (strcmp(driver, "nvme") == 0) { + /* if looking for nvme devs, first look for vmd */ + vmd = find_driver_devices("pci", "vmd"); + type = SYS_DEV_NVME; + } else if (strcmp(driver, "vmd") == 0) + type = SYS_DEV_VMD; else type = SYS_DEV_UNKNOWN; sprintf(path, "/sys/bus/%s/drivers/%s", bus, driver); driver_dir = opendir(path); - if (!driver_dir) + if (!driver_dir) { + if (vmd) + free_sys_dev(&vmd); return NULL; + } for (de = readdir(driver_dir); de; de = readdir(driver_dir)) { int n; + int skip = 0; /* is 'de' a device? check that the 'subsystem' link exists and * that its target matches 'bus' @@ -92,13 +102,27 @@ struct sys_dev *find_driver_devices(const char *bus, const char *driver) sprintf(path, "/sys/bus/%s/drivers/%s/%s", bus, driver, de->d_name); - /* if it's not Intel device skip it. */ - if (devpath_to_vendor(path) != 0x8086) + /* if searching for nvme - skip vmd connected one */ + if (type == SYS_DEV_NVME) { + struct sys_dev *dev; + char *rp = realpath(path, NULL); + for (dev = vmd; dev; dev = dev->next) { + if ((strncmp(dev->path, rp, strlen(dev->path)) == 0)) + skip = 1; + } + free(rp); + } + + /* if it's not Intel device or mark as VMD connected - skip it. */ + if (devpath_to_vendor(path) != 0x8086 || skip == 1) continue; if (devpath_to_ll(path, "device", &dev_id) != 0) continue; + if (devpath_to_ll(path, "class", &class) != 0) + continue; + /* start / add list entry */ if (!head) { head = xmalloc(sizeof(*head)); @@ -114,27 +138,44 @@ struct sys_dev *find_driver_devices(const char *bus, const char *driver) } list->dev_id = (__u16) dev_id; + list->class = (__u32) class; list->type = type; + /* Each VMD device (domain) adds separate PCI bus, it is better to + * store path as a path to that bus (easier further determination which + * NVMe dev is connected to this particular VMD domain). + */ + if (type == SYS_DEV_VMD) { + sprintf(path, "/sys/bus/%s/drivers/%s/%s/domain/device", + bus, driver, de->d_name); + } list->path = realpath(path, NULL); list->next = NULL; if ((list->pci_id = strrchr(list->path, '/')) != NULL) list->pci_id++; } closedir(driver_dir); + + if (vmd) { + if (list) + list->next = vmd; + else + head = vmd; + } + return head; } static struct sys_dev *intel_devices=NULL; static time_t valid_time = 0; -static enum sys_dev_type device_type_by_id(__u16 device_id) +struct sys_dev *device_by_id(__u16 device_id) { struct sys_dev *iter; - for(iter = intel_devices; iter != NULL; iter = iter->next) + for (iter = intel_devices; iter != NULL; iter = iter->next) if (iter->dev_id == device_id) - return iter->type; - return SYS_DEV_UNKNOWN; + return iter; + return NULL; } static int devpath_to_ll(const char *dev_path, const char *entry, unsigned long long *val) @@ -153,7 +194,7 @@ static int devpath_to_ll(const char *dev_path, const char *entry, unsigned long return n; } -static __u16 devpath_to_vendor(const char *dev_path) +__u16 devpath_to_vendor(const char *dev_path) { char path[strlen(dev_path) + strlen("/vendor") + 1]; char vendor[7]; @@ -179,7 +220,7 @@ static __u16 devpath_to_vendor(const char *dev_path) struct sys_dev *find_intel_devices(void) { - struct sys_dev *ahci, *isci; + struct sys_dev *ahci, *isci, *nvme; if (valid_time > time(0) - 10) return intel_devices; @@ -189,14 +230,25 @@ struct sys_dev *find_intel_devices(void) isci = find_driver_devices("pci", "isci"); ahci = find_driver_devices("pci", "ahci"); + /* Searching for NVMe will return list of NVMe and VMD controllers */ + nvme = find_driver_devices("pci", "nvme"); - if (!ahci) { + if (!isci && !ahci) { + ahci = nvme; + } else if (!ahci) { ahci = isci; + struct sys_dev *elem = ahci; + while (elem->next) + elem = elem->next; + elem->next = nvme; } else { struct sys_dev *elem = ahci; while (elem->next) elem = elem->next; elem->next = isci; + while (elem->next) + elem = elem->next; + elem->next = nvme; } intel_devices = ahci; valid_time = time(0); @@ -209,16 +261,82 @@ struct pciExpDataStructFormat { __u8 ver[4]; __u16 vendorID; __u16 deviceID; + __u16 devListOffset; + __u16 pciDataStructLen; + __u8 pciDataStructRev; } __attribute__ ((packed)); -static struct imsm_orom imsm_orom[SYS_DEV_MAX]; -static int populated_orom[SYS_DEV_MAX]; +struct orom_entry *orom_entries; + +const struct orom_entry *get_orom_entry_by_device_id(__u16 dev_id) +{ + struct orom_entry *entry; + struct devid_list *devid; + + for (entry = orom_entries; entry; entry = entry->next) { + for (devid = entry->devid_list; devid; devid = devid->next) { + if (devid->devid == dev_id) + return entry; + } + } + + return NULL; +} + +const struct imsm_orom *get_orom_by_device_id(__u16 dev_id) +{ + const struct orom_entry *entry = get_orom_entry_by_device_id(dev_id); + + if (entry) + return &entry->orom; + + return NULL; +} + +static struct orom_entry *add_orom(const struct imsm_orom *orom) +{ + struct orom_entry *list; + struct orom_entry *prev = NULL; + + for (list = orom_entries; list; prev = list, list = list->next) + ; + + list = xmalloc(sizeof(struct orom_entry)); + list->orom = *orom; + list->devid_list = NULL; + list->next = NULL; + + if (prev == NULL) + orom_entries = list; + else + prev->next = list; + + return list; +} + +static void add_orom_device_id(struct orom_entry *entry, __u16 dev_id) +{ + struct devid_list *list; + struct devid_list *prev = NULL; + + for (list = entry->devid_list; list; prev = list, list = list->next) { + if (list->devid == dev_id) + return; + } + list = xmalloc(sizeof(struct devid_list)); + list->devid = dev_id; + list->next = NULL; + + if (prev == NULL) + entry->devid_list = list; + else + prev->next = list; +} static int scan(const void *start, const void *end, const void *data) { int offset; - const struct imsm_orom *imsm_mem; - int dev; + const struct imsm_orom *imsm_mem = NULL; int len = (end - start); struct pciExpDataStructFormat *ptr= (struct pciExpDataStructFormat *)data; @@ -231,81 +349,84 @@ static int scan(const void *start, const void *end, const void *data) (ulong) __le16_to_cpu(ptr->vendorID), (ulong) __le16_to_cpu(ptr->deviceID)); - if (__le16_to_cpu(ptr->vendorID) == 0x8086) { - /* serach attached intel devices by device id from OROM */ - dev = device_type_by_id(__le16_to_cpu(ptr->deviceID)); - if (dev == SYS_DEV_UNKNOWN) - return 0; - } - else + if (__le16_to_cpu(ptr->vendorID) != 0x8086) return 0; for (offset = 0; offset < len; offset += 4) { - imsm_mem = start + offset; - if ((memcmp(imsm_mem->signature, "$VER", 4) == 0)) { - imsm_orom[dev] = *imsm_mem; - populated_orom[dev] = 1; - return populated_orom[SYS_DEV_SATA] && populated_orom[SYS_DEV_SAS]; + const void *mem = start + offset; + + if ((memcmp(mem, IMSM_OROM_SIGNATURE, 4) == 0)) { + imsm_mem = mem; + break; } } + + if (!imsm_mem) + return 0; + + struct orom_entry *orom = add_orom(imsm_mem); + + /* only PciDataStructure with revision 3 and above supports devices list. */ + if (ptr->pciDataStructRev >= 3 && ptr->devListOffset) { + const __u16 *dev_list = (void *)ptr + ptr->devListOffset; + int i; + + for (i = 0; dev_list[i] != 0; i++) + add_orom_device_id(orom, dev_list[i]); + } else { + add_orom_device_id(orom, __le16_to_cpu(ptr->deviceID)); + } + return 0; } -const struct imsm_orom *imsm_platform_test(enum sys_dev_type hba_id, int *populated, - struct imsm_orom *imsm_orom) +const struct imsm_orom *imsm_platform_test(struct sys_dev *hba) { - memset(imsm_orom, 0, sizeof(*imsm_orom)); - imsm_orom->rlc = IMSM_OROM_RLC_RAID0 | IMSM_OROM_RLC_RAID1 | - IMSM_OROM_RLC_RAID10 | IMSM_OROM_RLC_RAID5; - imsm_orom->sss = IMSM_OROM_SSS_4kB | IMSM_OROM_SSS_8kB | - IMSM_OROM_SSS_16kB | IMSM_OROM_SSS_32kB | - IMSM_OROM_SSS_64kB | IMSM_OROM_SSS_128kB | - IMSM_OROM_SSS_256kB | IMSM_OROM_SSS_512kB | - IMSM_OROM_SSS_1MB | IMSM_OROM_SSS_2MB; - imsm_orom->dpa = IMSM_OROM_DISKS_PER_ARRAY; - imsm_orom->tds = IMSM_OROM_TOTAL_DISKS; - imsm_orom->vpa = IMSM_OROM_VOLUMES_PER_ARRAY; - imsm_orom->vphba = IMSM_OROM_VOLUMES_PER_HBA; - imsm_orom->attr = imsm_orom->rlc | IMSM_OROM_ATTR_ChecksumVerify; - *populated = 1; + struct imsm_orom orom = { + .signature = IMSM_OROM_SIGNATURE, + .rlc = IMSM_OROM_RLC_RAID0 | IMSM_OROM_RLC_RAID1 | + IMSM_OROM_RLC_RAID10 | IMSM_OROM_RLC_RAID5, + .sss = IMSM_OROM_SSS_4kB | IMSM_OROM_SSS_8kB | + IMSM_OROM_SSS_16kB | IMSM_OROM_SSS_32kB | + IMSM_OROM_SSS_64kB | IMSM_OROM_SSS_128kB | + IMSM_OROM_SSS_256kB | IMSM_OROM_SSS_512kB | + IMSM_OROM_SSS_1MB | IMSM_OROM_SSS_2MB, + .dpa = IMSM_OROM_DISKS_PER_ARRAY, + .tds = IMSM_OROM_TOTAL_DISKS, + .vpa = IMSM_OROM_VOLUMES_PER_ARRAY, + .vphba = IMSM_OROM_VOLUMES_PER_HBA + }; + orom.attr = orom.rlc | IMSM_OROM_ATTR_ChecksumVerify; if (check_env("IMSM_TEST_OROM_NORAID5")) { - imsm_orom->rlc = IMSM_OROM_RLC_RAID0 | IMSM_OROM_RLC_RAID1 | + orom.rlc = IMSM_OROM_RLC_RAID0 | IMSM_OROM_RLC_RAID1 | IMSM_OROM_RLC_RAID10; } - if (check_env("IMSM_TEST_AHCI_EFI_NORAID5") && (hba_id == SYS_DEV_SAS)) { - imsm_orom->rlc = IMSM_OROM_RLC_RAID0 | IMSM_OROM_RLC_RAID1 | + if (check_env("IMSM_TEST_AHCI_EFI_NORAID5") && (hba->type == SYS_DEV_SAS)) { + orom.rlc = IMSM_OROM_RLC_RAID0 | IMSM_OROM_RLC_RAID1 | IMSM_OROM_RLC_RAID10; } - if (check_env("IMSM_TEST_SCU_EFI_NORAID5") && (hba_id == SYS_DEV_SATA)) { - imsm_orom->rlc = IMSM_OROM_RLC_RAID0 | IMSM_OROM_RLC_RAID1 | + if (check_env("IMSM_TEST_SCU_EFI_NORAID5") && (hba->type == SYS_DEV_SATA)) { + orom.rlc = IMSM_OROM_RLC_RAID0 | IMSM_OROM_RLC_RAID1 | IMSM_OROM_RLC_RAID10; } - return imsm_orom; + struct orom_entry *ret = add_orom(&orom); + + add_orom_device_id(ret, hba->dev_id); + + return &ret->orom; } -static const struct imsm_orom *find_imsm_hba_orom(enum sys_dev_type hba_id) +static const struct imsm_orom *find_imsm_hba_orom(struct sys_dev *hba) { unsigned long align; - if (hba_id >= SYS_DEV_MAX) - return NULL; + if (check_env("IMSM_TEST_OROM")) + return imsm_platform_test(hba); - /* it's static data so we only need to read it once */ - if (populated_orom[hba_id]) { - dprintf("OROM CAP: %p, pid: %d pop: %d\n", - &imsm_orom[hba_id], (int) getpid(), populated_orom[hba_id]); - return &imsm_orom[hba_id]; - } - if (check_env("IMSM_TEST_OROM")) { - dprintf("OROM CAP: %p, pid: %d pop: %d\n", - &imsm_orom[hba_id], (int) getpid(), populated_orom[hba_id]); - return imsm_platform_test(hba_id, &populated_orom[hba_id], &imsm_orom[hba_id]); - } /* return empty OROM capabilities in EFI test mode */ - if (check_env("IMSM_TEST_AHCI_EFI") || - check_env("IMSM_TEST_SCU_EFI")) + if (check_env("IMSM_TEST_AHCI_EFI") || check_env("IMSM_TEST_SCU_EFI")) return NULL; find_intel_devices(); @@ -325,9 +446,7 @@ static const struct imsm_orom *find_imsm_hba_orom(enum sys_dev_type hba_id) scan_adapter_roms(scan); probe_roms_exit(); - if (populated_orom[hba_id]) - return &imsm_orom[hba_id]; - return NULL; + return get_orom_by_device_id(hba->dev_id); } #define GUID_STR_MAX 37 /* according to GUID format: @@ -341,23 +460,59 @@ static const struct imsm_orom *find_imsm_hba_orom(enum sys_dev_type hba_id) (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) }}) #define SYS_EFI_VAR_PATH "/sys/firmware/efi/vars" +#define SYS_EFIVARS_PATH "/sys/firmware/efi/efivars" #define SCU_PROP "RstScuV" #define AHCI_PROP "RstSataV" +#define AHCI_SSATA_PROP "RstsSatV" +#define AHCI_CSATA_PROP "RstCSatV" +#define VMD_PROP "RstUefiV" #define VENDOR_GUID \ EFI_GUID(0x193dfefa, 0xa445, 0x4302, 0x99, 0xd8, 0xef, 0x3a, 0xad, 0x1a, 0x04, 0xc6) -int populated_efi[SYS_DEV_MAX] = { 0, 0 }; +#define PCI_CLASS_RAID_CNTRL 0x010400 + +static int read_efi_var(void *buffer, ssize_t buf_size, char *variable_name, struct efi_guid guid) +{ + char path[PATH_MAX]; + char buf[GUID_STR_MAX]; + int fd; + ssize_t n; + + snprintf(path, PATH_MAX, "%s/%s-%s", SYS_EFIVARS_PATH, variable_name, guid_str(buf, guid)); + + fd = open(path, O_RDONLY); + if (fd < 0) + return 1; -static struct imsm_orom imsm_efi[SYS_DEV_MAX]; + /* read the variable attributes and ignore it */ + n = read(fd, buf, sizeof(__u32)); + if (n < 0) { + close(fd); + return 1; + } -int read_efi_variable(void *buffer, ssize_t buf_size, char *variable_name, struct efi_guid guid) + /* read the variable data */ + n = read(fd, buffer, buf_size); + close(fd); + if (n < buf_size) + return 1; + + return 0; +} + +static int read_efi_variable(void *buffer, ssize_t buf_size, char *variable_name, struct efi_guid guid) { char path[PATH_MAX]; char buf[GUID_STR_MAX]; int dfd; ssize_t n, var_data_len; + /* Try to read the variable using the new efivarfs interface first. + * If that fails, fall back to the old sysfs-efivars interface. */ + if (!read_efi_var(buffer, buf_size, variable_name, guid)) + return 0; + snprintf(path, PATH_MAX, "%s/%s-%s/size", SYS_EFI_VAR_PATH, variable_name, guid_str(buf, guid)); dprintf("EFI VAR: path=%s\n", path); @@ -395,55 +550,99 @@ int read_efi_variable(void *buffer, ssize_t buf_size, char *variable_name, struc return 0; } -const struct imsm_orom *find_imsm_efi(enum sys_dev_type hba_id) +const struct imsm_orom *find_imsm_efi(struct sys_dev *hba) { - if (hba_id >= SYS_DEV_MAX) - return NULL; + struct imsm_orom orom; + struct orom_entry *ret; + int err; - dprintf("EFI CAP: %p, pid: %d pop: %d\n", - &imsm_efi[hba_id], (int) getpid(), populated_efi[hba_id]); + if (check_env("IMSM_TEST_AHCI_EFI") || check_env("IMSM_TEST_SCU_EFI")) + return imsm_platform_test(hba); - /* it's static data so we only need to read it once */ - if (populated_efi[hba_id]) { - dprintf("EFI CAP: %p, pid: %d pop: %d\n", - &imsm_efi[hba_id], (int) getpid(), populated_efi[hba_id]); - return &imsm_efi[hba_id]; - } - if (check_env("IMSM_TEST_AHCI_EFI") || - check_env("IMSM_TEST_SCU_EFI")) { - dprintf("OROM CAP: %p, pid: %d pop: %d\n", - &imsm_efi[hba_id], (int) getpid(), populated_efi[hba_id]); - return imsm_platform_test(hba_id, &populated_efi[hba_id], &imsm_efi[hba_id]); - } /* OROM test is set, return that there is no EFI capabilities */ if (check_env("IMSM_TEST_OROM")) return NULL; - if (read_efi_variable(&imsm_efi[hba_id], sizeof(imsm_efi[0]), hba_id == SYS_DEV_SAS ? SCU_PROP : AHCI_PROP, VENDOR_GUID)) { - populated_efi[hba_id] = 0; + if (hba->type == SYS_DEV_SATA && hba->class != PCI_CLASS_RAID_CNTRL) return NULL; + + err = read_efi_variable(&orom, sizeof(orom), hba->type == SYS_DEV_SAS ? SCU_PROP : AHCI_PROP, VENDOR_GUID); + + /* try to read variable for second AHCI controller */ + if (err && hba->type == SYS_DEV_SATA) + err = read_efi_variable(&orom, sizeof(orom), AHCI_SSATA_PROP, VENDOR_GUID); + + /* try to read variable for combined AHCI controllers */ + if (err && hba->type == SYS_DEV_SATA) { + static struct orom_entry *csata; + + err = read_efi_variable(&orom, sizeof(orom), AHCI_CSATA_PROP, VENDOR_GUID); + if (!err) { + if (!csata) + csata = add_orom(&orom); + add_orom_device_id(csata, hba->dev_id); + csata->type = hba->type; + return &csata->orom; + } + } + + if (hba->type == SYS_DEV_VMD) { + err = read_efi_variable(&orom, sizeof(orom), VMD_PROP, VENDOR_GUID); } - populated_efi[hba_id] = 1; - return &imsm_efi[hba_id]; + if (err) + return NULL; + + ret = add_orom(&orom); + add_orom_device_id(ret, hba->dev_id); + ret->type = hba->type; + + return &ret->orom; } -/* - * backward interface compatibility - */ -const struct imsm_orom *find_imsm_orom(void) +const struct imsm_orom *find_imsm_nvme(struct sys_dev *hba) { - return find_imsm_hba_orom(SYS_DEV_SATA); + static struct orom_entry *nvme_orom; + + if (hba->type != SYS_DEV_NVME) + return NULL; + + if (!nvme_orom) { + struct imsm_orom nvme_orom_compat = { + .signature = IMSM_NVME_OROM_COMPAT_SIGNATURE, + .rlc = IMSM_OROM_RLC_RAID0 | IMSM_OROM_RLC_RAID1 | + IMSM_OROM_RLC_RAID10 | IMSM_OROM_RLC_RAID5, + .sss = IMSM_OROM_SSS_4kB | IMSM_OROM_SSS_8kB | + IMSM_OROM_SSS_16kB | IMSM_OROM_SSS_32kB | + IMSM_OROM_SSS_64kB | IMSM_OROM_SSS_128kB, + .dpa = IMSM_OROM_DISKS_PER_ARRAY_NVME, + .tds = IMSM_OROM_TOTAL_DISKS_NVME, + .vpa = IMSM_OROM_VOLUMES_PER_ARRAY, + .vphba = IMSM_OROM_TOTAL_DISKS_NVME / 2 * IMSM_OROM_VOLUMES_PER_ARRAY, + .attr = IMSM_OROM_ATTR_2TB | IMSM_OROM_ATTR_2TB_DISK, + .driver_features = IMSM_OROM_CAPABILITIES_EnterpriseSystem + }; + nvme_orom = add_orom(&nvme_orom_compat); + } + add_orom_device_id(nvme_orom, hba->dev_id); + nvme_orom->type = SYS_DEV_NVME; + return &nvme_orom->orom; } -const struct imsm_orom *find_imsm_capability(enum sys_dev_type hba_id) +const struct imsm_orom *find_imsm_capability(struct sys_dev *hba) { - const struct imsm_orom *cap=NULL; + const struct imsm_orom *cap = get_orom_by_device_id(hba->dev_id); - if ((cap = find_imsm_efi(hba_id)) != NULL) + if (cap) return cap; - if ((cap = find_imsm_hba_orom(hba_id)) != NULL) + + if (hba->type == SYS_DEV_NVME) + return find_imsm_nvme(hba); + if ((cap = find_imsm_efi(hba)) != NULL) + return cap; + if ((cap = find_imsm_hba_orom(hba)) != NULL) return cap; + return NULL; } @@ -511,3 +710,32 @@ int disk_attached_to_hba(int fd, const char *hba_path) return rc; } + +char *vmd_domain_to_controller(struct sys_dev *hba, char *buf) +{ + struct dirent *ent; + DIR *dir; + char path[PATH_MAX]; + + if (!hba) + return NULL; + + if (hba->type != SYS_DEV_VMD) + return NULL; + + dir = opendir("/sys/bus/pci/drivers/vmd"); + + for (ent = dir ? readdir(dir) : NULL; ent; ent = readdir(dir)) { + sprintf(path, "/sys/bus/pci/drivers/vmd/%s/domain/device", + ent->d_name); + + if (!realpath(path, buf)) + continue; + + if (strncmp(buf, hba->path, strlen(buf)) == 0) { + sprintf(path, "/sys/bus/pci/drivers/vmd/%s", ent->d_name); + return realpath(path, buf); + } + } + return NULL; +} diff --git a/platform-intel.h b/platform-intel.h index 8226be35..a8ae85f4 100644 --- a/platform-intel.h +++ b/platform-intel.h @@ -22,6 +22,8 @@ /* The IMSM Capability (IMSM AHCI and ISCU OROM/EFI variable) Version Table definition */ struct imsm_orom { __u8 signature[4]; + #define IMSM_OROM_SIGNATURE "$VER" + #define IMSM_NVME_OROM_COMPAT_SIGNATURE "$NVM" __u8 table_ver_major; /* Currently 2 (can change with future revs) */ __u8 table_ver_minor; /* Currently 2 (can change with future revs) */ __u16 major_ver; /* Example: 8 as in 8.6.0.1020 */ @@ -59,12 +61,15 @@ struct imsm_orom { #define IMSM_OROM_SSS_64MB (1 << 15) __u16 dpa; /* Disks Per Array supported */ #define IMSM_OROM_DISKS_PER_ARRAY 6 + #define IMSM_OROM_DISKS_PER_ARRAY_NVME 12 __u16 tds; /* Total Disks Supported */ #define IMSM_OROM_TOTAL_DISKS 6 + #define IMSM_OROM_TOTAL_DISKS_NVME 12 __u8 vpa; /* # Volumes Per Array supported */ #define IMSM_OROM_VOLUMES_PER_ARRAY 2 __u8 vphba; /* # Volumes Per Host Bus Adapter supported */ #define IMSM_OROM_VOLUMES_PER_HBA 4 + #define IMSM_OROM_VOLUMES_PER_HBA_NVME 4 /* Attributes supported. This should map to the * attributes in the MPB. Also, lower 16 bits * should match/duplicate RLC bits above. @@ -168,10 +173,23 @@ static inline int fls(int x) return r; } +static inline int imsm_orom_is_enterprise(const struct imsm_orom *orom) +{ + return !!(orom->driver_features & IMSM_OROM_CAPABILITIES_EnterpriseSystem); +} + +static inline int imsm_orom_is_nvme(const struct imsm_orom *orom) +{ + return memcmp(orom->signature, IMSM_NVME_OROM_COMPAT_SIGNATURE, + sizeof(orom->signature)) == 0; +} + enum sys_dev_type { SYS_DEV_UNKNOWN = 0, SYS_DEV_SAS, SYS_DEV_SATA, + SYS_DEV_NVME, + SYS_DEV_VMD, SYS_DEV_MAX }; @@ -180,6 +198,7 @@ struct sys_dev { char *path; char *pci_id; __u16 dev_id; + __u32 class; struct sys_dev *next; }; @@ -187,10 +206,23 @@ struct efi_guid { __u8 b[16]; }; +struct devid_list { + __u16 devid; + struct devid_list *next; +}; + +struct orom_entry { + struct imsm_orom orom; + struct devid_list *devid_list; + enum sys_dev_type type; + struct orom_entry *next; +}; + +extern struct orom_entry *orom_entries; + static inline char *guid_str(char *buf, struct efi_guid guid) { - sprintf(buf, "%02x%02x%02x%02x-%02x%02x-%02x%02x-" - "%02x%02x-%02x%02x%02x%02x%02x%02x", + sprintf(buf, "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x", guid.b[3], guid.b[2], guid.b[1], guid.b[0], guid.b[5], guid.b[4], guid.b[7], guid.b[6], guid.b[8], guid.b[9], guid.b[10], guid.b[11], @@ -199,12 +231,17 @@ static inline char *guid_str(char *buf, struct efi_guid guid) } char *diskfd_to_devpath(int fd); +__u16 devpath_to_vendor(const char *dev_path); struct sys_dev *find_driver_devices(const char *bus, const char *driver); struct sys_dev *find_intel_devices(void); -const struct imsm_orom *find_imsm_capability(enum sys_dev_type hba_id); +const struct imsm_orom *find_imsm_capability(struct sys_dev *hba); const struct imsm_orom *find_imsm_orom(void); int disk_attached_to_hba(int fd, const char *hba_path); int devt_attached_to_hba(dev_t dev, const char *hba_path); char *devt_to_devpath(dev_t dev); int path_attached_to_hba(const char *disk_path, const char *hba_path); const char *get_sys_dev_type(enum sys_dev_type); +const struct orom_entry *get_orom_entry_by_device_id(__u16 dev_id); +const struct imsm_orom *get_orom_by_device_id(__u16 device_id); +struct sys_dev *device_by_id(__u16 device_id); +char *vmd_domain_to_controller(struct sys_dev *hba, char *buf); @@ -727,16 +727,14 @@ void policy_save_path(char *id_path, struct map_ent *array) FILE *f = NULL; if (mkdir(FAILED_SLOTS_DIR, S_IRWXU) < 0 && errno != EEXIST) { - pr_err("can't create file to save path " - "to old disk: %s\n", strerror(errno)); + pr_err("can't create file to save path to old disk: %s\n", strerror(errno)); return; } snprintf(path, PATH_MAX, FAILED_SLOTS_DIR "/%s", id_path); f = fopen(path, "w"); if (!f) { - pr_err("can't create file to" - " save path to old disk: %s\n", + pr_err("can't create file to save path to old disk: %s\n", strerror(errno)); return; } @@ -745,8 +743,7 @@ void policy_save_path(char *id_path, struct map_ent *array) array->metadata, array->uuid[0], array->uuid[1], array->uuid[2], array->uuid[3]) <= 0) - pr_err("Failed to write to " - "<id_path> cookie\n"); + pr_err("Failed to write to <id_path> cookie\n"); fclose(f); } diff --git a/raid6check.c b/raid6check.c index 1d8ac40d..ad7ffe7e 100644 --- a/raid6check.c +++ b/raid6check.c @@ -30,6 +30,8 @@ #define CHECK_PAGE_BITS (12) #define CHECK_PAGE_SIZE (1 << CHECK_PAGE_BITS) +char const Name[] = "raid6check"; + enum repair { NO_REPAIR = 0, MANUAL_REPAIR, @@ -38,12 +40,14 @@ enum repair { int geo_map(int block, unsigned long long stripe, int raid_disks, int level, int layout); +int is_ddf(int layout); void qsyndrome(uint8_t *p, uint8_t *q, uint8_t **sources, int disks, int size); void make_tables(void); void ensure_zero_has_size(int chunk_size); -void raid6_datap_recov(int disks, size_t bytes, int faila, uint8_t **ptrs); +void raid6_datap_recov(int disks, size_t bytes, int faila, uint8_t **ptrs, + int neg_offset); void raid6_2data_recov(int disks, size_t bytes, int faila, int failb, - uint8_t **ptrs); + uint8_t **ptrs, int neg_offset); void xor_blocks(char *target, char **sources, int disks, int size); /* Collect per stripe consistency information */ @@ -157,38 +161,39 @@ int unlock_all_stripes(struct mdinfo *info, sighandler_t *sig) { } /* Autorepair */ -int autorepair(int *disk, int diskP, int diskQ, unsigned long long start, int chunk_size, - char *name[], int raid_disks, int data_disks, char **blocks_page, - char **blocks, uint8_t *p, char **stripes, int *block_index_for_slot, +int autorepair(int *disk, unsigned long long start, int chunk_size, + char *name[], int raid_disks, int syndrome_disks, char **blocks_page, + char **blocks, uint8_t *p, int *block_index_for_slot, int *source, unsigned long long *offsets) { int i, j; int pages_to_write_count = 0; int page_to_write[chunk_size >> CHECK_PAGE_BITS]; for(j = 0; j < (chunk_size >> CHECK_PAGE_BITS); j++) { - if (disk[j] >= 0) { - printf("Auto-repairing slot %d (%s)\n", disk[j], name[disk[j]]); + if (disk[j] >= -2 && block_index_for_slot[disk[j]] >= 0) { + int slot = block_index_for_slot[disk[j]]; + printf("Auto-repairing slot %d (%s)\n", slot, name[slot]); pages_to_write_count++; page_to_write[j] = 1; - for(i = 0; i < raid_disks; i++) { + for(i = -2; i < syndrome_disks; i++) { blocks_page[i] = blocks[i] + j * CHECK_PAGE_SIZE; } - if (disk[j] == diskQ) { - qsyndrome(p, (uint8_t*)stripes[diskQ] + j * CHECK_PAGE_SIZE, (uint8_t**)blocks_page, data_disks, CHECK_PAGE_SIZE); + if (disk[j] == -2) { + qsyndrome(p, (uint8_t*)blocks_page[-2], + (uint8_t**)blocks_page, + syndrome_disks, CHECK_PAGE_SIZE); } else { - char *all_but_failed_blocks[data_disks]; - int failed_block_index = block_index_for_slot[disk[j]]; - for(i = 0; i < data_disks; i++) { - if (failed_block_index == i) { - all_but_failed_blocks[i] = stripes[diskP] + j * CHECK_PAGE_SIZE; - } - else { + char *all_but_failed_blocks[syndrome_disks]; + for(i = 0; i < syndrome_disks; i++) { + if (i == disk[j]) + all_but_failed_blocks[i] = blocks_page[-1]; + else all_but_failed_blocks[i] = blocks_page[i]; - } } - xor_blocks(stripes[disk[j]] + j * CHECK_PAGE_SIZE, - all_but_failed_blocks, data_disks, CHECK_PAGE_SIZE); + xor_blocks(blocks_page[disk[j]], + all_but_failed_blocks, syndrome_disks, + CHECK_PAGE_SIZE); } } else { @@ -200,8 +205,11 @@ int autorepair(int *disk, int diskP, int diskQ, unsigned long long start, int ch int write_res = 0; for(j = 0; j < (chunk_size >> CHECK_PAGE_BITS); j++) { if(page_to_write[j] == 1) { - lseek64(source[disk[j]], offsets[disk[j]] + start * chunk_size + j * CHECK_PAGE_SIZE, SEEK_SET); - write_res += write(source[disk[j]], stripes[disk[j]] + j * CHECK_PAGE_SIZE, CHECK_PAGE_SIZE); + int slot = block_index_for_slot[disk[j]]; + lseek64(source[slot], offsets[slot] + start * chunk_size + j * CHECK_PAGE_SIZE, SEEK_SET); + write_res += write(source[slot], + blocks[disk[j]] + j * CHECK_PAGE_SIZE, + CHECK_PAGE_SIZE); } } @@ -215,101 +223,78 @@ int autorepair(int *disk, int diskP, int diskQ, unsigned long long start, int ch } /* Manual repair */ -int manual_repair(int diskP, int diskQ, int chunk_size, int raid_disks, int data_disks, - int failed_disk1, int failed_disk2, unsigned long long start, int *block_index_for_slot, - char *name[], char **stripes, char **blocks, uint8_t *p, struct mdinfo *info, sighandler_t *sig, +int manual_repair(int chunk_size, int syndrome_disks, + int failed_slot1, int failed_slot2, + unsigned long long start, int *block_index_for_slot, + char *name[], char **stripes, char **blocks, uint8_t *p, int *source, unsigned long long *offsets) { - int err = 0; int i; + int fd1 = block_index_for_slot[failed_slot1]; + int fd2 = block_index_for_slot[failed_slot2]; printf("Repairing stripe %llu\n", start); printf("Assuming slots %d (%s) and %d (%s) are incorrect\n", - failed_disk1, name[failed_disk1], - failed_disk2, name[failed_disk2]); + fd1, name[fd1], + fd2, name[fd2]); - if (failed_disk1 == diskQ || failed_disk2 == diskQ) { - char *all_but_failed_blocks[data_disks]; + if (failed_slot1 == -2 || failed_slot2 == -2) { + char *all_but_failed_blocks[syndrome_disks]; int failed_data_or_p; - int failed_block_index; - if (failed_disk1 == diskQ) { - failed_data_or_p = failed_disk2; - } - else { - failed_data_or_p = failed_disk1; - } + if (failed_slot1 == -2) + failed_data_or_p = failed_slot2; + else + failed_data_or_p = failed_slot1; + printf("Repairing D/P(%d) and Q\n", failed_data_or_p); - failed_block_index = block_index_for_slot[failed_data_or_p]; - for (i = 0; i < data_disks; i++) { - if (failed_block_index == i) { - all_but_failed_blocks[i] = stripes[diskP]; - } - else { + + for (i = 0; i < syndrome_disks; i++) { + if (i == failed_data_or_p) + all_but_failed_blocks[i] = blocks[-1]; + else all_but_failed_blocks[i] = blocks[i]; - } } - xor_blocks(stripes[failed_data_or_p], - all_but_failed_blocks, data_disks, chunk_size); - qsyndrome(p, (uint8_t*)stripes[diskQ], (uint8_t**)blocks, data_disks, chunk_size); - } - else { + xor_blocks(blocks[failed_data_or_p], + all_but_failed_blocks, syndrome_disks, chunk_size); + qsyndrome(p, (uint8_t*)blocks[-2], (uint8_t**)blocks, + syndrome_disks, chunk_size); + } else { ensure_zero_has_size(chunk_size); - if (failed_disk1 == diskP || failed_disk2 == diskP) { - int failed_data, failed_block_index; - if (failed_disk1 == diskP) { - failed_data = failed_disk2; - } - else { - failed_data = failed_disk1; - } - failed_block_index = block_index_for_slot[failed_data]; - printf("Repairing D(%d) and P\n", failed_data); - raid6_datap_recov(raid_disks, chunk_size, failed_block_index, (uint8_t**)blocks); - } - else { + if (failed_slot1 == -1 || failed_slot2 == -1) { + int failed_data; + if (failed_slot1 == -1) + failed_data = failed_slot2; + else + failed_data = failed_slot1; + printf("Repairing D(%d) and P\n", failed_data); + raid6_datap_recov(syndrome_disks+2, chunk_size, + failed_data, (uint8_t**)blocks, 1); + } else { printf("Repairing D and D\n"); - int failed_block_index1 = block_index_for_slot[failed_disk1]; - int failed_block_index2 = block_index_for_slot[failed_disk2]; - if (failed_block_index1 > failed_block_index2) { - int t = failed_block_index1; - failed_block_index1 = failed_block_index2; - failed_block_index2 = t; - } - raid6_2data_recov(raid_disks, chunk_size, failed_block_index1, failed_block_index2, (uint8_t**)blocks); - } - } - - err = lock_stripe(info, start, chunk_size, data_disks, sig); - if(err != 0) { - if (err != 2) { - return -1; + raid6_2data_recov(syndrome_disks+2, chunk_size, + failed_slot1, failed_slot2, + (uint8_t**)blocks, 1); } - return -2;; } int write_res1, write_res2; off64_t seek_res; - seek_res = lseek64(source[failed_disk1], - offsets[failed_disk1] + start * chunk_size, SEEK_SET); + seek_res = lseek64(source[fd1], + offsets[fd1] + start * chunk_size, SEEK_SET); if (seek_res < 0) { fprintf(stderr, "lseek failed for failed_disk1\n"); return -1; } - write_res1 = write(source[failed_disk1], stripes[failed_disk1], chunk_size); + write_res1 = write(source[fd1], blocks[failed_slot1], chunk_size); - seek_res = lseek64(source[failed_disk2], - offsets[failed_disk2] + start * chunk_size, SEEK_SET); + seek_res = lseek64(source[fd2], + offsets[fd2] + start * chunk_size, SEEK_SET); if (seek_res < 0) { - fprintf(stderr, "lseek failed for failed_disk1\n"); + fprintf(stderr, "lseek failed for failed_disk2\n"); return -1; } - write_res2 = write(source[failed_disk2], stripes[failed_disk2], chunk_size); - - err = unlock_all_stripes(info, sig); - if(err != 0) { - return -2; - } + write_res2 = write(source[fd2], blocks[failed_slot2], chunk_size); if (write_res1 != chunk_size || write_res2 != chunk_size) { fprintf(stderr, "Failed to write a complete chunk.\n"); @@ -325,19 +310,38 @@ int check_stripes(struct mdinfo *info, int *source, unsigned long long *offsets, enum repair repair, int failed_disk1, int failed_disk2) { /* read the data and p and q blocks, and check we got them right */ - char *stripe_buf = xmalloc(raid_disks * chunk_size); + int data_disks = raid_disks - 2; + int syndrome_disks = data_disks + is_ddf(layout) * 2; + char *stripe_buf; + + /* stripes[] is indexed by raid_disk and holds chunks from each device */ char **stripes = xmalloc(raid_disks * sizeof(char*)); - char **blocks = xmalloc(raid_disks * sizeof(char*)); - char **blocks_page = xmalloc(raid_disks * sizeof(char*)); - int *block_index_for_slot = xmalloc(raid_disks * sizeof(int)); + + /* blocks[] is indexed by syndrome number and points to either one of the + * chunks from 'stripes[]', or to a chunk of zeros. -1 and -2 are + * P and Q */ + char **blocks = xmalloc((syndrome_disks + 2) * sizeof(char*)); + + /* blocks_page[] is a temporary index to just one page of the chunks + * that blocks[] points to. */ + char **blocks_page = xmalloc((syndrome_disks + 2) * sizeof(char*)); + + /* block_index_for_slot[] provides the reverse mapping from blocks to stripes. + * The index is a syndrome position, the content is a raid_disk number. + * indicies -1 and -2 work, and are P and Q disks */ + int *block_index_for_slot = xmalloc((syndrome_disks+2) * sizeof(int)); + + /* 'p' and 'q' contain calcualted P and Q, to be compared with + * blocks[-1] and blocks[-2]; + */ uint8_t *p = xmalloc(chunk_size); uint8_t *q = xmalloc(chunk_size); + char *zero = xmalloc(chunk_size); int *results = xmalloc(chunk_size * sizeof(int)); sighandler_t *sig = xmalloc(3 * sizeof(sighandler_t)); int i, j; - int diskP, diskQ; - int data_disks = raid_disks - 2; + int diskP, diskQ, diskD; int err = 0; extern int tables_ready; @@ -345,10 +349,21 @@ int check_stripes(struct mdinfo *info, int *source, unsigned long long *offsets, if (!tables_ready) make_tables(); + if (posix_memalign((void**)&stripe_buf, 4096, raid_disks * chunk_size) != 0) + exit(4); + block_index_for_slot += 2; + blocks += 2; + blocks_page += 2; + + memset(zero, 0, chunk_size); for ( i = 0 ; i < raid_disks ; i++) stripes[i] = stripe_buf + i * chunk_size; while (length > 0) { + /* The syndrome number of the broken disk is recorded + * in 'disk[]' which allows a different broken disk for + * each page. + */ int disk[chunk_size >> CHECK_PAGE_BITS]; err = lock_stripe(info, start, chunk_size, data_disks, sig); @@ -375,40 +390,68 @@ int check_stripes(struct mdinfo *info, int *source, unsigned long long *offsets, } } - for (i = 0 ; i < data_disks ; i++) { - int disk = geo_map(i, start, raid_disks, level, layout); - blocks[i] = stripes[disk]; - block_index_for_slot[disk] = i; - } - - qsyndrome(p, q, (uint8_t**)blocks, data_disks, chunk_size); diskP = geo_map(-1, start, raid_disks, level, layout); + block_index_for_slot[-1] = diskP; + blocks[-1] = stripes[diskP]; + diskQ = geo_map(-2, start, raid_disks, level, layout); - blocks[data_disks] = stripes[diskP]; - block_index_for_slot[diskP] = data_disks; - blocks[data_disks+1] = stripes[diskQ]; - block_index_for_slot[diskQ] = data_disks+1; + block_index_for_slot[-2] = diskQ; + blocks[-2] = stripes[diskQ]; + + if (!is_ddf(layout)) { + /* The syndrome-order of disks starts immediately after 'Q', + * but skips P */ + diskD = diskQ; + for (i = 0 ; i < data_disks ; i++) { + diskD = diskD + 1; + if (diskD >= raid_disks) + diskD = 0; + if (diskD == diskP) + diskD += 1; + if (diskD >= raid_disks) + diskD = 0; + blocks[i] = stripes[diskD]; + block_index_for_slot[i] = diskD; + } + } else { + /* The syndrome-order exactly follows raid-disk + * numbers, with ZERO in place of P and Q + */ + for (i = 0 ; i < raid_disks; i++) { + if (i == diskP || i == diskQ) { + blocks[i] = zero; + block_index_for_slot[i] = -1; + } else { + blocks[i] = stripes[i]; + block_index_for_slot[i] = i; + } + } + } + + qsyndrome(p, q, (uint8_t**)blocks, syndrome_disks, chunk_size); raid6_collect(chunk_size, p, q, stripes[diskP], stripes[diskQ], results); raid6_stats(disk, results, raid_disks, chunk_size); for(j = 0; j < (chunk_size >> CHECK_PAGE_BITS); j++) { - if(disk[j] >= -2) { - disk[j] = geo_map(disk[j], start, raid_disks, level, layout); - } - if(disk[j] >= 0) { - printf("Error detected at stripe %llu, page %d: possible failed disk slot: %d --> %s\n", - start, j, disk[j], name[disk[j]]); - } - if(disk[j] == -65535) { + int role = disk[j]; + if (role >= -2) { + int slot = block_index_for_slot[role]; + if (slot >= 0) + printf("Error detected at stripe %llu, page %d: possible failed disk slot %d: %d --> %s\n", + start, j, role, slot, name[slot]); + else + printf("Error detected at stripe %llu, page %d: failed slot %d should be zeros\n", + start, j, role); + } else if(disk[j] == -65535) { printf("Error detected at stripe %llu, page %d: disk slot unknown\n", start, j); } } if(repair == AUTO_REPAIR) { - err = autorepair(disk, diskP, diskQ, start, chunk_size, - name, raid_disks, data_disks, blocks_page, - blocks, p, stripes, block_index_for_slot, + err = autorepair(disk, start, chunk_size, + name, raid_disks, syndrome_disks, blocks_page, + blocks, p, block_index_for_slot, source, offsets); if(err != 0) { unlock_all_stripes(info, sig); @@ -416,22 +459,30 @@ int check_stripes(struct mdinfo *info, int *source, unsigned long long *offsets, } } - err = unlock_all_stripes(info, sig); - if(err != 0) { - goto exitCheck; - } - if(repair == MANUAL_REPAIR) { - err = manual_repair(diskP, diskQ, chunk_size, raid_disks, data_disks, - failed_disk1, failed_disk2, start, block_index_for_slot, - name, stripes, blocks, p, info, sig, - source, offsets); + int failed_slot1 = -1, failed_slot2 = -1; + for (i = -2; i < syndrome_disks; i++) { + if (block_index_for_slot[i] == failed_disk1) + failed_slot1 = i; + if (block_index_for_slot[i] == failed_disk2) + failed_slot2 = i; + } + err = manual_repair(chunk_size, syndrome_disks, + failed_slot1, failed_slot2, + start, block_index_for_slot, + name, stripes, blocks, p, + source, offsets); if(err == -1) { unlock_all_stripes(info, sig); goto exitCheck; } } + err = unlock_all_stripes(info, sig); + if(err != 0) { + goto exitCheck; + } + length--; start++; } @@ -440,9 +491,9 @@ exitCheck: free(stripe_buf); free(stripes); - free(blocks); - free(blocks_page); - free(block_index_for_slot); + free(blocks-2); + free(blocks_page-2); + free(block_index_for_slot-2); free(p); free(q); free(results); @@ -626,7 +677,7 @@ int main(int argc, char *argv[]) if(disk_slot >= 0) { disk_name[disk_slot] = map_dev(comp->disk.major, comp->disk.minor, 0); offsets[disk_slot] = comp->data_offset * 512; - fds[disk_slot] = open(disk_name[disk_slot], O_RDWR | O_SYNC); + fds[disk_slot] = open(disk_name[disk_slot], O_RDWR | O_DIRECT); if (fds[disk_slot] < 0) { perror(disk_name[disk_slot]); fprintf(stderr,"%s: cannot open %s\n", prg, disk_name[disk_slot]); @@ -642,8 +693,7 @@ int main(int argc, char *argv[]) raid_disks, chunk_size, level, layout, start, length, disk_name, repair, failed_disk1, failed_disk2); if (rv != 0) { - fprintf(stderr, - "%s: check_stripes returned %d\n", prg, rv); + fprintf(stderr, "%s: check_stripes returned %d\n", prg, rv); exit_err = 7; goto exitHere; } @@ -194,7 +194,8 @@ int geo_map(int block, unsigned long long stripe, int raid_disks, } return -1; } -static int is_ddf(int layout) + +int is_ddf(int layout) { switch (layout) { @@ -344,16 +345,28 @@ void ensure_zero_has_size(int chunk_size) /* Following was taken from linux/drivers/md/raid6recov.c */ /* Recover two failed data blocks. */ + void raid6_2data_recov(int disks, size_t bytes, int faila, int failb, - uint8_t **ptrs) + uint8_t **ptrs, int neg_offset) { uint8_t *p, *q, *dp, *dq; uint8_t px, qx, db; const uint8_t *pbmul; /* P multiplier table for B data */ const uint8_t *qmul; /* Q multiplier table (for both) */ - p = ptrs[disks-2]; - q = ptrs[disks-1]; + if (faila > failb) { + int t = faila; + faila = failb; + failb = t; + } + + if (neg_offset) { + p = ptrs[-1]; + q = ptrs[-2]; + } else { + p = ptrs[disks-2]; + q = ptrs[disks-1]; + } /* Compute syndrome with zero for the missing data pages Use the dead data pages as temporary storage for @@ -384,13 +397,19 @@ void raid6_2data_recov(int disks, size_t bytes, int faila, int failb, } /* Recover failure of one data block plus the P block */ -void raid6_datap_recov(int disks, size_t bytes, int faila, uint8_t **ptrs) +void raid6_datap_recov(int disks, size_t bytes, int faila, uint8_t **ptrs, + int neg_offset) { uint8_t *p, *q, *dq; const uint8_t *qmul; /* Q multiplier table */ - p = ptrs[disks-2]; - q = ptrs[disks-1]; + if (neg_offset) { + p = ptrs[-1]; + q = ptrs[-2]; + } else { + p = ptrs[disks-2]; + q = ptrs[disks-1]; + } /* Compute syndrome with zero for the missing data page Use the dead data page as temporary storage for delta q */ @@ -415,7 +434,7 @@ void raid6_datap_recov(int disks, size_t bytes, int faila, uint8_t **ptrs) /* Try to find out if a specific disk has a problem */ int raid6_check_disks(int data_disks, int start, int chunk_size, int level, int layout, int diskP, int diskQ, - char *p, char *q, char **stripes) + uint8_t *p, uint8_t *q, char **stripes) { int i; int data_id, diskD; @@ -636,16 +655,11 @@ int save_stripes(int *source, unsigned long long *offsets, if (fblock[1] == data_disks) /* One data failed, and parity failed */ raid6_datap_recov(syndrome_disks+2, chunk_size, - fdisk[0], bufs); + fdisk[0], bufs, 0); else { - if (fdisk[0] > fdisk[1]) { - int t = fdisk[0]; - fdisk[0] = fdisk[1]; - fdisk[1] = t; - } /* Two data blocks failed, P,Q OK */ raid6_2data_recov(syndrome_disks+2, chunk_size, - fdisk[0], fdisk[1], bufs); + fdisk[0], fdisk[1], bufs, 0); } } if (dest) { @@ -813,8 +827,8 @@ int test_stripes(int *source, unsigned long long *offsets, char *stripe_buf = xmalloc(raid_disks * chunk_size); char **stripes = xmalloc(raid_disks * sizeof(char*)); char **blocks = xmalloc(raid_disks * sizeof(char*)); - char *p = xmalloc(chunk_size); - char *q = xmalloc(chunk_size); + uint8_t *p = xmalloc(chunk_size); + uint8_t *q = xmalloc(chunk_size); int i; int diskP, diskQ; @@ -882,7 +896,8 @@ unsigned long long getnum(char *str, char **err) return rv; } -main(int argc, char *argv[]) +char const Name[] = "test_restripe"; +int main(int argc, char *argv[]) { /* save/restore file raid_disks chunk_size level layout start length devices... */ @@ -898,8 +913,7 @@ main(int argc, char *argv[]) char *err = NULL; if (argc < 10) { - fprintf(stderr, "Usage: test_stripe save/restore file raid_disks" - " chunk_size level layout start length devices...\n"); + fprintf(stderr, "Usage: test_stripe save/restore file raid_disks chunk_size level layout start length devices...\n"); exit(1); } if (strcmp(argv[1], "save")==0) @@ -22,7 +22,7 @@ #include <stdio.h> -#if defined HAVE_LIMITS_H || _LIBC +#if 1 /* defined HAVE_LIMITS_H || _LIBC */ # include <limits.h> #endif @@ -33,9 +33,9 @@ the resulting executable. Locally running cross-compiled executables is usually not possible. */ -#ifdef _LIBC -# include <sys/types.h> -typedef u_int32_t sha1_uint32; +#if 1 /* def _LIBC */ +# include <stdint.h> +typedef uint32_t sha1_uint32; typedef uintptr_t sha1_uintptr; #else # define INT_MAX_32_BITS 2147483647 diff --git a/super-ddf.c b/super-ddf.c index bc0ce2c0..faaf0a7c 100644 --- a/super-ddf.c +++ b/super-ddf.c @@ -541,15 +541,15 @@ static int init_super_ddf_bvd(struct supertype *st, static void pr_state(struct ddf_super *ddf, const char *msg) { unsigned int i; - dprintf("%s/%s: ", __func__, msg); + dprintf("%s: ", msg); for (i = 0; i < be16_to_cpu(ddf->active->max_vd_entries); i++) { if (all_ff(ddf->virt->entries[i].guid)) continue; - dprintf("%u(s=%02x i=%02x) ", i, + dprintf_cont("%u(s=%02x i=%02x) ", i, ddf->virt->entries[i].state, ddf->virt->entries[i].init_state); } - dprintf("\n"); + dprintf_cont("\n"); } #else static void pr_state(const struct ddf_super *ddf, const char *msg) {} @@ -825,11 +825,11 @@ static int load_ddf_header(int fd, unsigned long long lba, return 0; if (!be32_eq(hdr->magic, DDF_HEADER_MAGIC)) { - pr_err("%s: bad header magic\n", __func__); + pr_err("bad header magic\n"); return 0; } if (!be32_eq(calc_crc(hdr, 512), hdr->crc)) { - pr_err("%s: bad CRC\n", __func__); + pr_err("bad CRC\n"); return 0; } if (memcmp(anchor->guid, hdr->guid, DDF_GUID_LEN) != 0 || @@ -839,7 +839,7 @@ static int load_ddf_header(int fd, unsigned long long lba, hdr->type != type || memcmp(anchor->pad2, hdr->pad2, 512 - offsetof(struct ddf_header, pad2)) != 0) { - pr_err("%s: header mismatch\n", __func__); + pr_err("header mismatch\n"); return 0; } @@ -918,8 +918,7 @@ static int load_ddf_headers(int fd, struct ddf_super *super, char *devname) if (memcmp(super->anchor.revision, DDF_REVISION_0, 8) != 0 && memcmp(super->anchor.revision, DDF_REVISION_2, 8) != 0) { if (devname) - pr_err("can only support super revision" - " %.8s and earlier, not %.8s on %s\n", + pr_err("can only support super revision %.8s and earlier, not %.8s on %s\n", DDF_REVISION_2, super->anchor.revision,devname); return 2; } @@ -928,8 +927,7 @@ static int load_ddf_headers(int fd, struct ddf_super *super, char *devname) dsize >> 9, 1, &super->primary, &super->anchor) == 0) { if (devname) - pr_err("Failed to load primary DDF header " - "on %s\n", devname); + pr_err("Failed to load primary DDF header on %s\n", devname); } else super->active = &super->primary; @@ -1055,8 +1053,7 @@ static int load_ddf_local(int fd, struct ddf_super *super, if (posix_memalign((void**)&dl, 512, sizeof(*dl) + (super->max_part) * sizeof(dl->vlist[0])) != 0) { - pr_err("%s could not allocate disk info buffer\n", - __func__); + pr_err("could not allocate disk info buffer\n"); return 1; } @@ -1116,8 +1113,7 @@ static int load_ddf_local(int fd, struct ddf_super *super, continue; if (posix_memalign((void**)&dl->spare, 512, super->conf_rec_len*512) != 0) { - pr_err("%s could not allocate spare info buf\n", - __func__); + pr_err("could not allocate spare info buf\n"); return 1; } @@ -1148,16 +1144,14 @@ static int load_ddf_local(int fd, struct ddf_super *super, if (posix_memalign((void**)&vcl, 512, (super->conf_rec_len*512 + offsetof(struct vcl, conf))) != 0) { - pr_err("%s could not allocate vcl buf\n", - __func__); + pr_err("could not allocate vcl buf\n"); return 1; } vcl->next = super->conflist; vcl->block_sizes = NULL; /* FIXME not for CONCAT */ vcl->conf.sec_elmnt_count = vd->sec_elmnt_count; if (alloc_other_bvds(super, vcl) != 0) { - pr_err("%s could not allocate other bvds\n", - __func__); + pr_err("could not allocate other bvds\n"); free(vcl); return 1; }; @@ -1193,15 +1187,13 @@ static int load_super_ddf(struct supertype *st, int fd, /* 32M is a lower bound */ if (dsize <= 32*1024*1024) { if (devname) - pr_err("%s is too small for ddf: " - "size is %llu sectors.\n", + pr_err("%s is too small for ddf: size is %llu sectors.\n", devname, dsize>>9); return 1; } if (dsize & 511) { if (devname) - pr_err("%s is an odd size for ddf: " - "size is %llu bytes.\n", + pr_err("%s is an odd size for ddf: size is %llu bytes.\n", devname, dsize); return 1; } @@ -1227,8 +1219,7 @@ static int load_super_ddf(struct supertype *st, int fd, if (rv) { if (devname) - pr_err("Failed to load all information " - "sections on %s\n", devname); + pr_err("Failed to load all information sections on %s\n", devname); free(super); return rv; } @@ -1237,8 +1228,7 @@ static int load_super_ddf(struct supertype *st, int fd, if (rv) { if (devname) - pr_err("Failed to load all information " - "sections on %s\n", devname); + pr_err("Failed to load all information sections on %s\n", devname); free(super); return rv; } @@ -1865,8 +1855,8 @@ static int find_index_in_bvd(const struct ddf_super *ddf, j++; } } - dprintf("%s: couldn't find BVD member %u (total %u)\n", - __func__, n, be16_to_cpu(conf->prim_elmnt_count)); + dprintf("couldn't find BVD member %u (total %u)\n", + n, be16_to_cpu(conf->prim_elmnt_count)); return 0; } @@ -1897,8 +1887,8 @@ static struct vd_config *find_vdcr(struct ddf_super *ddf, unsigned int inst, goto bad; } if (v->other_bvds == NULL) { - pr_err("%s: BUG: other_bvds is NULL, nsec=%u\n", - __func__, conf->sec_elmnt_count); + pr_err("BUG: other_bvds is NULL, nsec=%u\n", + conf->sec_elmnt_count); goto bad; } nsec = n / be16_to_cpu(conf->prim_elmnt_count); @@ -1915,13 +1905,13 @@ static struct vd_config *find_vdcr(struct ddf_super *ddf, unsigned int inst, if (!find_index_in_bvd(ddf, conf, n - nsec*conf->sec_elmnt_count, n_bvd)) goto bad; - dprintf("%s: found disk %u as member %u in bvd %d of array %u\n" - , __func__, n, *n_bvd, ibvd, inst); + dprintf("found disk %u as member %u in bvd %d of array %u\n", + n, *n_bvd, ibvd, inst); *vcl = v; return conf; } bad: - pr_err("%s: Could't find disk %d in array %u\n", __func__, n, inst); + pr_err("Could't find disk %d in array %u\n", n, inst); return NULL; } #endif @@ -2342,7 +2332,7 @@ static int init_super_ddf(struct supertype *st, data_offset); if (posix_memalign((void**)&ddf, 512, sizeof(*ddf)) != 0) { - pr_err("%s could not allocate superblock\n", __func__); + pr_err("could not allocate superblock\n"); return 0; } memset(ddf, 0, sizeof(*ddf)); @@ -2477,7 +2467,7 @@ static int init_super_ddf(struct supertype *st, strcpy((char*)ddf->controller.vendor_data, homehost); if (posix_memalign((void**)&pd, 512, pdsize) != 0) { - pr_err("%s could not allocate pd\n", __func__); + pr_err("could not allocate pd\n"); return 0; } ddf->phys = pd; @@ -2493,7 +2483,7 @@ static int init_super_ddf(struct supertype *st, memset(pd->entries[i].guid, 0xff, DDF_GUID_LEN); if (posix_memalign((void**)&vd, 512, vdsize) != 0) { - pr_err("%s could not allocate vd\n", __func__); + pr_err("could not allocate vd\n"); return 0; } ddf->virt = vd; @@ -2672,7 +2662,7 @@ static int init_super_ddf_bvd(struct supertype *st, /* Now create a new vd_config */ if (posix_memalign((void**)&vcl, 512, (offsetof(struct vcl, conf) + ddf->conf_rec_len * 512)) != 0) { - pr_err("%s could not allocate vd_config\n", __func__); + pr_err("could not allocate vd_config\n"); return 0; } vcl->vcnum = venum; @@ -2687,15 +2677,14 @@ static int init_super_ddf_bvd(struct supertype *st, vc->chunk_shift = chunk_to_shift(info->chunk_size); if (layout_md2ddf(info, vc) == -1 || be16_to_cpu(vc->prim_elmnt_count) > ddf->mppe) { - pr_err("%s: unsupported RAID level/layout %d/%d with %d disks\n", - __func__, info->level, info->layout, info->raid_disks); + pr_err("unsupported RAID level/layout %d/%d with %d disks\n", + info->level, info->layout, info->raid_disks); free(vcl); return 0; } vc->sec_elmnt_seq = 0; if (alloc_other_bvds(ddf, vcl) != 0) { - pr_err("%s could not allocate other bvds\n", - __func__); + pr_err("could not allocate other bvds\n"); free(vcl); return 0; } @@ -2814,8 +2803,8 @@ static void add_to_super_ddf_bvd(struct supertype *st, cpu_to_be16(DDF_Global_Spare)); be16_set(ddf->phys->entries[dl->pdnum].type, cpu_to_be16(DDF_Active_in_VD)); - dprintf("%s: added disk %d/%08x to VD %d/%s as disk %d\n", - __func__, dl->pdnum, be32_to_cpu(dl->disk.refnum), + dprintf("added disk %d/%08x to VD %d/%s as disk %d\n", + dl->pdnum, be32_to_cpu(dl->disk.refnum), ddf->currentconf->vcnum, guid_str(vc->guid), dk->raid_disk); ddf_set_updates_pending(ddf, vc); @@ -2846,15 +2835,14 @@ static void _set_config_size(struct phys_disk_entry *pde, const struct dl *dl) if (t < cfs) { __u64 wsp = cfs - t; if (wsp > 1024*1024*2ULL && wsp > dl->size / 16) { - pr_err("%s: %x:%x: workspace size 0x%llx too big, ignoring\n", - __func__, dl->major, dl->minor, - (unsigned long long)wsp); + pr_err("%x:%x: workspace size 0x%llx too big, ignoring\n", + dl->major, dl->minor, (unsigned long long)wsp); } else cfs = t; } pde->config_size = cpu_to_be64(cfs); - dprintf("%s: %x:%x config_size %llx, DDF structure is %llx blocks\n", - __func__, dl->major, dl->minor, + dprintf("%x:%x config_size %llx, DDF structure is %llx blocks\n", + dl->major, dl->minor, (unsigned long long)cfs, (unsigned long long)(dl->size-cfs)); } @@ -2886,23 +2874,20 @@ static int add_to_super_ddf(struct supertype *st, fstat(fd, &stb); n = find_unused_pde(ddf); if (n == DDF_NOTFOUND) { - pr_err("%s: No free slot in array, cannot add disk\n", - __func__); + pr_err("No free slot in array, cannot add disk\n"); return 1; } pde = &ddf->phys->entries[n]; get_dev_size(fd, NULL, &size); if (size <= 32*1024*1024) { - pr_err("%s: device size must be at least 32MB\n", - __func__); + pr_err("device size must be at least 32MB\n"); return 1; } size >>= 9; if (posix_memalign((void**)&dd, 512, sizeof(*dd) + sizeof(dd->vlist[0]) * ddf->max_part) != 0) { - pr_err("%s could allocate buffer for new disk, aborting\n", - __func__); + pr_err("could allocate buffer for new disk, aborting\n"); return 1; } dd->major = major(stb.st_rdev); @@ -3173,6 +3158,7 @@ static int _write_super_to_disk(struct ddf_super *ddf, struct dl *d) memcpy(&ddf->primary, &ddf->anchor, 512); memcpy(&ddf->secondary, &ddf->anchor, 512); + ddf->anchor.type = DDF_HEADER_ANCHOR; ddf->anchor.openflag = 0xFF; /* 'open' means nothing */ ddf->anchor.seq = cpu_to_be32(0xFFFFFFFF); /* no sequencing in anchor */ ddf->anchor.crc = calc_crc(&ddf->anchor, 512); @@ -3439,8 +3425,7 @@ static int validate_geometry_ddf(struct supertype *st, close(fd); /* Just a bare device, no good to us */ if (verbose) - pr_err("ddf: Cannot create this array " - "on device %s - a container is required.\n", + pr_err("ddf: Cannot create this array on device %s - a container is required.\n", dev); return 0; } @@ -3556,8 +3541,7 @@ static int validate_geometry_ddf_bvd(struct supertype *st, } if (dcnt < raiddisks) { if (verbose) - pr_err("ddf: Not enough devices with " - "space for this array (%d < %d)\n", + pr_err("ddf: Not enough devices with space for this array (%d < %d)\n", dcnt, raiddisks); return 0; } @@ -3575,8 +3559,7 @@ static int validate_geometry_ddf_bvd(struct supertype *st, } if (!dl) { if (verbose) - pr_err("ddf: %s is not in the " - "same DDF set\n", + pr_err("ddf: %s is not in the same DDF set\n", dev); return 0; } @@ -3925,8 +3908,7 @@ static int store_super_ddf(struct supertype *st, int fd) int ofd, ret; if (fstat(fd, &sta) == -1 || !S_ISBLK(sta.st_mode)) { - pr_err("%s: file descriptor for invalid device\n", - __func__); + pr_err("file descriptor for invalid device\n"); return 1; } for (dl = ddf->dlist; dl; dl = dl->next) @@ -3934,7 +3916,7 @@ static int store_super_ddf(struct supertype *st, int fd) dl->minor == (int)minor(sta.st_rdev)) break; if (!dl) { - pr_err("%s: couldn't find disk %d/%d\n", __func__, + pr_err("couldn't find disk %d/%d\n", (int)major(sta.st_rdev), (int)minor(sta.st_rdev)); return 1; @@ -3988,7 +3970,7 @@ static int compare_super_ddf(struct supertype *st, struct supertype *tst) */ if (!be32_eq(first->active->seq, second->active->seq)) { - dprintf("%s: sequence number mismatch %u<->%u\n", __func__, + dprintf("sequence number mismatch %u<->%u\n", be32_to_cpu(first->active->seq), be32_to_cpu(second->active->seq)); return 0; @@ -4010,7 +3992,7 @@ static int compare_super_ddf(struct supertype *st, struct supertype *tst) if (vl1->other_bvds != NULL && vl1->conf.sec_elmnt_seq != vl2->conf.sec_elmnt_seq) { - dprintf("%s: adding BVD %u\n", __func__, + dprintf("adding BVD %u\n", vl2->conf.sec_elmnt_seq); add_other_bvd(vl1, &vl2->conf, first->conf_rec_len*512); @@ -4021,8 +4003,7 @@ static int compare_super_ddf(struct supertype *st, struct supertype *tst) if (posix_memalign((void **)&vl1, 512, (first->conf_rec_len*512 + offsetof(struct vcl, conf))) != 0) { - pr_err("%s could not allocate vcl buf\n", - __func__); + pr_err("could not allocate vcl buf\n"); return 3; } @@ -4030,8 +4011,7 @@ static int compare_super_ddf(struct supertype *st, struct supertype *tst) vl1->block_sizes = NULL; memcpy(&vl1->conf, &vl2->conf, first->conf_rec_len*512); if (alloc_other_bvds(first, vl1) != 0) { - pr_err("%s could not allocate other bvds\n", - __func__); + pr_err("could not allocate other bvds\n"); free(vl1); return 3; } @@ -4040,7 +4020,7 @@ static int compare_super_ddf(struct supertype *st, struct supertype *tst) vl1->conf.guid, DDF_GUID_LEN)) break; vl1->vcnum = vd; - dprintf("%s: added config for VD %u\n", __func__, vl1->vcnum); + dprintf("added config for VD %u\n", vl1->vcnum); first->conflist = vl1; } @@ -4054,8 +4034,7 @@ static int compare_super_ddf(struct supertype *st, struct supertype *tst) if (posix_memalign((void **)&dl1, 512, sizeof(*dl1) + (first->max_part) * sizeof(dl1->vlist[0])) != 0) { - pr_err("%s could not allocate disk info buffer\n", - __func__); + pr_err("could not allocate disk info buffer\n"); return 3; } memcpy(dl1, dl2, sizeof(*dl1)); @@ -4070,8 +4049,7 @@ static int compare_super_ddf(struct supertype *st, struct supertype *tst) if (dl2->spare) { if (posix_memalign((void **)&dl1->spare, 512, first->conf_rec_len*512) != 0) { - pr_err("%s could not allocate spare info buf\n", - __func__); + pr_err("could not allocate spare info buf\n"); return 3; } memcpy(dl1->spare, dl2->spare, first->conf_rec_len*512); @@ -4090,7 +4068,7 @@ static int compare_super_ddf(struct supertype *st, struct supertype *tst) } } first->dlist = dl1; - dprintf("%s: added disk %d: %08x\n", __func__, dl1->pdnum, + dprintf("added disk %d: %08x\n", dl1->pdnum, be32_to_cpu(dl1->disk.refnum)); } @@ -4113,10 +4091,10 @@ static int ddf_open_new(struct supertype *c, struct active_array *a, char *inst) static const char faulty[] = "faulty"; if (all_ff(ddf->virt->entries[n].guid)) { - pr_err("%s: subarray %d doesn't exist\n", __func__, n); + pr_err("subarray %d doesn't exist\n", n); return -ENODEV; } - dprintf("%s: new subarray %d, GUID: %s\n", __func__, n, + dprintf("new subarray %d, GUID: %s\n", n, guid_str(ddf->virt->entries[n].guid)); for (dev = a->info.devs; dev; dev = dev->next) { for (dl = ddf->dlist; dl; dl = dl->next) @@ -4124,16 +4102,15 @@ static int ddf_open_new(struct supertype *c, struct active_array *a, char *inst) dl->minor == dev->disk.minor) break; if (!dl || dl->pdnum < 0) { - pr_err("%s: device %d/%d of subarray %d not found in meta data\n", - __func__, dev->disk.major, dev->disk.minor, n); + pr_err("device %d/%d of subarray %d not found in meta data\n", + dev->disk.major, dev->disk.minor, n); return -1; } if ((be16_to_cpu(ddf->phys->entries[dl->pdnum].state) & (DDF_Online|DDF_Missing|DDF_Failed)) != DDF_Online) { - pr_err("%s: new subarray %d contains broken device %d/%d (%02x)\n", - __func__, n, dl->major, dl->minor, - be16_to_cpu( - ddf->phys->entries[dl->pdnum].state)); + pr_err("new subarray %d contains broken device %d/%d (%02x)\n", + n, dl->major, dl->minor, + be16_to_cpu(ddf->phys->entries[dl->pdnum].state)); if (write(dev->state_fd, faulty, sizeof(faulty)-1) != sizeof(faulty) - 1) pr_err("Write to state_fd failed\n"); @@ -4357,7 +4334,7 @@ static void ddf_set_disk(struct active_array *a, int n, int state) struct dl *dl; int update = 0; - dprintf("%s: %d to %x\n", __func__, n, state); + dprintf("%d to %x\n", n, state); if (vc == NULL) { dprintf("ddf: cannot find instance %d!!\n", inst); return; @@ -4367,8 +4344,7 @@ static void ddf_set_disk(struct active_array *a, int n, int state) if (mdi->disk.raid_disk == n) break; if (!mdi) { - pr_err("%s: cannot find raid disk %d\n", - __func__, n); + pr_err("cannot find raid disk %d\n", n); return; } @@ -4379,9 +4355,8 @@ static void ddf_set_disk(struct active_array *a, int n, int state) mdi->disk.minor == dl->minor) break; if (!dl) { - pr_err("%s: cannot find raid disk %d (%d/%d)\n", - __func__, n, - mdi->disk.major, mdi->disk.minor); + pr_err("cannot find raid disk %d (%d/%d)\n", + n, mdi->disk.major, mdi->disk.minor); return; } @@ -4389,11 +4364,11 @@ static void ddf_set_disk(struct active_array *a, int n, int state) if (pd < 0 || pd != dl->pdnum) { /* disk doesn't currently exist or has changed. * If it is now in_sync, insert it. */ - dprintf("%s: phys disk not found for %d: %d/%d ref %08x\n", - __func__, dl->pdnum, dl->major, dl->minor, + dprintf("phys disk not found for %d: %d/%d ref %08x\n", + dl->pdnum, dl->major, dl->minor, be32_to_cpu(dl->disk.refnum)); - dprintf("%s: array %u disk %u ref %08x pd %d\n", - __func__, inst, n_bvd, + dprintf("array %u disk %u ref %08x pd %d\n", + inst, n_bvd, be32_to_cpu(vc->phys_refnum[n_bvd]), pd); if ((state & DS_INSYNC) && ! (state & DS_FAULTY) && dl->pdnum >= 0) { @@ -4480,13 +4455,11 @@ static int _kill_subarray_ddf(struct ddf_super *ddf, const char *guid) unsigned int vdnum, i; vdnum = find_vde_by_guid(ddf, guid); if (vdnum == DDF_NOTFOUND) { - pr_err("%s: could not find VD %s\n", __func__, - guid_str(guid)); + pr_err("could not find VD %s\n", guid_str(guid)); return -1; } if (del_from_conflist(&ddf->conflist, guid) == 0) { - pr_err("%s: could not find conf %s\n", __func__, - guid_str(guid)); + pr_err("could not find conf %s\n", guid_str(guid)); return -1; } for (dl = ddf->dlist; dl; dl = dl->next) @@ -4496,7 +4469,7 @@ static int _kill_subarray_ddf(struct ddf_super *ddf, const char *guid) DDF_GUID_LEN)) dl->vlist[i] = NULL; memset(ddf->virt->entries[vdnum].guid, 0xff, DDF_GUID_LEN); - dprintf("%s: deleted %s\n", __func__, guid_str(guid)); + dprintf("deleted %s\n", guid_str(guid)); return 0; } @@ -4513,14 +4486,13 @@ static int kill_subarray_ddf(struct supertype *st) ddf->currentconf = NULL; if (!victim) { - pr_err("%s: nothing to kill\n", __func__); + pr_err("nothing to kill\n"); return -1; } conf = &victim->conf; vdnum = find_vde_by_guid(ddf, conf->guid); if (vdnum == DDF_NOTFOUND) { - pr_err("%s: could not find VD %s\n", __func__, - guid_str(conf->guid)); + pr_err("could not find VD %s\n", guid_str(conf->guid)); return -1; } if (st->update_tail) { @@ -4529,8 +4501,7 @@ static int kill_subarray_ddf(struct supertype *st) + sizeof(struct virtual_entry); vd = xmalloc(len); if (vd == NULL) { - pr_err("%s: failed to allocate %d bytes\n", __func__, - len); + pr_err("failed to allocate %d bytes\n", len); return -1; } memset(vd, 0 , len); @@ -4565,7 +4536,7 @@ static void copy_matching_bvd(struct ddf_super *ddf, return; } } - pr_err("%s: no match for BVD %d of %s in update\n", __func__, + pr_err("no match for BVD %d of %s in update\n", conf->sec_elmnt_seq, guid_str(conf->guid)); } @@ -4637,8 +4608,8 @@ static void ddf_process_virt_update(struct supertype *st, } else { ent = find_vde_by_guid(ddf, vd->entries[0].guid); if (ent != DDF_NOTFOUND) { - dprintf("%s: VD %s exists already in slot %d\n", - __func__, guid_str(vd->entries[0].guid), + dprintf("VD %s exists already in slot %d\n", + guid_str(vd->entries[0].guid), ent); return; } @@ -4650,8 +4621,8 @@ static void ddf_process_virt_update(struct supertype *st, cpu_to_be16( 1 + be16_to_cpu( ddf->virt->populated_vdes)); - dprintf("%s: added VD %s in slot %d(s=%02x i=%02x)\n", - __func__, guid_str(vd->entries[0].guid), ent, + dprintf("added VD %s in slot %d(s=%02x i=%02x)\n", + guid_str(vd->entries[0].guid), ent, ddf->virt->entries[ent].state, ddf->virt->entries[ent].init_state); } @@ -4788,15 +4759,15 @@ static void ddf_process_conf_update(struct supertype *st, vc = (struct vd_config*)update->buf; len = ddf->conf_rec_len * 512; if ((unsigned int)update->len != len * vc->sec_elmnt_count) { - pr_err("%s: %s: insufficient data (%d) for %u BVDs\n", - __func__, guid_str(vc->guid), update->len, + pr_err("%s: insufficient data (%d) for %u BVDs\n", + guid_str(vc->guid), update->len, vc->sec_elmnt_count); return; } for (vcl = ddf->conflist; vcl ; vcl = vcl->next) if (memcmp(vcl->conf.guid, vc->guid, DDF_GUID_LEN) == 0) break; - dprintf("%s: conf update for %s (%s)\n", __func__, + dprintf("conf update for %s (%s)\n", guid_str(vc->guid), (vcl ? "old" : "new")); if (vcl) { /* An update, just copy the phys_refnum and lba_offset @@ -4964,7 +4935,7 @@ static int raid10_degraded(struct mdinfo *info) for (d = info->devs; d; d = d->next) { i = d->disk.raid_disk / n_prim; if (i >= n_bvds) { - pr_err("%s: BUG: invalid raid disk\n", __func__); + pr_err("BUG: invalid raid disk\n"); goto out; } if (d->state_fd > 0) @@ -4973,12 +4944,11 @@ static int raid10_degraded(struct mdinfo *info) ret = 2; for (i = 0; i < n_bvds; i++) if (!found[i]) { - dprintf("%s: BVD %d/%d failed\n", __func__, i, n_bvds); + dprintf("BVD %d/%d failed\n", i, n_bvds); ret = 0; goto out; } else if (found[i] < n_prim) { - dprintf("%s: BVD %d/%d degraded\n", __func__, i, - n_bvds); + dprintf("BVD %d/%d degraded\n", i, n_bvds); ret = 1; } out: @@ -5027,7 +4997,7 @@ static struct mdinfo *ddf_activate_spare(struct active_array *a, working ++; } - dprintf("%s: working=%d (%d) level=%d\n", __func__, working, + dprintf("working=%d (%d) level=%d\n", working, a->info.array.raid_disks, a->info.array.level); if (working == a->info.array.raid_disks) @@ -5212,8 +5182,8 @@ static struct mdinfo *ddf_activate_spare(struct active_array *a, && dl->minor == di->disk.minor) break; if (!dl || dl->pdnum < 0) { - pr_err("%s: BUG: can't find disk %d (%d/%d)\n", - __func__, di->disk.raid_disk, + pr_err("BUG: can't find disk %d (%d/%d)\n", + di->disk.raid_disk, di->disk.major, di->disk.minor); return NULL; } diff --git a/super-gpt.c b/super-gpt.c index 6a2f749e..1a2adce0 100644 --- a/super-gpt.c +++ b/super-gpt.c @@ -77,8 +77,7 @@ static int load_gpt(struct supertype *st, int fd, char *devname) free_gpt(st); if (posix_memalign((void**)&super, 4096, 32*512) != 0) { - pr_err("%s could not allocate superblock\n", - __func__); + pr_err("could not allocate superblock\n"); return 1; } diff --git a/super-intel.c b/super-intel.c index e28ac7d3..90b7b6de 100644 --- a/super-intel.c +++ b/super-intel.c @@ -509,7 +509,9 @@ struct imsm_update_add_remove_disk { static const char *_sys_dev_type[] = { [SYS_DEV_UNKNOWN] = "Unknown", [SYS_DEV_SAS] = "SAS", - [SYS_DEV_SATA] = "SATA" + [SYS_DEV_SATA] = "SATA", + [SYS_DEV_NVME] = "NVMe", + [SYS_DEV_VMD] = "VMD" }; const char *get_sys_dev_type(enum sys_dev_type type) @@ -555,11 +557,30 @@ static int attach_hba_to_super(struct intel_super *super, struct sys_dev *device if (super->hba == NULL) { super->hba = alloc_intel_hba(device); return 1; - } else - /* IMSM metadata disallows to attach disks to multiple - * controllers. - */ + } + + hba = super->hba; + /* Intel metadata allows for all disks attached to the same type HBA. + * Do not support HBA types mixing + */ + if (device->type != hba->type) + return 2; + + /* Always forbid spanning between VMD domains (seen as different controllers by mdadm) */ + if (device->type == SYS_DEV_VMD && !path_attached_to_hba(device->path, hba->path)) + return 2; + + /* Multiple same type HBAs can be used if they share the same OROM */ + const struct imsm_orom *device_orom = get_orom_by_device_id(device->dev_id); + + if (device_orom != super->orom) return 2; + + while (hba->next) + hba = hba->next; + + hba->next = alloc_intel_hba(device); + return 1; } static struct sys_dev* find_disk_attached_hba(int fd, const char *devname) @@ -1370,7 +1391,7 @@ static int imsm_check_attributes(__u32 attributes) } if (not_supported) - dprintf(Name "(IMSM): Unknown attributes : %x\n", not_supported); + dprintf("(IMSM): Unknown attributes : %x\n", not_supported); ret_val = 0; } @@ -1693,7 +1714,8 @@ static int ahci_enumerate_ports(const char *hba_path, int port_count, int host_b break; } *c = '\0'; - if (sscanf(&path[hba_len], "host%d", &port) == 1) + if ((sscanf(&path[hba_len], "ata%d", &port) == 1) || + ((sscanf(&path[hba_len], "host%d", &port) == 1))) port -= host_base; else { if (verbose > 0) { @@ -1744,6 +1766,57 @@ static int ahci_enumerate_ports(const char *hba_path, int port_count, int host_b return err; } +static int print_vmd_attached_devs(struct sys_dev *hba) +{ + struct dirent *ent; + DIR *dir; + char path[292]; + char link[256]; + char *c, *rp; + + if (hba->type != SYS_DEV_VMD) + return 1; + + /* scroll through /sys/dev/block looking for devices attached to + * this hba + */ + dir = opendir("/sys/bus/pci/drivers/nvme"); + for (ent = dir ? readdir(dir) : NULL; ent; ent = readdir(dir)) { + int n; + + /* is 'ent' a device? check that the 'subsystem' link exists and + * that its target matches 'bus' + */ + sprintf(path, "/sys/bus/pci/drivers/nvme/%s/subsystem", + ent->d_name); + n = readlink(path, link, sizeof(link)); + if (n < 0 || n >= (int)sizeof(link)) + continue; + link[n] = '\0'; + c = strrchr(link, '/'); + if (!c) + continue; + if (strncmp("pci", c+1, strlen("pci")) != 0) + continue; + + sprintf(path, "/sys/bus/pci/drivers/nvme/%s", ent->d_name); + /* if not a intel NVMe - skip it*/ + if (devpath_to_vendor(path) != 0x8086) + continue; + + rp = realpath(path, NULL); + if (!rp) + continue; + + if (path_attached_to_hba(rp, hba->path)) { + printf(" NVMe under VMD : %s\n", rp); + } + free(rp); + } + + return 0; +} + static void print_found_intel_controllers(struct sys_dev *elem) { for (; elem; elem = elem->next) { @@ -1752,7 +1825,14 @@ static void print_found_intel_controllers(struct sys_dev *elem) fprintf(stderr, "SATA "); else if (elem->type == SYS_DEV_SAS) fprintf(stderr, "SAS "); - fprintf(stderr, "RAID controller"); + else if (elem->type == SYS_DEV_NVME) + fprintf(stderr, "NVMe "); + + if (elem->type == SYS_DEV_VMD) + fprintf(stderr, "VMD domain"); + else + fprintf(stderr, "RAID controller"); + if (elem->pci_id) fprintf(stderr, " at %s", elem->pci_id); fprintf(stderr, ".\n"); @@ -1773,7 +1853,8 @@ static int ahci_get_port_count(const char *hba_path, int *port_count) for (ent = readdir(dir); ent; ent = readdir(dir)) { int host; - if (sscanf(ent->d_name, "host%d", &host) != 1) + if ((sscanf(ent->d_name, "ata%d", &host) != 1) && + ((sscanf(ent->d_name, "host%d", &host) != 1))) continue; if (*port_count == 0) host_base = host; @@ -1789,9 +1870,15 @@ static int ahci_get_port_count(const char *hba_path, int *port_count) static void print_imsm_capability(const struct imsm_orom *orom) { - printf(" Platform : Intel(R) Matrix Storage Manager\n"); - printf(" Version : %d.%d.%d.%d\n", orom->major_ver, orom->minor_ver, - orom->hotfix_ver, orom->build); + printf(" Platform : Intel(R) "); + if (orom->capabilities == 0 && orom->driver_features == 0) + printf("Matrix Storage Manager\n"); + else + printf("Rapid Storage Technology%s\n", + imsm_orom_is_enterprise(orom) ? " enterprise" : ""); + if (orom->major_ver || orom->minor_ver || orom->hotfix_ver || orom->build) + printf(" Version : %d.%d.%d.%d\n", orom->major_ver, + orom->minor_ver, orom->hotfix_ver, orom->build); printf(" RAID Levels :%s%s%s%s%s\n", imsm_orom_has_raid0(orom) ? " raid0" : "", imsm_orom_has_raid1(orom) ? " raid1" : "", @@ -1820,16 +1907,18 @@ static void print_imsm_capability(const struct imsm_orom *orom) printf(" 2TB disks :%s supported\n", (orom->attr & IMSM_OROM_ATTR_2TB_DISK)?"":" not"); printf(" Max Disks : %d\n", orom->tds); - printf(" Max Volumes : %d per array, %d per controller\n", - orom->vpa, orom->vphba); + printf(" Max Volumes : %d per array, %d per %s\n", + orom->vpa, orom->vphba, + imsm_orom_is_nvme(orom) ? "platform" : "controller"); return; } static void print_imsm_capability_export(const struct imsm_orom *orom) { printf("MD_FIRMWARE_TYPE=imsm\n"); - printf("IMSM_VERSION=%d.%d.%d.%d\n",orom->major_ver, orom->minor_ver, - orom->hotfix_ver, orom->build); + if (orom->major_ver || orom->minor_ver || orom->hotfix_ver || orom->build) + printf("IMSM_VERSION=%d.%d.%d.%d\n", orom->major_ver, orom->minor_ver, + orom->hotfix_ver, orom->build); printf("IMSM_SUPPORTED_RAID_LEVELS=%s%s%s%s%s\n", imsm_orom_has_raid0(orom) ? "raid0 " : "", imsm_orom_has_raid1(orom) ? "raid1 " : "", @@ -1873,7 +1962,6 @@ static int detail_platform_imsm(int verbose, int enumerate_only, char *controlle * platform capabilities. If raid support is disabled in the BIOS the * option-rom capability structure will not be available. */ - const struct imsm_orom *orom; struct sys_dev *list, *hba; int host_base = 0; int port_count = 0; @@ -1886,13 +1974,12 @@ static int detail_platform_imsm(int verbose, int enumerate_only, char *controlle if (!list) return 2; for (hba = list; hba; hba = hba->next) { - orom = find_imsm_capability(hba->type); - if (!orom) { - result = 2; + if (find_imsm_capability(hba)) { + result = 0; break; } else - result = 0; + result = 2; } return result; } @@ -1900,46 +1987,82 @@ static int detail_platform_imsm(int verbose, int enumerate_only, char *controlle list = find_intel_devices(); if (!list) { if (verbose > 0) - pr_err("no active Intel(R) RAID " - "controller found.\n"); + pr_err("no active Intel(R) RAID controller found.\n"); return 2; } else if (verbose > 0) print_found_intel_controllers(list); for (hba = list; hba; hba = hba->next) { - if (controller_path && (compare_paths(hba->path,controller_path) != 0)) + if (controller_path && (compare_paths(hba->path, controller_path) != 0)) continue; - orom = find_imsm_capability(hba->type); - if (!orom) + if (!find_imsm_capability(hba)) { + char buf[PATH_MAX]; pr_err("imsm capabilities not found for controller: %s (type %s)\n", - hba->path, get_sys_dev_type(hba->type)); - else { - result = 0; - print_imsm_capability(orom); + hba->type == SYS_DEV_VMD ? vmd_domain_to_controller(hba, buf) : hba->path, + get_sys_dev_type(hba->type)); + continue; + } + result = 0; + } + + if (controller_path && result == 1) { + pr_err("no active Intel(R) RAID controller found under %s\n", + controller_path); + return result; + } + + const struct orom_entry *entry; + + for (entry = orom_entries; entry; entry = entry->next) { + if (entry->type == SYS_DEV_VMD) { + for (hba = list; hba; hba = hba->next) { + if (hba->type == SYS_DEV_VMD) { + char buf[PATH_MAX]; + print_imsm_capability(&entry->orom); + printf(" I/O Controller : %s (%s)\n", + vmd_domain_to_controller(hba, buf), get_sys_dev_type(hba->type)); + print_vmd_attached_devs(hba); + printf("\n"); + } + } + continue; + } + + print_imsm_capability(&entry->orom); + if (entry->type == SYS_DEV_NVME) { + for (hba = list; hba; hba = hba->next) { + if (hba->type == SYS_DEV_NVME) + printf(" NVMe Device : %s\n", hba->path); + } + printf("\n"); + continue; + } + + struct devid_list *devid; + for (devid = entry->devid_list; devid; devid = devid->next) { + hba = device_by_id(devid->devid); + if (!hba) + continue; + printf(" I/O Controller : %s (%s)\n", hba->path, get_sys_dev_type(hba->type)); if (hba->type == SYS_DEV_SATA) { host_base = ahci_get_port_count(hba->path, &port_count); if (ahci_enumerate_ports(hba->path, port_count, host_base, verbose)) { if (verbose > 0) - pr_err("failed to enumerate " - "ports on SATA controller at %s.\n", hba->pci_id); + pr_err("failed to enumerate ports on SATA controller at %s.\n", hba->pci_id); result |= 2; } } } + printf("\n"); } - if (controller_path && result == 1) - pr_err("no active Intel(R) RAID " - "controller found under %s\n",controller_path); - return result; } static int export_detail_platform_imsm(int verbose, char *controller_path) { - const struct imsm_orom *orom; struct sys_dev *list, *hba; int result=1; @@ -1954,15 +2077,24 @@ static int export_detail_platform_imsm(int verbose, char *controller_path) for (hba = list; hba; hba = hba->next) { if (controller_path && (compare_paths(hba->path,controller_path) != 0)) continue; - orom = find_imsm_capability(hba->type); - if (!orom) { - if (verbose > 0) - pr_err("IMSM_DETAIL_PLATFORM_ERROR=NO_IMSM_CAPABLE_DEVICE_UNDER_%s\n",hba->path); + if (!find_imsm_capability(hba) && verbose > 0) { + char buf[PATH_MAX]; + pr_err("IMSM_DETAIL_PLATFORM_ERROR=NO_IMSM_CAPABLE_DEVICE_UNDER_%s\n", + hba->type == SYS_DEV_VMD ? vmd_domain_to_controller(hba, buf) : hba->path); } - else { - print_imsm_capability_export(orom); + else result = 0; + } + + const struct orom_entry *entry; + + for (entry = orom_entries; entry; entry = entry->next) { + if (entry->type == SYS_DEV_VMD) { + for (hba = list; hba; hba = hba->next) + print_imsm_capability_export(&entry->orom); + continue; } + print_imsm_capability_export(&entry->orom); } return result; @@ -2142,7 +2274,7 @@ static __u8 imsm_num_data_members(struct imsm_dev *dev, int second_map) case 5: return map->num_members - 1; default: - dprintf("%s: unsupported raid level\n", __func__); + dprintf("unsupported raid level\n"); return 0; } } @@ -2399,7 +2531,7 @@ static int imsm_create_metadata_checkpoint_update( int update_memory_size = 0; - dprintf("imsm_create_metadata_checkpoint_update(enter)\n"); + dprintf("(enter)\n"); if (u == NULL) return 0; @@ -2411,14 +2543,12 @@ static int imsm_create_metadata_checkpoint_update( *u = xcalloc(1, update_memory_size); if (*u == NULL) { - dprintf("error: cannot get memory for " - "imsm_create_metadata_checkpoint_update update\n"); + dprintf("error: cannot get memory\n"); return 0; } (*u)->type = update_general_migration_checkpoint; (*u)->curr_migr_unit = __le32_to_cpu(super->migr_rec->curr_migr_unit); - dprintf("imsm_create_metadata_checkpoint_update: prepared for %u\n", - (*u)->curr_migr_unit); + dprintf("prepared for %u\n", (*u)->curr_migr_unit); return update_memory_size; } @@ -2553,9 +2683,7 @@ static unsigned long long imsm_component_size_aligment_check(int level, */ component_size_alligment = component_size % (chunk_size/512); - dprintf("imsm_component_size_aligment_check(Level: %i, " - "chunk_size = %i, component_size = %llu), " - "component_size_alligment = %u\n", + dprintf("(Level: %i, chunk_size = %i, component_size = %llu), component_size_alligment = %u\n", level, chunk_size, component_size, component_size_alligment); @@ -2563,7 +2691,7 @@ static unsigned long long imsm_component_size_aligment_check(int level, dprintf("imsm: reported component size alligned from %llu ", component_size); component_size -= component_size_alligment; - dprintf("to %llu (%i).\n", + dprintf_cont("to %llu (%i).\n", component_size, component_size_alligment); } @@ -2703,8 +2831,7 @@ static void getinfo_super_imsm_volume(struct supertype *st, struct mdinfo *info, info->reshape_progress = blocks_per_unit * units; - dprintf("IMSM: General Migration checkpoint : %llu " - "(%llu) -> read reshape progress : %llu\n", + dprintf("IMSM: General Migration checkpoint : %llu (%llu) -> read reshape progress : %llu\n", (unsigned long long)units, (unsigned long long)blocks_per_unit, info->reshape_progress); @@ -2883,7 +3010,7 @@ static void getinfo_super_imsm(struct supertype *st, struct mdinfo *info, char * */ max_enough = max(max_enough, enough); } - dprintf("%s: enough: %d\n", __func__, max_enough); + dprintf("enough: %d\n", max_enough); info->container_enough = max_enough; if (super->disks) { @@ -3087,13 +3214,18 @@ static int compare_super_imsm(struct supertype *st, struct supertype *tst) * use the same Intel hba * If not on Intel hba at all, allow anything. */ - if (!check_env("IMSM_NO_PLATFORM")) { - if (first->hba && sec->hba && - strcmp(first->hba->path, sec->hba->path) != 0) { + if (!check_env("IMSM_NO_PLATFORM") && first->hba && sec->hba) { + if (first->hba->type != sec->hba->type) { fprintf(stderr, - "HBAs of devices does not match %s != %s\n", - first->hba ? first->hba->path : NULL, - sec->hba ? sec->hba->path : NULL); + "HBAs of devices do not match %s != %s\n", + get_sys_dev_type(first->hba->type), + get_sys_dev_type(sec->hba->type)); + return 3; + } + if (first->orom != sec->orom) { + fprintf(stderr, + "HBAs of devices do not match %s != %s\n", + first->hba->pci_id, sec->hba->pci_id); return 3; } } @@ -3568,8 +3700,7 @@ static int load_imsm_mpb(int fd, struct intel_super *super, char *devname) if (posix_memalign((void**)&anchor, 512, 512) != 0) { if (devname) - pr_err("Failed to allocate imsm anchor buffer" - " on %s\n", devname); + pr_err("Failed to allocate imsm anchor buffer on %s\n", devname); return 1; } if (read(fd, anchor, 512) != 512) { @@ -3606,7 +3737,7 @@ static int load_imsm_mpb(int fd, struct intel_super *super, char *devname) free(anchor); if (posix_memalign(&super->migr_rec_buf, 512, MIGR_REC_BUF_SIZE) != 0) { - pr_err("%s could not allocate migr_rec buffer\n", __func__); + pr_err("could not allocate migr_rec buffer\n"); free(super->buf); return 2; } @@ -3817,14 +3948,14 @@ static int find_intel_hba_capability(int fd, struct intel_super *super, char *de if (devname) { struct intel_hba *hba = super->hba; - pr_err("%s is attached to Intel(R) %s RAID " - "controller (%s),\n" - " but the container is assigned to Intel(R) " - "%s RAID controller (", + pr_err("%s is attached to Intel(R) %s %s (%s),\n" + " but the container is assigned to Intel(R) %s %s (", devname, - hba_name->path, + get_sys_dev_type(hba_name->type), + hba_name->type == SYS_DEV_VMD ? "domain" : "RAID controller", hba_name->pci_id ? : "Err!", - get_sys_dev_type(hba_name->type)); + get_sys_dev_type(super->hba->type), + hba->type == SYS_DEV_VMD ? "domain" : "RAID controller"); while (hba) { fprintf(stderr, "%s", hba->pci_id ? : "Err!"); @@ -3832,16 +3963,16 @@ static int find_intel_hba_capability(int fd, struct intel_super *super, char *de fprintf(stderr, ", "); hba = hba->next; } - - fprintf(stderr, ").\n"); - cont_err("Mixing devices attached to multiple controllers " - "is not allowed.\n"); + fprintf(stderr, ").\n" + " Mixing devices attached to different %s is not allowed.\n", + hba_name->type == SYS_DEV_VMD ? "VMD domains" : "controllers"); } return 2; } - super->orom = find_imsm_capability(hba_name->type); + super->orom = find_imsm_capability(hba_name); if (!super->orom) return 3; + return 0; } @@ -3906,8 +4037,8 @@ static int __prep_thunderdome(struct intel_super **table, int tbl_size, if (tbl_mpb->family_num == mpb->family_num) { if (tbl_mpb->check_sum == mpb->check_sum) { - dprintf("%s: mpb from %d:%d matches %d:%d\n", - __func__, super->disks->major, + dprintf("mpb from %d:%d matches %d:%d\n", + super->disks->major, super->disks->minor, table[i]->disks->major, table[i]->disks->minor); @@ -3924,8 +4055,8 @@ static int __prep_thunderdome(struct intel_super **table, int tbl_size, */ struct intel_disk *idisk; - dprintf("%s: mpb from %d:%d replaces %d:%d\n", - __func__, super->disks->major, + dprintf("mpb from %d:%d replaces %d:%d\n", + super->disks->major, super->disks->minor, table[i]->disks->major, table[i]->disks->minor); @@ -3953,8 +4084,8 @@ static int __prep_thunderdome(struct intel_super **table, int tbl_size, idisk->disk.status |= CONFIGURED_DISK; } - dprintf("%s: mpb from %d:%d prefer %d:%d\n", - __func__, super->disks->major, + dprintf("mpb from %d:%d prefer %d:%d\n", + super->disks->major, super->disks->minor, table[i]->disks->major, table[i]->disks->minor); @@ -4013,12 +4144,12 @@ validate_members(struct intel_super *super, struct intel_disk *disk_list, idisk->owner == IMSM_UNKNOWN_OWNER) ok_count++; else - dprintf("%s: '%.16s' owner %d != %d\n", - __func__, disk->serial, idisk->owner, + dprintf("'%.16s' owner %d != %d\n", + disk->serial, idisk->owner, owner); } else { - dprintf("%s: unknown disk %x [%d]: %.16s\n", - __func__, __le32_to_cpu(mpb->family_num), i, + dprintf("unknown disk %x [%d]: %.16s\n", + __le32_to_cpu(mpb->family_num), i, disk->serial); break; } @@ -4074,8 +4205,8 @@ imsm_thunderdome(struct intel_super **super_list, int len) s = NULL; if (!s) - dprintf("%s: marking family: %#x from %d:%d offline\n", - __func__, mpb->family_num, + dprintf("marking family: %#x from %d:%d offline\n", + mpb->family_num, super_table[i]->disks->major, super_table[i]->disks->minor); super_table[i] = s; @@ -4122,8 +4253,7 @@ imsm_thunderdome(struct intel_super **super_list, int len) champion = s; if (conflict) - pr_err("Chose family %#x on '%s', " - "assemble conflicts to new container with '--update=uuid'\n", + pr_err("Chose family %#x on '%s', assemble conflicts to new container with '--update=uuid'\n", __le32_to_cpu(s->anchor->family_num), s->disks->devname); /* collect all dl's onto 'champion', and update them to @@ -4463,8 +4593,7 @@ static int load_super_imsm(struct supertype *st, int fd, char *devname) if (rv) { if (devname) - pr_err("Failed to load all information " - "sections on %s\n", devname); + pr_err("Failed to load all information sections on %s\n", devname); free_imsm(super); return rv; } @@ -4600,8 +4729,7 @@ static int init_super_imsm_volume(struct supertype *st, mdu_array_info_t *info, unsigned long long num_data_stripes; if (super->orom && mpb->num_raid_devs >= super->orom->vpa) { - pr_err("This imsm-container already has the " - "maximum of %d volumes\n", super->orom->vpa); + pr_err("This imsm-container already has the maximum of %d volumes\n", super->orom->vpa); return 0; } @@ -4618,8 +4746,7 @@ static int init_super_imsm_volume(struct supertype *st, mdu_array_info_t *info, } if (posix_memalign(&super->migr_rec_buf, 512, MIGR_REC_BUF_SIZE) != 0) { - pr_err("%s could not allocate migr_rec buffer\n", - __func__); + pr_err("could not allocate migr_rec buffer\n"); free(super->buf); free(super); free(mpb_new); @@ -4703,8 +4830,7 @@ static int init_super_imsm_volume(struct supertype *st, mdu_array_info_t *info, if (info->level == 1 && info->raid_disks > 2) { free(dev); free(dv); - pr_err("imsm does not support more than 2 disks" - "in a raid1 volume\n"); + pr_err("imsm does not support more than 2 disksin a raid1 volume\n"); return 0; } @@ -4777,11 +4903,11 @@ static int init_super_imsm(struct supertype *st, mdu_array_info_t *info, super = NULL; } if (!super) { - pr_err("%s could not allocate superblock\n", __func__); + pr_err("could not allocate superblock\n"); return 0; } if (posix_memalign(&super->migr_rec_buf, 512, MIGR_REC_BUF_SIZE) != 0) { - pr_err("%s could not allocate migr_rec buffer\n", __func__); + pr_err("could not allocate migr_rec buffer\n"); free(super->buf); free(super); return 0; @@ -5000,6 +5126,14 @@ static int add_to_super_imsm(struct supertype *st, mdu_disk_info_t *dk, } get_dev_size(fd, NULL, &size); + /* clear migr_rec when adding disk to container */ + memset(super->migr_rec_buf, 0, MIGR_REC_BUF_SIZE); + if (lseek64(fd, size - MIGR_REC_POSITION, SEEK_SET) >= 0) { + if (write(fd, super->migr_rec_buf, + MIGR_REC_BUF_SIZE) != MIGR_REC_BUF_SIZE) + perror("Write migr_rec failed"); + } + size /= 512; serialcpy(dd->disk.serial, dd->serial); set_total_blocks(&dd->disk, size); @@ -5035,8 +5169,7 @@ static int remove_from_super_imsm(struct supertype *st, mdu_disk_info_t *dk) * is prepared. */ if (!st->update_tail) { - pr_err("%s shall be used in mdmon context only" - "(line %d).\n", __func__, __LINE__); + pr_err("shall be used in mdmon context only\n"); return 1; } dd = xcalloc(1, sizeof(*dd)); @@ -5069,13 +5202,13 @@ static int write_super_imsm_spares(struct intel_super *super, int doclose) __u32 sum; struct dl *d; - spare->mpb_size = __cpu_to_le32(sizeof(struct imsm_super)), - spare->generation_num = __cpu_to_le32(1UL), + spare->mpb_size = __cpu_to_le32(sizeof(struct imsm_super)); + spare->generation_num = __cpu_to_le32(1UL); spare->attributes = MPB_ATTRIB_CHECKSUM_VERIFY; - spare->num_disks = 1, - spare->num_raid_devs = 0, - spare->cache_size = mpb->cache_size, - spare->pwr_cycle_count = __cpu_to_le32(1), + spare->num_disks = 1; + spare->num_raid_devs = 0; + spare->cache_size = mpb->cache_size; + spare->pwr_cycle_count = __cpu_to_le32(1); snprintf((char *) spare->sig, MAX_SIGNATURE_LENGTH, MPB_SIGNATURE MPB_VERSION_RAID0); @@ -5095,8 +5228,8 @@ static int write_super_imsm_spares(struct intel_super *super, int doclose) spare->check_sum = __cpu_to_le32(sum); if (store_imsm_mpb(d->fd, spare)) { - pr_err("%s: failed for device %d:%d %s\n", - __func__, d->major, d->minor, strerror(errno)); + pr_err("failed for device %d:%d %s\n", + d->major, d->minor, strerror(errno)); return 1; } if (doclose) { @@ -5189,8 +5322,8 @@ static int write_super_imsm(struct supertype *st, int doclose) if (store_imsm_mpb(d->fd, mpb)) fprintf(stderr, - "%s: failed for device %d:%d (fd: %d)%s\n", - __func__, d->major, d->minor, + "failed for device %d:%d (fd: %d)%s\n", + d->major, d->minor, d->fd, strerror(errno)); if (doclose) { @@ -5345,7 +5478,7 @@ static int validate_geometry_imsm_container(struct supertype *st, int level, #if DEBUG char str[256]; fd2devname(fd, str); - dprintf("validate_geometry_imsm_container: fd: %d %s orom: %p rv: %d raiddisk: %d\n", + dprintf("fd: %d %s orom: %p rv: %d raiddisk: %d\n", fd, str, super->orom, rv, raiddisks); #endif /* no orom/efi or non-intel hba of the disk */ @@ -5357,8 +5490,7 @@ static int validate_geometry_imsm_container(struct supertype *st, int level, if (super->orom) { if (raiddisks > super->orom->tds) { if (verbose) - pr_err("%d exceeds maximum number of" - " platform supported disks: %d\n", + pr_err("%d exceeds maximum number of platform supported disks: %d\n", raiddisks, super->orom->tds); free_imsm(super); return 0; @@ -5542,15 +5674,15 @@ active_arrays_by_format(char *name, char* hba, struct md_list **devlist, for (vol = mdstat ; vol ; vol = vol->next) { if ((vol->active > 0) && vol->metadata_version && - is_container_member(vol, memb->dev)) { + is_container_member(vol, memb->devnm)) { found++; count++; } } if (*devlist && (found < dpa)) { dv = xcalloc(1, sizeof(*dv)); - dv->devname = xmalloc(strlen(memb->dev) + strlen("/dev/") + 1); - sprintf(dv->devname, "%s%s", "/dev/", memb->dev); + dv->devname = xmalloc(strlen(memb->devnm) + strlen("/dev/") + 1); + sprintf(dv->devname, "%s%s", "/dev/", memb->devnm); dv->found = found; dv->used = 0; dv->next = *devlist; @@ -5679,27 +5811,27 @@ count_volumes_list(struct md_list *devlist, char *homehost, tmpdev->container = 0; dfd = dev_open(devname, O_RDONLY|O_EXCL); if (dfd < 0) { - dprintf(": cannot open device %s: %s\n", + dprintf("cannot open device %s: %s\n", devname, strerror(errno)); tmpdev->used = 2; } else if (fstat(dfd, &stb)< 0) { /* Impossible! */ - dprintf(": fstat failed for %s: %s\n", + dprintf("fstat failed for %s: %s\n", devname, strerror(errno)); tmpdev->used = 2; } else if ((stb.st_mode & S_IFMT) != S_IFBLK) { - dprintf(": %s is not a block device.\n", + dprintf("%s is not a block device.\n", devname); tmpdev->used = 2; } else if (must_be_container(dfd)) { struct supertype *cst; cst = super_by_fd(dfd, NULL); if (cst == NULL) { - dprintf(": cannot recognize container type %s\n", + dprintf("cannot recognize container type %s\n", devname); tmpdev->used = 2; } else if (tst->ss != st->ss) { - dprintf(": non-imsm container - ignore it: %s\n", + dprintf("non-imsm container - ignore it: %s\n", devname); tmpdev->used = 2; } else if (!tst->ss->load_container || @@ -5713,11 +5845,11 @@ count_volumes_list(struct md_list *devlist, char *homehost, } else { tmpdev->st_rdev = stb.st_rdev; if (tst->ss->load_super(tst,dfd, NULL)) { - dprintf(": no RAID superblock on %s\n", + dprintf("no RAID superblock on %s\n", devname); tmpdev->used = 2; } else if (tst->ss->compare_super == NULL) { - dprintf(": Cannot assemble %s metadata on %s\n", + dprintf("Cannot assemble %s metadata on %s\n", tst->ss->name, devname); tmpdev->used = 2; } @@ -5754,7 +5886,7 @@ count_volumes_list(struct md_list *devlist, char *homehost, * Or, if we are auto assembling, we just ignore the second * for now. */ - dprintf(": superblock on %s doesn't match others - assembly aborted\n", + dprintf("superblock on %s doesn't match others - assembly aborted\n", devname); goto loop; } @@ -5776,7 +5908,7 @@ count_volumes_list(struct md_list *devlist, char *homehost, if (iter->array.state & (1<<MD_SB_BLOCK_VOLUME)) { /* do not assemble arrays with unsupported configurations */ - dprintf(": Cannot activate member %s.\n", + dprintf("Cannot activate member %s.\n", iter->text_version); } else count++; @@ -5784,11 +5916,11 @@ count_volumes_list(struct md_list *devlist, char *homehost, sysfs_free(head); } else { - dprintf(" no valid super block on device list: err: %d %p\n", + dprintf("No valid super block on device list: err: %d %p\n", err, st->sb); } } else { - dprintf(" no more devices to examin\n"); + dprintf("no more devices to examine\n"); } for (tmpdev = devlist; tmpdev; tmpdev = tmpdev->next) { @@ -5810,37 +5942,75 @@ count_volumes_list(struct md_list *devlist, char *homehost, } static int -count_volumes(char *hba, int dpa, int verbose) +count_volumes(struct intel_hba *hba, int dpa, int verbose) { - struct md_list *devlist = NULL; + struct sys_dev *idev, *intel_devices = find_intel_devices(); int count = 0; - int found = 0;; + const struct orom_entry *entry; + struct devid_list *dv, *devid_list; + + if (!hba || !hba->path) + return 0; - devlist = get_devices(hba); - /* if no intel devices return zero volumes */ - if (devlist == NULL) + for (idev = intel_devices; idev; idev = idev->next) { + if (strstr(idev->path, hba->path)) + break; + } + + if (!idev || !idev->dev_id) return 0; - count = active_arrays_by_format("imsm", hba, &devlist, dpa, verbose); - dprintf(" path: %s active arrays: %d\n", hba, count); - if (devlist == NULL) + entry = get_orom_entry_by_device_id(idev->dev_id); + + if (!entry || !entry->devid_list) return 0; - do { - found = 0; - count += count_volumes_list(devlist, - NULL, - verbose, - &found); - dprintf("found %d count: %d\n", found, count); - } while (found); - - dprintf("path: %s total number of volumes: %d\n", hba, count); - - while(devlist) { - struct md_list *dv = devlist; - devlist = devlist->next; - free(dv->devname); - free(dv); + + devid_list = entry->devid_list; + for (dv = devid_list; dv; dv = dv->next) { + struct md_list *devlist = NULL; + struct sys_dev *device = device_by_id(dv->devid); + char *hba_path; + int found = 0; + + if (device) + hba_path = device->path; + else + return 0; + + /* VMD has one orom entry for all domain, but spanning is not allowed. + * VMD arrays should be counted per domain (controller), so skip + * domains that are not the given one. + */ + if ((hba->type == SYS_DEV_VMD) && + (strncmp(device->path, hba->path, strlen(device->path)) != 0)) + continue; + + devlist = get_devices(hba_path); + /* if no intel devices return zero volumes */ + if (devlist == NULL) + return 0; + + count += active_arrays_by_format("imsm", hba_path, &devlist, dpa, verbose); + dprintf("path: %s active arrays: %d\n", hba_path, count); + if (devlist == NULL) + return 0; + do { + found = 0; + count += count_volumes_list(devlist, + NULL, + verbose, + &found); + dprintf("found %d count: %d\n", found, count); + } while (found); + + dprintf("path: %s total number of volumes: %d\n", hba_path, count); + + while (devlist) { + struct md_list *dv = devlist; + devlist = devlist->next; + free(dv->devname); + free(dv); + } } return count; } @@ -5877,8 +6047,7 @@ validate_geometry_imsm_orom(struct intel_super *super, int level, int layout, *chunk = imsm_default_chunk(super->orom); if (super->orom && !imsm_orom_has_chunk(super->orom, *chunk)) { - pr_vrb(": platform does not support a chunk size of: " - "%d\n", *chunk); + pr_vrb(": platform does not support a chunk size of: %d\n", *chunk); return 0; } @@ -5898,6 +6067,7 @@ validate_geometry_imsm_orom(struct intel_super *super, int level, int layout, pr_vrb(": platform does not support a volume size over 2TB\n"); return 0; } + return 1; } @@ -5928,8 +6098,7 @@ static int validate_geometry_imsm_volume(struct supertype *st, int level, mpb = super->anchor; if (!validate_geometry_imsm_orom(super, level, layout, raiddisks, chunk, size, verbose)) { - pr_err("RAID gemetry validation failed. " - "Cannot proceed with the action(s).\n"); + pr_err("RAID gemetry validation failed. Cannot proceed with the action(s).\n"); return 0; } if (!dev) { @@ -5970,9 +6139,7 @@ static int validate_geometry_imsm_volume(struct supertype *st, int level, } if (dcnt < raiddisks) { if (verbose) - pr_err("imsm: Not enough " - "devices with space for this array " - "(%d < %d)\n", + pr_err("imsm: Not enough devices with space for this array (%d < %d)\n", dcnt, raiddisks); return 0; } @@ -5991,8 +6158,7 @@ static int validate_geometry_imsm_volume(struct supertype *st, int level, } if (!dl) { if (verbose) - pr_err("%s is not in the " - "same imsm set\n", dev); + pr_err("%s is not in the same imsm set\n", dev); return 0; } else if (super->orom && dl->index < 0 && mpb->num_raid_devs) { /* If a volume is present then the current creation attempt @@ -6000,15 +6166,12 @@ static int validate_geometry_imsm_volume(struct supertype *st, int level, * understand this configuration (all member disks must be * members of each array in the container). */ - pr_err("%s is a spare and a volume" - " is already defined for this container\n", dev); - pr_err("The option-rom requires all member" - " disks to be a member of all volumes\n"); + pr_err("%s is a spare and a volume is already defined for this container\n", dev); + pr_err("The option-rom requires all member disks to be a member of all volumes\n"); return 0; } else if (super->orom && mpb->num_raid_devs > 0 && mpb->num_disks != raiddisks) { - pr_err("The option-rom requires all member" - " disks to be a member of all volumes\n"); + pr_err("The option-rom requires all member disks to be a member of all volumes\n"); return 0; } @@ -6051,21 +6214,16 @@ static int validate_geometry_imsm_volume(struct supertype *st, int level, if (!check_env("IMSM_NO_PLATFORM") && mpb->num_raid_devs > 0 && size && size != maxsize) { - pr_err("attempting to create a second " - "volume with size less then remaining space. " - "Aborting...\n"); + pr_err("attempting to create a second volume with size less then remaining space. Aborting...\n"); return 0; } if (maxsize < size || maxsize == 0) { if (verbose) { if (maxsize == 0) - pr_err("no free space" - " left on device. Aborting...\n"); + pr_err("no free space left on device. Aborting...\n"); else - pr_err("not enough space" - " to create volume of given size" - " (%llu < %llu). Aborting...\n", + pr_err("not enough space to create volume of given size (%llu < %llu). Aborting...\n", maxsize, size); } return 0; @@ -6074,7 +6232,7 @@ static int validate_geometry_imsm_volume(struct supertype *st, int level, *freesize = maxsize; if (super->orom) { - int count = count_volumes(super->hba->path, + int count = count_volumes(super->hba, super->orom->dpa, verbose); if (super->orom->vphba <= count) { pr_vrb(": platform does not support more than %d raid volumes.\n", @@ -6151,9 +6309,7 @@ static int imsm_get_free_size(struct supertype *st, int raiddisks, } if (!check_env("IMSM_NO_PLATFORM") && mpb->num_raid_devs > 0 && size && size != maxsize) { - pr_err("attempting to create a second " - "volume with size less then remaining space. " - "Aborting...\n"); + pr_err("attempting to create a second volume with size less then remaining space. Aborting...\n"); return 0; } cnt = 0; @@ -6232,11 +6388,10 @@ static int validate_geometry_imsm(struct supertype *st, int level, int layout, created */ if (super->orom && freesize) { int count; - count = count_volumes(super->hba->path, + count = count_volumes(super->hba, super->orom->dpa, verbose); if (super->orom->vphba <= count) { - pr_vrb(": platform does not support more" - " than %d raid volumes.\n", + pr_vrb(": platform does not support more than %d raid volumes.\n", super->orom->vphba); return 0; } @@ -6520,7 +6675,7 @@ static void update_recovery_start(struct intel_super *super, * IMSM_ORD_REBUILD, so assume they are missing and the * disk_ord_tbl was not correctly updated */ - dprintf("%s: failed to locate out-of-sync disk\n", __func__); + dprintf("failed to locate out-of-sync disk\n"); return; } @@ -6554,14 +6709,12 @@ static struct mdinfo *container_content_imsm(struct supertype *st, char *subarra /* do not assemble arrays when not all attributes are supported */ if (imsm_check_attributes(mpb->attributes) == 0) { sb_errors = 1; - pr_err("Unsupported attributes in IMSM metadata." - "Arrays activation is blocked.\n"); + pr_err("Unsupported attributes in IMSM metadata.Arrays activation is blocked.\n"); } /* check for bad blocks */ if (imsm_bbm_log_size(super->anchor)) { - pr_err("BBM log found in IMSM metadata." - "Arrays activation is blocked.\n"); + pr_err("BBM log found in IMSM metadata.Arrays activation is blocked.\n"); sb_errors = 1; } @@ -6595,8 +6748,7 @@ static struct mdinfo *container_content_imsm(struct supertype *st, char *subarra */ if (dev->vol.migr_state && (migr_type(dev) == MIGR_STATE_CHANGE)) { - pr_err("cannot assemble volume '%.16s':" - " unsupported migration in progress\n", + pr_err("cannot assemble volume '%.16s': unsupported migration in progress\n", dev->volume); continue; } @@ -6618,8 +6770,7 @@ static struct mdinfo *container_content_imsm(struct supertype *st, char *subarra map->num_members, /* raid disks */ &chunk, join_u32(dev->size_low, dev->size_high), 1 /* verbose */)) { - pr_err("IMSM RAID geometry validation" - " failed. Array %s activation is blocked.\n", + pr_err("IMSM RAID geometry validation failed. Array %s activation is blocked.\n", dev->volume); this->array.state |= (1<<MD_SB_BLOCK_CONTAINER_RESHAPE) | @@ -6841,8 +6992,7 @@ static int imsm_open_new(struct supertype *c, struct active_array *a, struct imsm_super *mpb = super->anchor; if (atoi(inst) >= mpb->num_raid_devs) { - pr_err("%s: subarry index %d, out of range\n", - __func__, atoi(inst)); + pr_err("subarry index %d, out of range\n", atoi(inst)); return -ENODEV; } @@ -7255,7 +7405,7 @@ static void imsm_set_disk(struct active_array *a, int n, int state) case IMSM_T_STATE_NORMAL: /* transition to normal state */ dprintf("normal: "); if (is_rebuilding(dev)) { - dprintf("while rebuilding"); + dprintf_cont("while rebuilding"); /* check if recovery is really finished */ for (mdi = a->info.devs; mdi ; mdi = mdi->next) if (mdi->recovery_start != MaxSector) { @@ -7263,8 +7413,8 @@ static void imsm_set_disk(struct active_array *a, int n, int state) break; } if (recovery_not_finished) { - dprintf("\nimsm: Rebuild has not finished yet, " - "state not changed"); + dprintf_cont("\n"); + dprintf("Rebuild has not finished yet, state not changed"); if (a->last_checkpoint < mdi->recovery_start) { a->last_checkpoint = mdi->recovery_start; super->updates_pending++; @@ -7279,7 +7429,7 @@ static void imsm_set_disk(struct active_array *a, int n, int state) break; } if (is_gen_migration(dev)) { - dprintf("while general migration"); + dprintf_cont("while general migration"); if (a->last_checkpoint >= a->info.component_size) end_migration(dev, super, map_state); else @@ -7291,26 +7441,26 @@ static void imsm_set_disk(struct active_array *a, int n, int state) } break; case IMSM_T_STATE_DEGRADED: /* transition to degraded state */ - dprintf("degraded: "); + dprintf_cont("degraded: "); if ((map->map_state != map_state) && !dev->vol.migr_state) { - dprintf("mark degraded"); + dprintf_cont("mark degraded"); map->map_state = map_state; super->updates_pending++; a->last_checkpoint = 0; break; } if (is_rebuilding(dev)) { - dprintf("while rebuilding."); + dprintf_cont("while rebuilding."); if (map->map_state != map_state) { - dprintf(" Map state change"); + dprintf_cont(" Map state change"); end_migration(dev, super, map_state); super->updates_pending++; } break; } if (is_gen_migration(dev)) { - dprintf("while general migration"); + dprintf_cont("while general migration"); if (a->last_checkpoint >= a->info.component_size) end_migration(dev, super, map_state); else { @@ -7321,22 +7471,22 @@ static void imsm_set_disk(struct active_array *a, int n, int state) break; } if (is_initializing(dev)) { - dprintf("while initialization."); + dprintf_cont("while initialization."); map->map_state = map_state; super->updates_pending++; break; } break; case IMSM_T_STATE_FAILED: /* transition to failed state */ - dprintf("failed: "); + dprintf_cont("failed: "); if (is_gen_migration(dev)) { - dprintf("while general migration"); + dprintf_cont("while general migration"); map->map_state = map_state; super->updates_pending++; break; } if (map->map_state != map_state) { - dprintf("mark failed"); + dprintf_cont("mark failed"); end_migration(dev, super, map_state); super->updates_pending++; a->last_checkpoint = 0; @@ -7344,10 +7494,9 @@ static void imsm_set_disk(struct active_array *a, int n, int state) } break; default: - dprintf("state %i\n", map_state); + dprintf_cont("state %i\n", map_state); } - dprintf("\n"); - + dprintf_cont("\n"); } static int store_imsm_mpb(int fd, struct imsm_super *mpb) @@ -7409,7 +7558,7 @@ static struct dl *imsm_readd(struct intel_super *super, int idx, struct active_a dl = NULL; if (dl) - dprintf("%s: found %x:%x\n", __func__, dl->major, dl->minor); + dprintf("found %x:%x\n", dl->major, dl->minor); return dl; } @@ -7610,8 +7759,7 @@ static struct mdinfo *imsm_activate_spare(struct active_array *a, /* Cannot activate another spare if rebuild is in progress already */ if (is_rebuilding(dev)) { - dprintf("imsm: No spare activation allowed. " - "Rebuild in progress already.\n"); + dprintf("imsm: No spare activation allowed. Rebuild in progress already.\n"); return NULL; } @@ -7631,8 +7779,7 @@ static struct mdinfo *imsm_activate_spare(struct active_array *a, * are removed from container. */ if (failed) { - dprintf("found failed disks in %.*s, check if there another" - "failed sub-array.\n", + dprintf("found failed disks in %.*s, check if there anotherfailed sub-array.\n", MAX_RAID_SERIAL_LEN, dev->volume); /* check if states of the other volumes allow for rebuild */ for (i = 0; i < super->anchor->num_raid_devs; i++) { @@ -7776,8 +7923,7 @@ static int remove_disk_super(struct intel_super *super, int major, int minor) super->disks = dl->next; dl->next = NULL; __free_imsm_disk(dl); - dprintf("%s: removed %x:%x\n", - __func__, major, minor); + dprintf("removed %x:%x\n", major, minor); break; } prev = dl; @@ -7803,9 +7949,8 @@ static int add_remove_disk_update(struct intel_super *super) disk_cfg->next = super->disks; super->disks = disk_cfg; check_degraded = 1; - dprintf("%s: added %x:%x\n", - __func__, disk_cfg->major, - disk_cfg->minor); + dprintf("added %x:%x\n", + disk_cfg->major, disk_cfg->minor); } else if (disk_cfg->action == DISK_REMOVE) { dprintf("Disk remove action processed: %x.%x\n", disk_cfg->major, disk_cfg->minor); @@ -7837,7 +7982,7 @@ static int apply_reshape_migration_update(struct imsm_update_reshape_migration * void **tofree = NULL; int ret_val = 0; - dprintf("apply_reshape_migration_update()\n"); + dprintf("(enter)\n"); if ((u->subdev < 0) || (u->subdev > 1)) { dprintf("imsm: Error: Wrong subdev: %i\n", u->subdev); @@ -7915,8 +8060,7 @@ static int apply_reshape_migration_update(struct imsm_update_reshape_migration * new_disk = get_disk_super(super, major(u->new_disks[0]), minor(u->new_disks[0])); - dprintf("imsm: new disk for reshape is: %i:%i " - "(%p, index = %i)\n", + dprintf("imsm: new disk for reshape is: %i:%i (%p, index = %i)\n", major(u->new_disks[0]), minor(u->new_disks[0]), new_disk, new_disk->index); @@ -7957,7 +8101,7 @@ static int apply_size_change_update(struct imsm_update_size_change *u, struct intel_dev *id; int ret_val = 0; - dprintf("apply_size_change_update()\n"); + dprintf("(enter)\n"); if ((u->subdev < 0) || (u->subdev > 1)) { dprintf("imsm: Error: Wrong subdev: %i\n", u->subdev); @@ -7974,8 +8118,7 @@ static int apply_size_change_update(struct imsm_update_size_change *u, /* calculate new size */ blocks_per_member = u->new_size / used_disks; - dprintf("imsm: apply_size_change_update(size: %llu, " - "blocks per member: %llu)\n", + dprintf("(size: %llu, blocks per member: %llu)\n", u->new_size, blocks_per_member); set_blocks_per_member(map, blocks_per_member); imsm_set_array_size(dev, u->new_size); @@ -8017,8 +8160,7 @@ static int apply_update_activate_spare(struct imsm_update_activate_spare *u, break; if (!dl) { - pr_err("error: imsm_activate_spare passed " - "an unknown disk (index: %d)\n", + pr_err("error: imsm_activate_spare passed an unknown disk (index: %d)\n", u->dl->index); return 0; } @@ -8118,15 +8260,14 @@ static int apply_reshape_container_disks_update(struct imsm_update_reshape *u, int ret_val = 0; unsigned int dev_id; - dprintf("imsm: apply_reshape_container_disks_update()\n"); + dprintf("(enter)\n"); /* enable spares to use in array */ for (i = 0; i < delta_disks; i++) { new_disk = get_disk_super(super, major(u->new_disks[i]), minor(u->new_disks[i])); - dprintf("imsm: new disk for reshape is: %i:%i " - "(%p, index = %i)\n", + dprintf("imsm: new disk for reshape is: %i:%i (%p, index = %i)\n", major(u->new_disks[i]), minor(u->new_disks[i]), new_disk, new_disk->index); if ((new_disk == NULL) || @@ -8359,8 +8500,7 @@ static void imsm_process_update(struct supertype *st, struct imsm_update_general_migration_checkpoint *u = (void *)update->buf; - dprintf("imsm: process_update() " - "for update_general_migration_checkpoint called\n"); + dprintf("called for update_general_migration_checkpoint\n"); /* find device under general migration */ for (id = super->devlist ; id; id = id->next) { @@ -8429,15 +8569,14 @@ static void imsm_process_update(struct supertype *st, /* handle racing creates: first come first serve */ if (u->dev_idx < mpb->num_raid_devs) { - dprintf("%s: subarray %d already defined\n", - __func__, u->dev_idx); + dprintf("subarray %d already defined\n", u->dev_idx); goto create_error; } /* check update is next in sequence */ if (u->dev_idx != mpb->num_raid_devs) { - dprintf("%s: can not create array %d expected index %d\n", - __func__, u->dev_idx, mpb->num_raid_devs); + dprintf("can not create array %d expected index %d\n", + u->dev_idx, mpb->num_raid_devs); goto create_error; } @@ -8462,14 +8601,14 @@ static void imsm_process_update(struct supertype *st, continue; if (disks_overlap(super, i, u)) { - dprintf("%s: arrays overlap\n", __func__); + dprintf("arrays overlap\n"); goto create_error; } } /* check that prepare update was successful */ if (!update->space) { - dprintf("%s: prepare update failed\n", __func__); + dprintf("prepare update failed\n"); goto create_error; } @@ -8481,7 +8620,7 @@ static void imsm_process_update(struct supertype *st, for (i = 0; i < new_map->num_members; i++) { dl = serial_to_dl(inf[i].serial, super); if (!dl) { - dprintf("%s: disk disappeared\n", __func__); + dprintf("disk disappeared\n"); goto create_error; } } @@ -8600,8 +8739,7 @@ static void imsm_process_update(struct supertype *st, break; } default: - pr_err("error: unsuported process update type:" - "(type: %d)\n", type); + pr_err("error: unsuported process update type:(type: %d)\n", type); } } @@ -8632,8 +8770,7 @@ static int imsm_prepare_update(struct supertype *st, case update_general_migration_checkpoint: if (update->len < (int)sizeof(struct imsm_update_general_migration_checkpoint)) return 0; - dprintf("imsm: prepare_update() " - "for update_general_migration_checkpoint called\n"); + dprintf("called for update_general_migration_checkpoint\n"); break; case update_takeover: { struct imsm_update_takeover *u = (void *)update->buf; @@ -8682,7 +8819,7 @@ static int imsm_prepare_update(struct supertype *st, if (update->len < (int)sizeof(*u)) return 0; - dprintf("imsm: imsm_prepare_update() for update_reshape\n"); + dprintf("for update_reshape\n"); for (dl = super->devlist; dl; dl = dl->next) { int size = sizeof_imsm_dev(dl->dev, 1); @@ -8717,7 +8854,7 @@ static int imsm_prepare_update(struct supertype *st, if (update->len < (int)sizeof(*u)) return 0; - dprintf("imsm: imsm_prepare_update() for update_reshape\n"); + dprintf("for update_reshape\n"); /* add space for bigger array in update */ @@ -8879,8 +9016,7 @@ static void imsm_delete(struct intel_super *super, struct dl **dlp, unsigned ind int i, j, num_members; __u32 ord; - dprintf("%s: deleting device[%d] from imsm_super\n", - __func__, index); + dprintf("deleting device[%d] from imsm_super\n", index); /* shift all indexes down one */ for (iter = super->disks; iter; iter = iter->next) @@ -9061,32 +9197,68 @@ int open_backup_targets(struct mdinfo *info, int raid_disks, int *raid_fds, ******************************************************************************/ int validate_container_imsm(struct mdinfo *info) { - if (!check_env("IMSM_NO_PLATFORM")) { - struct sys_dev *idev; - struct mdinfo *dev; - char *hba_path = NULL; - char *dev_path = devt_to_devpath(makedev(info->disk.major, - info->disk.minor)); + if (check_env("IMSM_NO_PLATFORM")) + return 0; - for (idev = find_intel_devices(); idev; idev = idev->next) { - if (strstr(dev_path, idev->path)) { - hba_path = idev->path; - break; - } + struct sys_dev *idev; + struct sys_dev *hba = NULL; + struct sys_dev *intel_devices = find_intel_devices(); + char *dev_path = devt_to_devpath(makedev(info->disk.major, + info->disk.minor)); + + for (idev = intel_devices; idev; idev = idev->next) { + if (dev_path && strstr(dev_path, idev->path)) { + hba = idev; + break; } + } + if (dev_path) free(dev_path); - if (hba_path) { - for (dev = info->next; dev; dev = dev->next) { - if (!devt_attached_to_hba(makedev(dev->disk.major, - dev->disk.minor), hba_path)) { - pr_err("WARNING - IMSM container assembled with disks under different HBAs!\n" - " This operation is not supported and can lead to data loss.\n"); - return 1; - } + if (!hba) { + pr_err("WARNING - Cannot detect HBA for device %s!\n", + devid2kname(makedev(info->disk.major, info->disk.minor))); + return 1; + } + + const struct imsm_orom *orom = get_orom_by_device_id(hba->dev_id); + struct mdinfo *dev; + + for (dev = info->next; dev; dev = dev->next) { + dev_path = devt_to_devpath(makedev(dev->disk.major, dev->disk.minor)); + + struct sys_dev *hba2 = NULL; + for (idev = intel_devices; idev; idev = idev->next) { + if (dev_path && strstr(dev_path, idev->path)) { + hba2 = idev; + break; } } + if (dev_path) + free(dev_path); + + const struct imsm_orom *orom2 = hba2 == NULL ? NULL : + get_orom_by_device_id(hba2->dev_id); + + if (hba2 && hba->type != hba2->type) { + pr_err("WARNING - HBAs of devices do not match %s != %s\n", + get_sys_dev_type(hba->type), get_sys_dev_type(hba2->type)); + return 1; + } + + if ((orom != orom2) || ((hba->type == SYS_DEV_VMD) && (hba != hba2))) { + pr_err("WARNING - IMSM container assembled with disks under different HBAs!\n" + " This operation is not supported and can lead to data loss.\n"); + return 1; + } + + if (!orom) { + pr_err("WARNING - IMSM container assembled with disks under HBAs without IMSM platform support!\n" + " This operation is not supported and can lead to data loss.\n"); + return 1; + } } + return 0; } #ifndef MDASSEMBLE @@ -9268,8 +9440,7 @@ int save_checkpoint_imsm(struct supertype *st, struct mdinfo *info, int state) unsigned long long curr_migr_unit; if (load_imsm_migr_rec(super, info) != 0) { - dprintf("imsm: ERROR: Cannot read migration record " - "for checkpoint save.\n"); + dprintf("imsm: ERROR: Cannot read migration record for checkpoint save.\n"); return 1; } @@ -9293,8 +9464,7 @@ int save_checkpoint_imsm(struct supertype *st, struct mdinfo *info, int state) __cpu_to_le32(curr_migr_unit * __le32_to_cpu(super->migr_rec->dest_depth_per_unit)); if (write_imsm_migr_rec(st) < 0) { - dprintf("imsm: Cannot write migration record " - "outside backup area\n"); + dprintf("imsm: Cannot write migration record outside backup area\n"); return 1; } @@ -9405,16 +9575,14 @@ int recover_backup_imsm(struct supertype *st, struct mdinfo *info) new_disks, super, id->dev)) { - pr_err("Cannot restore data from backup." - " Too many failed disks\n"); + pr_err("Cannot restore data from backup. Too many failed disks\n"); goto abort; } if (save_checkpoint_imsm(st, info, UNIT_SRC_NORMAL)) { /* ignore error == 2, this can mean end of reshape here */ - dprintf("imsm: Cannot write checkpoint to " - "migration record (UNIT_SRC_NORMAL) during restart\n"); + dprintf("imsm: Cannot write checkpoint to migration record (UNIT_SRC_NORMAL) during restart\n"); } else retval = 0; @@ -9489,22 +9657,19 @@ static int imsm_reshape_is_allowed_on_container(struct supertype *st, struct mdinfo *info, *member; int devices_that_can_grow = 0; - dprintf("imsm: imsm_reshape_is_allowed_on_container(ENTER): " - "st->devnm = (%s)\n", st->devnm); + dprintf("imsm: imsm_reshape_is_allowed_on_container(ENTER): st->devnm = (%s)\n", st->devnm); if (geo->size > 0 || geo->level != UnSet || geo->layout != UnSet || geo->chunksize != 0 || geo->raid_disks == UnSet) { - dprintf("imsm: Container operation is allowed for " - "raid disks number change only.\n"); + dprintf("imsm: Container operation is allowed for raid disks number change only.\n"); return ret_val; } if (direction == ROLLBACK_METADATA_CHANGES) { - dprintf("imsm: Metadata changes rollback is not supported for " - "container operation.\n"); + dprintf("imsm: Metadata changes rollback is not supported for container operation.\n"); return ret_val; } @@ -9519,8 +9684,7 @@ static int imsm_reshape_is_allowed_on_container(struct supertype *st, /* we work on container for Online Capacity Expansion * only so raid_disks has to grow */ - dprintf("imsm: for container operation raid disks " - "increase is required\n"); + dprintf("imsm: for container operation raid disks increase is required\n"); break; } @@ -9528,8 +9692,7 @@ static int imsm_reshape_is_allowed_on_container(struct supertype *st, (info->array.level != 5)) { /* we cannot use this container with other raid level */ - dprintf("imsm: for container operation wrong" - " raid level (%i) detected\n", + dprintf("imsm: for container operation wrong raid level (%i) detected\n", info->array.level); break; } else { @@ -9540,8 +9703,7 @@ static int imsm_reshape_is_allowed_on_container(struct supertype *st, if (!is_raid_level_supported(super->orom, member->array.level, geo->raid_disks)) { - dprintf("platform does not support raid%d with" - " %d disk%s\n", + dprintf("platform does not support raid%d with %d disk%s\n", info->array.level, geo->raid_disks, geo->raid_disks > 1 ? "s" : ""); @@ -9551,8 +9713,7 @@ static int imsm_reshape_is_allowed_on_container(struct supertype *st, */ if (info->component_size % (info->array.chunk_size/512)) { - dprintf("Component size is not aligned to " - "chunk size\n"); + dprintf("Component size is not aligned to chunk size\n"); break; } } @@ -9580,9 +9741,9 @@ static int imsm_reshape_is_allowed_on_container(struct supertype *st, ret_val = 1; if (ret_val) - dprintf("\tContainer operation allowed\n"); + dprintf("Container operation allowed\n"); else - dprintf("\tError: %i\n", ret_val); + dprintf("Error: %i\n", ret_val); return ret_val; } @@ -9620,8 +9781,7 @@ static int imsm_create_metadata_update_for_reshape( int delta_disks = 0; struct mdinfo *dev; - dprintf("imsm_update_metadata_for_reshape(enter) raid_disks = %i\n", - geo->raid_disks); + dprintf("(enter) raid_disks = %i\n", geo->raid_disks); delta_disks = geo->raid_disks - old_raid_disks; @@ -9642,8 +9802,7 @@ static int imsm_create_metadata_update_for_reshape( if (spares == NULL || delta_disks > spares->array.spare_disks) { - pr_err("imsm: ERROR: Cannot get spare devices " - "for %s.\n", geo->dev_name); + pr_err("imsm: ERROR: Cannot get spare devices for %s.\n", geo->dev_name); i = -1; goto abort; } @@ -9675,12 +9834,12 @@ abort: dprintf("imsm: reshape update preparation :"); if (i == delta_disks) { - dprintf(" OK\n"); + dprintf_cont(" OK\n"); *updatep = u; return update_memory_size; } free(u); - dprintf(" Error\n"); + dprintf_cont(" Error\n"); return 0; } @@ -9699,8 +9858,7 @@ static int imsm_create_metadata_update_for_size_change( int update_memory_size = 0; struct imsm_update_size_change *u = NULL; - dprintf("imsm_create_metadata_update_for_size_change(enter)" - " New size = %llu\n", geo->size); + dprintf("(enter) New size = %llu\n", geo->size); /* size of all update data without anchor */ update_memory_size = sizeof(struct imsm_update_size_change); @@ -9732,8 +9890,7 @@ static int imsm_create_metadata_update_for_migration( struct imsm_dev *dev; int previous_level = -1; - dprintf("imsm_create_metadata_update_for_migration(enter)" - " New Level = %i\n", geo->level); + dprintf("(enter) New Level = %i\n", geo->level); /* size of all update data without anchor */ update_memory_size = sizeof(struct imsm_update_reshape_migration); @@ -9758,8 +9915,7 @@ static int imsm_create_metadata_update_for_migration( if (geo->chunksize != current_chunk_size) { u->new_chunksize = geo->chunksize / 1024; - dprintf("imsm: " - "chunk size change from %i to %i\n", + dprintf("imsm: chunk size change from %i to %i\n", current_chunk_size, u->new_chunksize); } previous_level = map->raid_level; @@ -9774,8 +9930,7 @@ static int imsm_create_metadata_update_for_migration( free(u); sysfs_free(spares); update_memory_size = 0; - dprintf("error: cannot get spare device " - "for requested migration"); + dprintf("error: cannot get spare device for requested migration"); return 0; } sysfs_free(spares); @@ -9843,9 +9998,7 @@ enum imsm_reshape_type imsm_analyze_change(struct supertype *st, if (geo->level == 5) { change = CH_MIGRATION; if (geo->layout != ALGORITHM_LEFT_ASYMMETRIC) { - pr_err("Error. Requested Layout " - "not supported (left-asymmetric layout " - "is supported only)!\n"); + pr_err("Error. Requested Layout not supported (left-asymmetric layout is supported only)!\n"); change = -1; goto analyse_change_exit; } @@ -9870,8 +10023,7 @@ enum imsm_reshape_type imsm_analyze_change(struct supertype *st, break; } if (change == -1) { - pr_err("Error. Level Migration from %d to %d " - "not supported!\n", + pr_err("Error. Level Migration from %d to %d not supported!\n", info.array.level, geo->level); goto analyse_change_exit; } @@ -9892,8 +10044,7 @@ enum imsm_reshape_type imsm_analyze_change(struct supertype *st, geo->layout = 0; geo->level = 5; } else { - pr_err("Error. Layout Migration from %d to %d " - "not supported!\n", + pr_err("Error. Layout Migration from %d to %d not supported!\n", info.array.layout, geo->layout); change = -1; goto analyse_change_exit; @@ -9927,9 +10078,7 @@ enum imsm_reshape_type imsm_analyze_change(struct supertype *st, chunk * 1024, geo->size * 2); if (geo->size == 0) { - pr_err("Error. Size expansion is " \ - "supported only (current size is %llu, " \ - "requested size /rounded/ is 0).\n", + pr_err("Error. Size expansion is supported only (current size is %llu, requested size /rounded/ is 0).\n", current_size); goto analyse_change_exit; } @@ -9937,14 +10086,12 @@ enum imsm_reshape_type imsm_analyze_change(struct supertype *st, if ((current_size != geo->size) && (geo->size > 0)) { if (change != -1) { - pr_err("Error. Size change should be the only " - "one at a time.\n"); + pr_err("Error. Size change should be the only one at a time.\n"); change = -1; goto analyse_change_exit; } if ((super->current_vol + 1) != super->anchor->num_raid_devs) { - pr_err("Error. The last volume in container " - "can be expanded only (%i/%s).\n", + pr_err("Error. The last volume in container can be expanded only (%i/%s).\n", super->current_vol, st->devnm); goto analyse_change_exit; } @@ -9969,8 +10116,7 @@ enum imsm_reshape_type imsm_analyze_change(struct supertype *st, /* requested size change to the maximum available size */ if (max_size == 0) { - pr_err("Error. Cannot find " - "maximum available space.\n"); + pr_err("Error. Cannot find maximum available space.\n"); change = -1; goto analyse_change_exit; } else @@ -9988,17 +10134,12 @@ enum imsm_reshape_type imsm_analyze_change(struct supertype *st, dprintf("Prepare update for size change to %llu\n", geo->size ); if (current_size >= geo->size) { - pr_err("Error. Size expansion is " - "supported only (current size is %llu, " - "requested size /rounded/ is %llu).\n", + pr_err("Error. Size expansion is supported only (current size is %llu, requested size /rounded/ is %llu).\n", current_size, geo->size); goto analyse_change_exit; } if (max_size && geo->size > max_size) { - pr_err("Error. Requested size is larger " - "than maximum available size (maximum " - "available size is %llu, " - "requested size /rounded/ is %llu).\n", + pr_err("Error. Requested size is larger than maximum available size (maximum available size is %llu, requested size /rounded/ is %llu).\n", max_size, geo->size); goto analyse_change_exit; } @@ -10021,9 +10162,7 @@ enum imsm_reshape_type imsm_analyze_change(struct supertype *st, struct imsm_super *mpb = super->anchor; if (mpb->num_raid_devs > 1) { - pr_err("Error. Cannot perform operation on %s" - "- for this operation it MUST be single " - "array in container\n", + pr_err("Error. Cannot perform operation on %s- for this operation it MUST be single array in container\n", geo->dev_name); change = -1; } @@ -10032,8 +10171,7 @@ enum imsm_reshape_type imsm_analyze_change(struct supertype *st, analyse_change_exit: if ((direction == ROLLBACK_METADATA_CHANGES) && ((change == CH_MIGRATION) || (change == CH_TAKEOVER))) { - dprintf("imsm: Metadata changes rollback is not supported for " - "migration and takeover operations.\n"); + dprintf("imsm: Metadata changes rollback is not supported for migration and takeover operations.\n"); change = -1; } return change; @@ -10079,7 +10217,7 @@ static int imsm_reshape_super(struct supertype *st, unsigned long long size, int ret_val = 1; struct geo_params geo; - dprintf("imsm: reshape_super called.\n"); + dprintf("(enter)\n"); memset(&geo, 0, sizeof(struct geo_params)); @@ -10093,8 +10231,8 @@ static int imsm_reshape_super(struct supertype *st, unsigned long long size, if (delta_disks != UnSet) geo.raid_disks += delta_disks; - dprintf("\tfor level : %i\n", geo.level); - dprintf("\tfor raid_disks : %i\n", geo.raid_disks); + dprintf("for level : %i\n", geo.level); + dprintf("for raid_disks : %i\n", geo.raid_disks); if (experimental() == 0) return ret_val; @@ -10127,8 +10265,7 @@ static int imsm_reshape_super(struct supertype *st, unsigned long long size, free(u); } else { - pr_err("(imsm) Operation " - "is not allowed on this container\n"); + pr_err("(imsm) Operation is not allowed on this container\n"); } } else { /* On volume level we support following operations @@ -10166,8 +10303,7 @@ static int imsm_reshape_super(struct supertype *st, unsigned long long size, imsm_create_metadata_update_for_migration( st, &geo, &u); if (len < 1) { - dprintf("imsm: " - "Cannot prepare update\n"); + dprintf("imsm: Cannot prepare update\n"); break; } ret_val = 0; @@ -10186,8 +10322,7 @@ static int imsm_reshape_super(struct supertype *st, unsigned long long size, imsm_create_metadata_update_for_size_change( st, &geo, &u); if (len < 1) { - dprintf("imsm: " - "Cannot prepare update\n"); + dprintf("imsm: Cannot prepare update\n"); break; } ret_val = 0; @@ -10231,21 +10366,18 @@ int wait_for_reshape_imsm(struct mdinfo *sra, int ndata) unsigned long long position_to_set = to_complete / ndata; if (fd < 0) { - dprintf("imsm: wait_for_reshape_imsm() " - "cannot open reshape_position\n"); + dprintf("cannot open reshape_position\n"); return 1; } if (sysfs_fd_get_ll(fd, &completed) < 0) { - dprintf("imsm: wait_for_reshape_imsm() " - "cannot read reshape_position (no reshape in progres)\n"); + dprintf("cannot read reshape_position (no reshape in progres)\n"); close(fd); - return 0; + return 1; } if (completed > position_to_set) { - dprintf("imsm: wait_for_reshape_imsm() " - "wrong next position to set %llu (%llu)\n", + dprintf("wrong next position to set %llu (%llu)\n", to_complete, position_to_set); close(fd); return -1; @@ -10253,8 +10385,7 @@ int wait_for_reshape_imsm(struct mdinfo *sra, int ndata) dprintf("Position set: %llu\n", position_to_set); if (sysfs_set_num(sra, NULL, "sync_max", position_to_set) != 0) { - dprintf("imsm: wait_for_reshape_imsm() " - "cannot set reshape position to %llu\n", + dprintf("cannot set reshape position to %llu\n", position_to_set); close(fd); return -1; @@ -10262,14 +10393,16 @@ int wait_for_reshape_imsm(struct mdinfo *sra, int ndata) do { char action[20]; - sysfs_wait(fd, NULL); + int timeout = 3000; + sysfs_wait(fd, &timeout); if (sysfs_get_str(sra, NULL, "sync_action", action, 20) > 0 && - strncmp(action, "reshape", 7) != 0) - break; + strncmp(action, "reshape", 7) != 0) { + close(fd); + return -1; + } if (sysfs_fd_get_ll(fd, &completed) < 0) { - dprintf("imsm: wait_for_reshape_imsm() " - "cannot read reshape_position (in loop)\n"); + dprintf("cannot read reshape_position (in loop)\n"); close(fd); return 1; } @@ -10410,8 +10543,7 @@ static int imsm_manage_reshape( init_migr_record_imsm(st, dev, sra); else { if (__le32_to_cpu(migr_rec->rec_status) != UNIT_SRC_NORMAL) { - dprintf("imsm: cannot restart migration when data " - "are present in copy area.\n"); + dprintf("imsm: cannot restart migration when data are present in copy area.\n"); goto abort; } /* Save checkpoint to update migration record for current @@ -10421,9 +10553,7 @@ static int imsm_manage_reshape( if (save_checkpoint_imsm(st, sra, UNIT_SRC_NORMAL) == 1) { /* ignore error == 2, this can mean end of reshape here */ - dprintf("imsm: Cannot write checkpoint to " - "migration record (UNIT_SRC_NORMAL, " - "initial save)\n"); + dprintf("imsm: Cannot write checkpoint to migration record (UNIT_SRC_NORMAL, initial save)\n"); goto abort; } } @@ -10454,8 +10584,7 @@ static int imsm_manage_reshape( */ degraded = check_degradation_change(sra, fds, degraded); if (degraded > 1) { - dprintf("imsm: Abort reshape due to degradation" - " level (%i)\n", degraded); + dprintf("imsm: Abort reshape due to degradation level (%i)\n", degraded); goto abort; } @@ -10489,10 +10618,7 @@ static int imsm_manage_reshape( if (next_step_filler) next_step_filler = (old_data_stripe_length - next_step_filler); - dprintf("save_stripes() parameters: start = %llu," - "\tstart_src = %llu,\tnext_step*512 = %llu," - "\tstart_in_buf_shift = %llu," - "\tnext_step_filler = %llu\n", + dprintf("save_stripes() parameters: start = %llu,\tstart_src = %llu,\tnext_step*512 = %llu,\tstart_in_buf_shift = %llu,\tnext_step_filler = %llu\n", start, start_src, copy_length, start_buf_shift, next_step_filler); @@ -10502,8 +10628,7 @@ static int imsm_manage_reshape( copy_length + next_step_filler + start_buf_shift, buf)) { - dprintf("imsm: Cannot save stripes" - " to buffer\n"); + dprintf("imsm: Cannot save stripes to buffer\n"); goto abort; } /* Convert data to destination format and store it @@ -10511,14 +10636,12 @@ static int imsm_manage_reshape( */ if (save_backup_imsm(st, dev, sra, buf + start_buf_shift, copy_length)) { - dprintf("imsm: Cannot save stripes to " - "target devices\n"); + dprintf("imsm: Cannot save stripes to target devices\n"); goto abort; } if (save_checkpoint_imsm(st, sra, UNIT_SRC_IN_CP_AREA)) { - dprintf("imsm: Cannot write checkpoint to " - "migration record (UNIT_SRC_IN_CP_AREA)\n"); + dprintf("imsm: Cannot write checkpoint to migration record (UNIT_SRC_IN_CP_AREA)\n"); goto abort; } } else { @@ -10539,7 +10662,7 @@ static int imsm_manage_reshape( sra->reshape_progress = next_step; /* wait until reshape finish */ - if (wait_for_reshape_imsm(sra, ndata) < 0) { + if (wait_for_reshape_imsm(sra, ndata)) { dprintf("wait_for_reshape_imsm returned error!\n"); goto abort; } @@ -10549,18 +10672,34 @@ static int imsm_manage_reshape( if (save_checkpoint_imsm(st, sra, UNIT_SRC_NORMAL) == 1) { /* ignore error == 2, this can mean end of reshape here */ - dprintf("imsm: Cannot write checkpoint to " - "migration record (UNIT_SRC_NORMAL)\n"); + dprintf("imsm: Cannot write checkpoint to migration record (UNIT_SRC_NORMAL)\n"); goto abort; } } + /* clear migr_rec on disks after successful migration */ + struct dl *d; + + memset(super->migr_rec_buf, 0, MIGR_REC_BUF_SIZE); + for (d = super->disks; d; d = d->next) { + if (d->index < 0 || is_failed(&d->disk)) + continue; + unsigned long long dsize; + + get_dev_size(d->fd, NULL, &dsize); + if (lseek64(d->fd, dsize - MIGR_REC_POSITION, + SEEK_SET) >= 0) { + if (write(d->fd, super->migr_rec_buf, + MIGR_REC_BUF_SIZE) != MIGR_REC_BUF_SIZE) + perror("Write migr_rec failed"); + } + } + /* return '1' if done */ ret_val = 1; abort: free(buf); - abort_reshape(sra); return ret_val; } diff --git a/super-mbr.c b/super-mbr.c index 0fcac7c3..62b3f031 100644 --- a/super-mbr.c +++ b/super-mbr.c @@ -81,8 +81,7 @@ static int load_super_mbr(struct supertype *st, int fd, char *devname) free_mbr(st); if (posix_memalign((void**)&super, 512, 512) != 0) { - pr_err("%s could not allocate superblock\n", - __func__); + pr_err("could not allocate superblock\n"); return 1; } @@ -119,8 +118,7 @@ static int store_mbr(struct supertype *st, int fd) struct MBR *old, *super; if (posix_memalign((void**)&old, 512, 512) != 0) { - pr_err("%s could not allocate superblock\n", - __func__); + pr_err("could not allocate superblock\n"); return 1; } @@ -405,7 +405,8 @@ static void getinfo_super0(struct supertype *st, struct mdinfo *info, char *map) info->array.utime = sb->utime; info->array.chunk_size = sb->chunk_size; info->array.state = sb->state; - info->component_size = sb->size*2; + info->component_size = sb->size; + info->component_size *= 2; if (sb->state & (1<<MD_SB_BITMAP_PRESENT)) info->bitmap_offset = 8; @@ -713,7 +714,7 @@ static int init_super0(struct supertype *st, mdu_array_info_t *info, if (posix_memalign((void**)&sb, 4096, MD_SB_BYTES + ROUND_UP(sizeof(bitmap_super_t), 4096)) != 0) { - pr_err("%s could not allocate superblock\n", __func__); + pr_err("could not allocate superblock\n"); return 0; } memset(sb, 0, MD_SB_BYTES + sizeof(bitmap_super_t)); @@ -900,7 +901,7 @@ static int write_init_super0(struct supertype *st) rv = store_super0(st, di->fd); if (rv == 0 && (sb->state & (1<<MD_SB_BITMAP_PRESENT))) - rv = st->ss->write_bitmap(st, di->fd); + rv = st->ss->write_bitmap(st, di->fd, NoUpdate); if (rv) pr_err("failed to write superblock to %s\n", @@ -929,7 +930,7 @@ static int compare_super0(struct supertype *st, struct supertype *tst) if (posix_memalign((void**)&first, 4096, MD_SB_BYTES + ROUND_UP(sizeof(struct bitmap_super_s), 4096)) != 0) { - pr_err("%s could not allocate superblock\n", __func__); + pr_err("could not allocate superblock\n"); return 1; } memcpy(first, second, MD_SB_BYTES + sizeof(struct bitmap_super_s)); @@ -997,7 +998,7 @@ static int load_super0(struct supertype *st, int fd, char *devname) if (posix_memalign((void**)&super, 4096, MD_SB_BYTES + ROUND_UP(sizeof(bitmap_super_t), 4096)) != 0) { - pr_err("%s could not allocate superblock\n", __func__); + pr_err("could not allocate superblock\n"); return 1; } @@ -1155,16 +1156,16 @@ static int add_internal_bitmap0(struct supertype *st, int *chunkp, return 1; } -static void locate_bitmap0(struct supertype *st, int fd) +static int locate_bitmap0(struct supertype *st, int fd) { unsigned long long dsize; unsigned long long offset; if (!get_dev_size(fd, NULL, &dsize)) - return; + return -1; if (dsize < MD_RESERVED_SECTORS*512) - return; + return -1; offset = MD_NEW_SIZE_SECTORS(dsize>>9); @@ -1173,9 +1174,10 @@ static void locate_bitmap0(struct supertype *st, int fd) offset += MD_SB_BYTES; lseek64(fd, offset, 0); + return 0; } -static int write_bitmap0(struct supertype *st, int fd) +static int write_bitmap0(struct supertype *st, int fd, enum bitmap_update update) { unsigned long long dsize; unsigned long long offset; @@ -1269,8 +1271,7 @@ static int validate_geometry0(struct supertype *st, int level, } if (size >= tbmax * 2ULL*1024*1024*1024) { if (verbose) - pr_err("0.90 metadata supports at most " - "%d terabytes per device\n", tbmax); + pr_err("0.90 metadata supports at most %d terabytes per device\n", tbmax); return 0; } if (*chunk == UnSet) @@ -1,7 +1,7 @@ /* * mdadm - manage Linux "md" devices aka RAID arrays. * - * Copyright (C) 2001-2009 Neil Brown <neilb@suse.de> + * Copyright (C) 2001-2016 Neil Brown <neilb@suse.com> * * * This program is free software; you can redistribute it and/or modify @@ -68,7 +68,10 @@ struct mdp_superblock_1 { __u64 data_offset; /* sector start of data, often 0 */ __u64 data_size; /* sectors in this device that can be used for data */ __u64 super_offset; /* sector start of this superblock */ - __u64 recovery_offset;/* sectors before this offset (from data_offset) have been recovered */ + union { + __u64 recovery_offset;/* sectors before this offset (from data_offset) have been recovered */ + __u64 journal_tail;/* journal tail of journal device (from data_offset) */ + }; __u32 dev_number; /* permanent identifier of this device - not role in raid */ __u32 cnt_corrected_read; /* number of read errors that were corrected by re-writing */ __u8 device_uuid[16]; /* user-space setable, ignored by kernel */ @@ -125,6 +128,8 @@ struct misc_dev_info { * backwards anyway. */ #define MD_FEATURE_NEW_OFFSET 64 /* new_offset must be honoured */ +#define MD_FEATURE_BITMAP_VERSIONED 256 /* bitmap version number checked properly */ +#define MD_FEATURE_JOURNAL 512 /* support write journal */ #define MD_FEATURE_ALL (MD_FEATURE_BITMAP_OFFSET \ |MD_FEATURE_RECOVERY_OFFSET \ |MD_FEATURE_RESHAPE_ACTIVE \ @@ -132,8 +137,39 @@ struct misc_dev_info { |MD_FEATURE_REPLACEMENT \ |MD_FEATURE_RESHAPE_BACKWARDS \ |MD_FEATURE_NEW_OFFSET \ + |MD_FEATURE_BITMAP_VERSIONED \ + |MD_FEATURE_JOURNAL \ ) +#ifndef MDASSEMBLE +static int role_from_sb(struct mdp_superblock_1 *sb) +{ + unsigned int d; + int role; + + d = __le32_to_cpu(sb->dev_number); + if (d < __le32_to_cpu(sb->max_dev)) + role = __le16_to_cpu(sb->dev_roles[d]); + else + role = MD_DISK_ROLE_SPARE; + return role; +} +#endif + +/* return how many bytes are needed for bitmap, for cluster-md each node + * should have it's own bitmap */ +static unsigned int calc_bitmap_size(bitmap_super_t *bms, unsigned int boundary) +{ + unsigned long long bits, bytes; + + bits = __le64_to_cpu(bms->sync_size) / (__le32_to_cpu(bms->chunksize)>>9); + bytes = (bits+7) >> 3; + bytes += sizeof(bitmap_super_t); + bytes = ROUND_UP(bytes, boundary); + + return bytes; +} + static unsigned int calc_sb_1_csum(struct mdp_superblock_1 * sb) { unsigned int disk_csum, csum; @@ -197,8 +233,7 @@ static int aread(struct align_fd *afd, void *buf, int len) if (!bsize || bsize > 4096 || len > 4096) { if (!bsize) - fprintf(stderr, "WARNING - aread() called with " - "invalid block size\n"); + fprintf(stderr, "WARNING - aread() called with invalid block size\n"); return -1; } b = ROUND_UP_PTR((char *)abuf, 4096); @@ -230,8 +265,7 @@ static int awrite(struct align_fd *afd, void *buf, int len) bsize = afd->blk_sz; if (!bsize || bsize > 4096 || len > 4096) { if (!bsize) - fprintf(stderr, "WARNING - awrite() called with " - "invalid block size\n"); + fprintf(stderr, "WARNING - awrite() called with invalid block size\n"); return -1; } b = ROUND_UP_PTR((char *)abuf, 4096); @@ -258,6 +292,7 @@ static int awrite(struct align_fd *afd, void *buf, int len) static void examine_super1(struct supertype *st, char *homehost) { struct mdp_superblock_1 *sb = st->sb; + bitmap_super_t *bms = (bitmap_super_t*)(((char*)sb)+MAX_SB_SIZE); time_t atime; unsigned int d; int role; @@ -291,6 +326,8 @@ static void examine_super1(struct supertype *st, char *homehost) strncmp(sb->set_name, homehost, l) == 0) printf(" (local to host %s)", homehost); printf("\n"); + if (bms->nodes > 0 && (__le32_to_cpu(sb->feature_map) & MD_FEATURE_BITMAP_OFFSET)) + printf(" Cluster Name : %-64s\n", bms->cluster_name); atime = __le64_to_cpu(sb->ctime) & 0xFFFFFFFFFFULL; printf(" Creation Time : %.24s\n", ctime(&atime)); c=map_num(pers, __le32_to_cpu(sb->level)); @@ -448,25 +485,23 @@ static void examine_super1(struct supertype *st, char *homehost) /* This turns out to just be confusing */ printf(" Array Slot : %d (", __le32_to_cpu(sb->dev_number)); for (i= __le32_to_cpu(sb->max_dev); i> 0 ; i--) - if (__le16_to_cpu(sb->dev_roles[i-1]) != 0xffff) + if (__le16_to_cpu(sb->dev_roles[i-1]) != MD_DISK_ROLE_SPARE) break; for (d=0; d < i; d++) { int role = __le16_to_cpu(sb->dev_roles[d]); if (d) printf(", "); - if (role == 0xffff) printf("empty"); - else if(role == 0xfffe) printf("failed"); + if (role == MD_DISK_ROLE_SPARE) printf("empty"); + else if(role == MD_DISK_ROLE_FAULTY) printf("failed"); else printf("%d", role); } printf(")\n"); #endif printf(" Device Role : "); - d = __le32_to_cpu(sb->dev_number); - if (d < __le32_to_cpu(sb->max_dev)) - role = __le16_to_cpu(sb->dev_roles[d]); - else - role = 0xFFFF; - if (role >= 0xFFFE) + role = role_from_sb(sb); + if (role >= MD_DISK_ROLE_FAULTY) printf("spare\n"); + else if (role == MD_DISK_ROLE_JOURNAL) + printf("Journal\n"); else if (sb->feature_map & __cpu_to_le32(MD_FEATURE_REPLACEMENT)) printf("Replacement device %d\n", role); else @@ -495,7 +530,7 @@ static void examine_super1(struct supertype *st, char *homehost) faulty = 0; for (i=0; i< __le32_to_cpu(sb->max_dev); i++) { int role = __le16_to_cpu(sb->dev_roles[i]); - if (role == 0xFFFE) + if (role == MD_DISK_ROLE_FAULTY) faulty++; } if (faulty) printf(" %d failed", faulty); @@ -683,12 +718,8 @@ static int copy_metadata1(struct supertype *st, int from, int to) /* have the header, can calculate * correct bitmap bytes */ bitmap_super_t *bms; - int bits; bms = (void*)buf; - bits = __le64_to_cpu(bms->sync_size) / (__le32_to_cpu(bms->chunksize)>>9); - bytes = (bits+7) >> 3; - bytes += sizeof(bitmap_super_t); - bytes = ROUND_UP(bytes, 512); + bytes = calc_bitmap_size(bms, 512); if (n > bytes) n = bytes; } @@ -742,6 +773,7 @@ err: static void detail_super1(struct supertype *st, char *homehost) { struct mdp_superblock_1 *sb = st->sb; + bitmap_super_t *bms = (bitmap_super_t*)(((char*)sb) + MAX_SB_SIZE); int i; int l = homehost ? strlen(homehost) : 0; @@ -750,6 +782,8 @@ static void detail_super1(struct supertype *st, char *homehost) sb->set_name[l] == ':' && strncmp(sb->set_name, homehost, l) == 0) printf(" (local to host %s)", homehost); + if (bms->nodes > 0 && (__le32_to_cpu(sb->feature_map) & MD_FEATURE_BITMAP_OFFSET)) + printf("\n Cluster Name : %-64s", bms->cluster_name); printf("\n UUID : "); for (i=0; i<16; i++) { if ((i&3)==0 && i != 0) printf(":"); @@ -811,7 +845,7 @@ static int examine_badblocks_super1(struct supertype *st, int fd, char *devname) size = __le32_to_cpu(sb->bblog_size)* 512; if (posix_memalign((void**)&bbl, 4096, size) != 0) { - pr_err("%s could not allocate badblocks list\n", __func__); + pr_err("could not allocate badblocks list\n"); return 0; } offset = __le64_to_cpu(sb->super_offset) + @@ -893,6 +927,8 @@ static void getinfo_super1(struct supertype *st, struct mdinfo *info, char *map) info->array.state = (__le64_to_cpu(sb->resync_offset) == MaxSector) ? 1 : 0; + if (__le32_to_cpu(bsb->nodes) > 1) + info->array.state |= (1 << MD_SB_CLUSTERED); info->data_offset = __le64_to_cpu(sb->data_offset); info->component_size = __le64_to_cpu(sb->size); @@ -904,7 +940,7 @@ static void getinfo_super1(struct supertype *st, struct mdinfo *info, char *map) info->disk.number = __le32_to_cpu(sb->dev_number); if (__le32_to_cpu(sb->dev_number) >= __le32_to_cpu(sb->max_dev) || __le32_to_cpu(sb->dev_number) >= MAX_DEVS) - role = 0xfffe; + role = MD_DISK_ROLE_FAULTY; else role = __le16_to_cpu(sb->dev_roles[__le32_to_cpu(sb->dev_number)]); @@ -945,7 +981,7 @@ static void getinfo_super1(struct supertype *st, struct mdinfo *info, char *map) size /= 512; bmend += size; if (bmend > earliest) - bmend = earliest; + earliest = bmend; } if (sb->bblog_offset && sb->bblog_size) { unsigned long long bbend = super_offset; @@ -971,12 +1007,17 @@ static void getinfo_super1(struct supertype *st, struct mdinfo *info, char *map) info->disk.raid_disk = -1; switch(role) { - case 0xFFFF: + case MD_DISK_ROLE_SPARE: info->disk.state = 0; /* spare: not active, not sync, not faulty */ break; - case 0xFFFE: + case MD_DISK_ROLE_FAULTY: info->disk.state = 1; /* faulty */ break; + case MD_DISK_ROLE_JOURNAL: + info->disk.state = (1 << MD_DISK_JOURNAL); + info->disk.raid_disk = role; + info->space_after = (misc->device_size - info->data_offset) % 8; /* journal uses all 4kB blocks*/ + break; default: info->disk.state = 6; /* active and in sync */ info->disk.raid_disk = role; @@ -1024,7 +1065,7 @@ static void getinfo_super1(struct supertype *st, struct mdinfo *info, char *map) map[i] = 0; for (i = 0; i < __le32_to_cpu(sb->max_dev); i++) { role = __le16_to_cpu(sb->dev_roles[i]); - if (/*role == 0xFFFF || */role < (unsigned) info->array.raid_disks) { + if (/*role == MD_DISK_ROLE_SPARE || */role < (unsigned) info->array.raid_disks) { working++; if (map && role < map_disks) map[role] = 1; @@ -1032,6 +1073,9 @@ static void getinfo_super1(struct supertype *st, struct mdinfo *info, char *map) } info->array.working_disks = working; + if (sb->feature_map & __le32_to_cpu(MD_FEATURE_JOURNAL)) + info->journal_device_required = 1; + info->journal_clean = 0; } static struct mdinfo *container_content1(struct supertype *st, char *subarray) @@ -1056,7 +1100,18 @@ static int update_super1(struct supertype *st, struct mdinfo *info, * ignored. */ int rv = 0; + int lockid; struct mdp_superblock_1 *sb = st->sb; + bitmap_super_t *bms = (bitmap_super_t*)(((char*)sb) + MAX_SB_SIZE); + + if (bms->version == BITMAP_MAJOR_CLUSTERED && dlm_funs_ready()) { + rv = cluster_get_dlmlock(&lockid); + if (rv) { + pr_err("Cannot get dlmlock in %s return %d\n", __func__, rv); + cluster_release_dlmlock(lockid); + return rv; + } + } if (strcmp(update, "homehost") == 0 && homehost) { @@ -1096,8 +1151,10 @@ static int update_super1(struct supertype *st, struct mdinfo *info, int want; if (info->disk.state & (1<<MD_DISK_ACTIVE)) want = info->disk.raid_disk; + else if (info->disk.state & (1<<MD_DISK_JOURNAL)) + want = MD_DISK_ROLE_JOURNAL; else - want = 0xFFFF; + want = MD_DISK_ROLE_SPARE; if (sb->dev_roles[d] != __cpu_to_le16(want)) { sb->dev_roles[d] = __cpu_to_le16(want); rv = 1; @@ -1122,7 +1179,7 @@ static int update_super1(struct supertype *st, struct mdinfo *info, unsigned int max = __le32_to_cpu(sb->max_dev); for (i=0 ; i < max ; i++) - if (__le16_to_cpu(sb->dev_roles[i]) >= 0xfffe) + if (__le16_to_cpu(sb->dev_roles[i]) >= MD_DISK_ROLE_FAULTY) break; sb->dev_number = __cpu_to_le32(i); info->disk.number = i; @@ -1227,6 +1284,11 @@ static int update_super1(struct supertype *st, struct mdinfo *info, sb->bblog_shift = 0; sb->bblog_offset = 0; } + } else if (strcmp(update, "force-no-bbl") == 0) { + sb->feature_map &= ~ __cpu_to_le32(MD_FEATURE_BAD_BLOCKS); + sb->bblog_size = 0; + sb->bblog_shift = 0; + sb->bblog_offset = 0; } else if (strcmp(update, "name") == 0) { if (info->name[0] == 0) sprintf(info->name, "%d", info->array.md_minor); @@ -1245,13 +1307,9 @@ static int update_super1(struct supertype *st, struct mdinfo *info, /* set data_size to device size less data_offset */ struct misc_dev_info *misc = (struct misc_dev_info*) (st->sb + MAX_SB_SIZE + BM_SUPER_SIZE); - printf("Size was %llu\n", (unsigned long long) - __le64_to_cpu(sb->data_size)); sb->data_size = __cpu_to_le64( misc->device_size - __le64_to_cpu(sb->data_offset)); - printf("Size is %llu\n", (unsigned long long) - __le64_to_cpu(sb->data_size)); - } else if (strcmp(update, "revert-reshape") == 0) { + } else if (strncmp(update, "revert-reshape", 14) == 0) { rv = -2; if (!(sb->feature_map & __cpu_to_le32(MD_FEATURE_RESHAPE_ACTIVE))) pr_err("No active reshape to revert on %s\n", @@ -1261,6 +1319,24 @@ static int update_super1(struct supertype *st, struct mdinfo *info, unsigned long long reshape_sectors; long reshape_chunk; rv = 0; + /* If the reshape hasn't started, just stop it. + * It is conceivable that a stripe was modified but + * the metadata not updated. In that case the backup + * should have been used to get passed the critical stage. + * If that couldn't happen, the "-nobackup" version + * will be used. + */ + if (strcmp(update, "revert-reshape-nobackup") == 0 && + sb->reshape_position == 0 && + (__le32_to_cpu(sb->delta_disks) > 0 || + (__le32_to_cpu(sb->delta_disks) == 0 && + !(sb->feature_map & __cpu_to_le32(MD_FEATURE_RESHAPE_BACKWARDS))))) { + sb->feature_map &= ~__cpu_to_le32(MD_FEATURE_RESHAPE_ACTIVE); + sb->raid_disks = __cpu_to_le32(__le32_to_cpu(sb->raid_disks) - + __le32_to_cpu(sb->delta_disks)); + sb->delta_disks = 0; + goto done; + } /* reshape_position is a little messy. * Its value must be a multiple of the larger * chunk size, and of the "after" data disks. @@ -1307,6 +1383,7 @@ static int update_super1(struct supertype *st, struct mdinfo *info, sb->new_offset = __cpu_to_le32(-offset_delta); sb->data_size = __cpu_to_le64(__le64_to_cpu(sb->data_size) - offset_delta); } + done:; } } else if (strcmp(update, "_reshape_progress")==0) sb->reshape_position = __cpu_to_le64(info->reshape_progress); @@ -1318,6 +1395,9 @@ static int update_super1(struct supertype *st, struct mdinfo *info, rv = -1; sb->sb_csum = calc_sb_1_csum(sb); + if (bms->version == BITMAP_MAJOR_CLUSTERED && dlm_funs_ready()) + cluster_release_dlmlock(lockid); + return rv; } @@ -1332,7 +1412,7 @@ static int init_super1(struct supertype *st, mdu_array_info_t *info, int sbsize; if (posix_memalign((void**)&sb, 4096, SUPER1_SIZE) != 0) { - pr_err("%s could not allocate superblock\n", __func__); + pr_err("could not allocate superblock\n"); return 0; } memset(sb, 0, SUPER1_SIZE); @@ -1421,13 +1501,26 @@ static int add_to_super1(struct supertype *st, mdu_disk_info_t *dk, struct mdp_superblock_1 *sb = st->sb; __u16 *rp = sb->dev_roles + dk->number; struct devinfo *di, **dip; + bitmap_super_t *bms = (bitmap_super_t*)(((char*)sb) + MAX_SB_SIZE); + int rv, lockid; + + if (bms->version == BITMAP_MAJOR_CLUSTERED && dlm_funs_ready()) { + rv = cluster_get_dlmlock(&lockid); + if (rv) { + pr_err("Cannot get dlmlock in %s return %d\n", __func__, rv); + cluster_release_dlmlock(lockid); + return rv; + } + } if ((dk->state & 6) == 6) /* active, sync */ *rp = __cpu_to_le16(dk->raid_disk); + else if (dk->state & (1<<MD_DISK_JOURNAL)) + *rp = MD_DISK_ROLE_JOURNAL; else if ((dk->state & ~2) == 0) /* active or idle -> spare */ - *rp = 0xffff; + *rp = MD_DISK_ROLE_SPARE; else - *rp = 0xfffe; + *rp = MD_DISK_ROLE_FAULTY; if (dk->number >= (int)__le32_to_cpu(sb->max_dev) && __le32_to_cpu(sb->max_dev) < MAX_DEVS) @@ -1448,11 +1541,14 @@ static int add_to_super1(struct supertype *st, mdu_disk_info_t *dk, di->next = NULL; *dip = di; + if (bms->version == BITMAP_MAJOR_CLUSTERED && dlm_funs_ready()) + cluster_release_dlmlock(lockid); + return 0; } #endif -static void locate_bitmap1(struct supertype *st, int fd); +static int locate_bitmap1(struct supertype *st, int fd); static int store_super1(struct supertype *st, int fd) { @@ -1461,6 +1557,17 @@ static int store_super1(struct supertype *st, int fd) struct align_fd afd; int sbsize; unsigned long long dsize; + bitmap_super_t *bms = (bitmap_super_t*)(((char*)sb) + MAX_SB_SIZE); + int rv, lockid; + + if (bms->version == BITMAP_MAJOR_CLUSTERED && dlm_funs_ready()) { + rv = cluster_get_dlmlock(&lockid); + if (rv) { + pr_err("Cannot get dlmlock in %s return %d\n", __func__, rv); + cluster_release_dlmlock(lockid); + return rv; + } + } if (!get_dev_size(fd, NULL, &dsize)) return 1; @@ -1521,6 +1628,9 @@ static int store_super1(struct supertype *st, int fd) } } fsync(fd); + if (bms->version == BITMAP_MAJOR_CLUSTERED && dlm_funs_ready()) + cluster_release_dlmlock(lockid); + return 0; } @@ -1543,7 +1653,55 @@ static unsigned long choose_bm_space(unsigned long devsize) static void free_super1(struct supertype *st); +#define META_BLOCK_SIZE 4096 +__u32 crc32c_le(__u32 crc, unsigned char const *p, size_t len); + #ifndef MDASSEMBLE +static int write_empty_r5l_meta_block(struct supertype *st, int fd) +{ + struct r5l_meta_block *mb; + struct mdp_superblock_1 *sb = st->sb; + struct align_fd afd; + __u32 crc; + + init_afd(&afd, fd); + + if (posix_memalign((void**)&mb, 4096, META_BLOCK_SIZE) != 0) { + pr_err("Could not allocate memory for the meta block.\n"); + return 1; + } + + memset(mb, 0, META_BLOCK_SIZE); + + mb->magic = __cpu_to_le32(R5LOG_MAGIC); + mb->version = R5LOG_VERSION; + mb->meta_size = __cpu_to_le32(sizeof(struct r5l_meta_block)); + mb->seq = __cpu_to_le64(random32()); + mb->position = __cpu_to_le64(0); + + crc = crc32c_le(0xffffffff, sb->set_uuid, sizeof(sb->set_uuid)); + crc = crc32c_le(crc, (void *)mb, META_BLOCK_SIZE); + mb->checksum = crc; + + if (lseek64(fd, (sb->data_offset) * 512, 0) < 0LL) { + pr_err("cannot seek to offset of the meta block\n"); + goto fail_to_write; + } + + if (awrite(&afd, mb, META_BLOCK_SIZE) != META_BLOCK_SIZE) { + pr_err("failed to store write the meta block \n"); + goto fail_to_write; + } + fsync(fd); + + free(mb); + return 0; + +fail_to_write: + free(mb); + return 1; +} + static int write_init_super1(struct supertype *st) { struct mdp_superblock_1 *sb = st->sb; @@ -1557,6 +1715,11 @@ static int write_init_super1(struct supertype *st) unsigned long long data_offset; for (di = st->info; di; di = di->next) { + if (di->disk.state & (1 << MD_DISK_JOURNAL)) + sb->feature_map |= MD_FEATURE_JOURNAL; + } + + for (di = st->info; di; di = di->next) { if (di->disk.state & (1 << MD_DISK_FAULTY)) continue; if (di->fd < 0) @@ -1579,7 +1742,8 @@ static int write_init_super1(struct supertype *st) if (rfd >= 0) close(rfd); - sb->events = 0; + if (!(di->disk.state & (1<<MD_DISK_JOURNAL))) + sb->events = 0; refst = dup_super(st); if (load_super1(refst, di->fd, NULL)==0) { @@ -1682,21 +1846,28 @@ static int write_init_super1(struct supertype *st) } break; default: - pr_err("Failed to write invalid " - "metadata format 1.%i to %s\n", + pr_err("Failed to write invalid metadata format 1.%i to %s\n", st->minor_version, di->devname); rv = -EINVAL; goto out; } - if (conf_get_create_info()->bblist == 0) { + /* Disable badblock log on clusters, or when explicitly requested */ + if (st->nodes > 0 || conf_get_create_info()->bblist == 0) { sb->bblog_size = 0; sb->bblog_offset = 0; } sb->sb_csum = calc_sb_1_csum(sb); rv = store_super1(st, di->fd); + + if (rv == 0 && (di->disk.state & (1 << MD_DISK_JOURNAL))) { + rv = write_empty_r5l_meta_block(st, di->fd); + if (rv) + goto error_out; + } + if (rv == 0 && (__le32_to_cpu(sb->feature_map) & 1)) - rv = st->ss->write_bitmap(st, di->fd); + rv = st->ss->write_bitmap(st, di->fd, NoUpdate); close(di->fd); di->fd = -1; if (rv) @@ -1730,7 +1901,7 @@ static int compare_super1(struct supertype *st, struct supertype *tst) if (!first) { if (posix_memalign((void**)&first, 4096, SUPER1_SIZE) != 0) { - pr_err("%s could not allocate superblock\n", __func__); + pr_err("could not allocate superblock\n"); return 1; } memcpy(first, second, SUPER1_SIZE); @@ -1841,8 +2012,7 @@ static int load_super1(struct supertype *st, int fd, char *devname) } if (posix_memalign((void**)&super, 4096, SUPER1_SIZE) != 0) { - pr_err("%s could not allocate superblock\n", - __func__); + pr_err("could not allocate superblock\n"); return 1; } @@ -2062,7 +2232,7 @@ add_internal_bitmap1(struct supertype *st, bbl_size = -bbl_offset; if (!may_change || (room < 3*2 && - __le32_to_cpu(sb->max_dev) <= 384)) { + __le32_to_cpu(sb->max_dev) <= 384)) { room = 3*2; offset = 1*2; bbl_size = 0; @@ -2152,32 +2322,45 @@ add_internal_bitmap1(struct supertype *st, bms->daemon_sleep = __cpu_to_le32(delay); bms->sync_size = __cpu_to_le64(size); bms->write_behind = __cpu_to_le32(write_behind); + bms->nodes = __cpu_to_le32(st->nodes); + if (st->nodes) + sb->feature_map = __cpu_to_le32(__le32_to_cpu(sb->feature_map) + | MD_FEATURE_BITMAP_VERSIONED); + if (st->cluster_name) + strncpy((char *)bms->cluster_name, + st->cluster_name, strlen(st->cluster_name)); *chunkp = chunk; return 1; } -static void locate_bitmap1(struct supertype *st, int fd) +static int locate_bitmap1(struct supertype *st, int fd) { unsigned long long offset; struct mdp_superblock_1 *sb; int mustfree = 0; + int ret; if (!st->sb) { if (st->ss->load_super(st, fd, NULL)) - return; /* no error I hope... */ + return -1; /* no error I hope... */ mustfree = 1; } sb = st->sb; + if ((__le32_to_cpu(sb->feature_map) & MD_FEATURE_BITMAP_OFFSET)) + ret = 0; + else + ret = -1; offset = __le64_to_cpu(sb->super_offset); offset += (int32_t) __le32_to_cpu(sb->bitmap_offset); if (mustfree) free(sb); lseek64(fd, offset<<9, 0); + return ret; } -static int write_bitmap1(struct supertype *st, int fd) +static int write_bitmap1(struct supertype *st, int fd, enum bitmap_update update) { struct mdp_superblock_1 *sb = st->sb; bitmap_super_t *bms = (bitmap_super_t*)(((char*)sb)+MAX_SB_SIZE); @@ -2185,6 +2368,43 @@ static int write_bitmap1(struct supertype *st, int fd) void *buf; int towrite, n; struct align_fd afd; + unsigned int i = 0; + unsigned long long total_bm_space, bm_space_per_node; + + switch (update) { + case NameUpdate: + /* update cluster name */ + if (st->cluster_name) { + memset((char *)bms->cluster_name, 0, sizeof(bms->cluster_name)); + strncpy((char *)bms->cluster_name, st->cluster_name, 64); + } + break; + case NodeNumUpdate: + /* cluster md only supports superblock 1.2 now */ + if (st->minor_version != 2) { + pr_err("Warning: cluster md only works with superblock 1.2\n"); + return -EINVAL; + } + + /* Each node has an independent bitmap, it is necessary to calculate the + * space is enough or not, first get how many bytes for the total bitmap */ + bm_space_per_node = calc_bitmap_size(bms, 4096); + + total_bm_space = 512 * (__le64_to_cpu(sb->data_offset) - __le64_to_cpu(sb->super_offset)); + total_bm_space = total_bm_space - 4096; /* leave another 4k for superblock */ + + if (bm_space_per_node * st->nodes > total_bm_space) { + pr_err("Warning: The max num of nodes can't exceed %llu\n", + total_bm_space / bm_space_per_node); + return -ENOMEM; + } + + bms->nodes = __cpu_to_le32(st->nodes); + break; + case NoUpdate: + default: + break; + } init_afd(&afd, fd); @@ -2193,27 +2413,37 @@ static int write_bitmap1(struct supertype *st, int fd) if (posix_memalign(&buf, 4096, 4096)) return -ENOMEM; - memset(buf, 0xff, 4096); - memcpy(buf, (char *)bms, sizeof(bitmap_super_t)); - - towrite = __le64_to_cpu(bms->sync_size) / (__le32_to_cpu(bms->chunksize)>>9); - towrite = (towrite+7) >> 3; /* bits to bytes */ - towrite += sizeof(bitmap_super_t); - towrite = ROUND_UP(towrite, 512); - while (towrite > 0) { - n = towrite; - if (n > 4096) - n = 4096; - n = awrite(&afd, buf, n); - if (n > 0) - towrite -= n; + do { + /* Only the bitmap[0] should resync + * whole device on initial assembly + */ + if (i) + memset(buf, 0x00, 4096); else + memset(buf, 0xff, 4096); + memcpy(buf, (char *)bms, sizeof(bitmap_super_t)); + + towrite = calc_bitmap_size(bms, 4096); + while (towrite > 0) { + n = towrite; + if (n > 4096) + n = 4096; + n = awrite(&afd, buf, n); + if (n > 0) + towrite -= n; + else + break; + if (i) + memset(buf, 0x00, 4096); + else + memset(buf, 0xff, 4096); + } + fsync(fd); + if (towrite) { + rv = -2; break; - memset(buf, 0xff, 4096); - } - fsync(fd); - if (towrite) - rv = -2; + } + } while (++i < __le32_to_cpu(bms->nodes)); free(buf); return rv; @@ -2221,6 +2451,7 @@ static int write_bitmap1(struct supertype *st, int fd) static void free_super1(struct supertype *st) { + if (st->sb) free(st->sb); while (st->info) { @@ -2378,7 +2609,7 @@ void *super1_make_v0(struct supertype *st, struct mdinfo *info, mdp_super_t *sb0 for (i = 0; i < MD_SB_DISKS; i++) { int state = sb0->disks[i].state; - sb->dev_roles[i] = 0xFFFF; + sb->dev_roles[i] = MD_DISK_ROLE_SPARE; if ((state & (1<<MD_DISK_SYNC)) && !(state & (1<<MD_DISK_FAULTY))) sb->dev_roles[i] = __cpu_to_le16(sb0->disks[i].raid_disk); @@ -74,6 +74,12 @@ int sysfs_open(char *devnm, char *devname, char *attr) return fd; } +void sysfs_init_dev(struct mdinfo *mdi, unsigned long devid) +{ + snprintf(mdi->sys_name, + sizeof(mdi->sys_name), "dev-%s", devid2kname(devid)); +} + void sysfs_init(struct mdinfo *mdi, int fd, char *devnm) { mdi->sys_name[0] = 0; @@ -224,6 +230,13 @@ struct mdinfo *sysfs_read(int fd, char *devnm, unsigned long options) goto abort; } + if (options & GET_ARRAY_STATE) { + strcpy(base, "array_state"); + if (load_sys(fname, sra->sysfs_array_state)) + goto abort; + } else + sra->sysfs_array_state[0] = 0; + if (! (options & GET_DEVS)) return sra; @@ -413,7 +426,7 @@ int sysfs_set_str(struct mdinfo *sra, struct mdinfo *dev, n = write(fd, val, strlen(val)); close(fd); if (n != strlen(val)) { - dprintf(Name ": failed to write '%s' to '%s' (%s)\n", + dprintf("failed to write '%s' to '%s' (%s)\n", val, fname, strerror(errno)); return -1; } @@ -450,7 +463,7 @@ int sysfs_uevent(struct mdinfo *sra, char *event) n = write(fd, event, strlen(event)); close(fd); if (n != (int)strlen(event)) { - dprintf(Name ": failed to write '%s' to '%s' (%s)\n", + dprintf("failed to write '%s' to '%s' (%s)\n", event, fname, strerror(errno)); return -1; } @@ -490,7 +503,7 @@ int sysfs_fd_get_ll(int fd, unsigned long long *val) lseek(fd, 0, 0); n = read(fd, buf, sizeof(buf)); - if (n <= 0) + if (n <= 0 || n == sizeof(buf)) return -2; buf[n] = 0; *val = strtoull(buf, &ep, 0); @@ -526,7 +539,7 @@ int sysfs_fd_get_two(int fd, unsigned long long *v1, unsigned long long *v2) lseek(fd, 0, 0); n = read(fd, buf, sizeof(buf)); - if (n <= 0) + if (n <= 0 || n == sizeof(buf)) return -2; buf[n] = 0; *v1 = strtoull(buf, &ep, 0); @@ -562,7 +575,7 @@ int sysfs_fd_get_str(int fd, char *val, int size) lseek(fd, 0, 0); n = read(fd, val, size); - if (n <= 0) + if (n <= 0 || n == size) return -1; val[n] = 0; return n; @@ -623,8 +636,7 @@ int sysfs_set_array(struct mdinfo *info, int vers) if ((vers % 100) < 2 || sysfs_set_str(info, NULL, "metadata_version", ver) < 0) { - pr_err("This kernel does not " - "support external metadata.\n"); + pr_err("This kernel does not support external metadata.\n"); return 1; } } @@ -644,9 +656,7 @@ int sysfs_set_array(struct mdinfo *info, int vers) rc = sysfs_set_num(info, NULL, "array_size", info->custom_array_size/2); if (rc && errno == ENOENT) { - pr_err("This kernel does not " - "have the md/array_size attribute, " - "the array may be larger than expected\n"); + pr_err("This kernel does not have the md/array_size attribute, the array may be larger than expected\n"); rc = 0; } rv |= rc; @@ -718,7 +728,7 @@ int sysfs_disk_to_sg(int fd) struct stat st; char path[256]; char sg_path[256]; - char sg_major_minor[8]; + char sg_major_minor[10]; char *c; DIR *dir; struct dirent *de; @@ -753,7 +763,7 @@ int sysfs_disk_to_sg(int fd) rv = read(fd, sg_major_minor, sizeof(sg_major_minor)); close(fd); - if (rv < 0) + if (rv < 0 || rv == sizeof(sg_major_minor)) return -1; else sg_major_minor[rv - 1] = '\0'; diff --git a/systemd/mdadm-last-resort@.service b/systemd/mdadm-last-resort@.service index 5179f194..e93d72b2 100644 --- a/systemd/mdadm-last-resort@.service +++ b/systemd/mdadm-last-resort@.service @@ -1,6 +1,7 @@ [Unit] Description=Activate md array even though degraded DefaultDependencies=no +Conflicts=sys-devices-virtual-block-%i.device [Service] Type=oneshot diff --git a/systemd/mdmonitor.service b/systemd/mdmonitor.service index c7cff3e4..9aff2f56 100644 --- a/systemd/mdmonitor.service +++ b/systemd/mdmonitor.service @@ -10,7 +10,4 @@ Description=MD array monitor DefaultDependencies=no [Service] -Environment= MDADM_MONITOR_ARGS=--scan -EnvironmentFile=-/run/sysconfig/mdadm -ExecStartPre=-/usr/lib/systemd/scripts/mdadm_env.sh -ExecStart=BINDIR/mdadm --monitor $MDADM_MONITOR_ARGS +ExecStart=BINDIR/mdadm --monitor --scan @@ -94,6 +94,15 @@ do_setup() { trap cleanup 0 1 3 15 trap ctrl_c 2 + # make sure there are no loop devices remaining. + # udev started things can sometimes prevent them being stopped + # immediately + while grep loop /proc/partitions > /dev/null 2>&1 + do + mdadm -Ss + losetup -d /dev/loop[0-9]* 2> /dev/null + sleep 1 + done devlist= for d in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 do @@ -102,6 +111,8 @@ do_setup() { case $DEVTYPE in loop) [ -f $targetdir/mdtest$d ] || dd if=/dev/zero of=$targetdir/mdtest$d count=$sz bs=1K > /dev/null 2>&1 + # make sure udev doesn't touch + mdadm --zero $targetdir/mdtest$d 2> /dev/null [ -b /dev/loop$d ] || mknod /dev/loop$d b 7 $d if [ $d -eq 7 ] then @@ -143,15 +154,18 @@ do_setup() { mdadm() { rm -f $targetdir/stderr case $* in - *-S* ) udevadm settle;; + *-S* ) udevadm settle + p=`cat /proc/sys/dev/raid/speed_limit_max` + echo 20000 > /proc/sys/dev/raid/speed_limit_max esac case $* in - *-C* ) $mdadm 2> $targetdir/stderr --quiet "$@" --auto=yes;; - * ) $mdadm 2> $targetdir/stderr --quiet "$@" + *-C* ) $mdadm 2> $targetdir/stderr --quiet "$@" --auto=yes;; + * ) $mdadm 2> $targetdir/stderr --quiet "$@" esac rv=$? case $* in - *-S* ) udevadm settle;; + *-S* ) udevadm settle + echo $p > /proc/sys/dev/raid/speed_limit_max esac cat >&2 $targetdir/stderr return $rv @@ -176,15 +190,31 @@ check() { echo >&2 "ERROR algorithm $2 not found"; cat /proc/mdstat; exit 1;} ;; resync | recovery | reshape) - sleep 0.5 - grep -s $1 /proc/mdstat > /dev/null || { - echo >&2 ERROR no $1 happening; cat /proc/mdstat; exit 1; } - ;; + cnt=5 + while ! grep -s $1 /proc/mdstat > /dev/null + do + if [ $cnt -gt 0 ] && grep -v idle /sys/block/md*/md/sync_action > /dev/null + then # Something isn't idle - wait a bit + sleep 0.5 + cnt=$[cnt-1] + else + echo >&2 ERROR no $1 happening; cat /proc/mdstat; exit 1 + fi + done + ;; nosync ) sleep 0.5 + # Since 4.2 we delay the close of recovery until there has been a chance for + # spares to be activated. That means that a recovery that finds nothing + # to do can still take a little longer than expected. + # add an extra check: is sync_completed shows the end is reached, assume + # there is no recovery. if grep -s -E '(resync|recovery|reshape) *=' > /dev/null /proc/mdstat ; then + incomplete=`grep / /sys/block/md*/md/sync_completed 2> /dev/null | sed '/^ *\([0-9]*\) \/ \1/d'` + if [ -n "$incomplete" ]; then echo >&2 "ERROR resync or recovery is happening!"; cat /proc/mdstat ; exit 1; + fi fi ;; @@ -192,7 +222,8 @@ check() { p=`cat /proc/sys/dev/raid/speed_limit_max` echo 2000000 > /proc/sys/dev/raid/speed_limit_max sleep 0.1 - while grep -E '(resync|recovery|reshape|check|repair) *=' > /dev/null /proc/mdstat + while grep -E '(resync|recovery|reshape|check|repair) *=' > /dev/null /proc/mdstat || + grep -v idle > /dev/null /sys/block/md*/md/sync_action do sleep 0.5; done echo $p > /proc/sys/dev/raid/speed_limit_max @@ -215,6 +246,15 @@ check() { fi ;; + readonly ) + grep -s "read-only" > /dev/null /proc/mdstat || { + echo >&2 "ERROR array is not read-only!"; cat /proc/mdstat ; exit 1; } + ;; + + inactive ) + grep -s "inactive" > /dev/null /proc/mdstat || { + echo >&2 "ERROR array is not inactive!"; cat /proc/mdstat ; exit 1; } + ;; * ) echo >&2 ERROR unknown check $1 ; exit 1; esac } @@ -233,7 +273,7 @@ testdev() { dvsize=$3 chunk=$4 if [ -z "$5" ]; then - mkfs -j $dev > /dev/null 2>&1 && fsck -fn $dev >&2 + mkfs.ext3 -F -j $dev > /dev/null 2>&1 && fsck -fn $dev >&2 fi dsize=$[dvsize/chunk] dsize=$[dsize*chunk] @@ -283,11 +323,13 @@ do_test() { else log=log cat $targetdir/stderr >> $targetdir/log + echo "=======================dmesg=================" >> $targetdir/log + dmesg | tail -n 200 >> $targetdir/log if [ $exitonerror == 0 ]; then log=log-`basename $_script` - mv $targetdir/log $targetdir/$log + mv $targetdir/log $logdir/$log fi - echo "FAILED - see $targetdir/$log for details" + echo "FAILED - see $logdir/$log for details" _fail=1 fi if [ "$savelogs" == "1" ]; then @@ -339,12 +381,6 @@ parse_args() { ;; --save-logs) savelogs=1 - if [ ! -d $logdir ] ; then - mkdir $logdir - if [ $? -ne 0 ] ; then - exit 1; - fi - fi ;; --keep-going | --no-error) exitonerror=0 @@ -380,9 +416,11 @@ parse_args() { done } +logdir=$targetdir parse_args $@ do_setup +mkdir -p $logdir if [ "$savelogs" == "1" ]; then echo "Saving logs to $logdir" diff --git a/tests/00linear b/tests/00linear index 30b2c65c..e3ac6555 100644 --- a/tests/00linear +++ b/tests/00linear @@ -19,7 +19,7 @@ testdev $md0 4 $mdsize1 1 mdadm -S $md0 # now with no superblock -mdadm -B $md0 -l linear -n5 $dev0 $dev1 $dev2 $dev3 $dev4 +mdadm -B $md0 -l linear -n5 $dev0 $dev1 $dev2 $dev3 $dev4 check linear testdev $md0 5 $size 64 mdadm -S $md0 diff --git a/tests/00raid0 b/tests/00raid0 index 7f87e6ca..8bc18985 100644 --- a/tests/00raid0 +++ b/tests/00raid0 @@ -1,19 +1,19 @@ # create a simple raid0 -mdadm -CR $md0 -l raid0 -n3 $dev0 $dev1 $dev2 +mdadm -CR $md0 -l raid0 -n3 $dev0 $dev1 $dev2 check raid0 -testdev $md0 3 $mdsize2_l 512 +testdev $md0 3 $mdsize2_l 512 mdadm -S $md0 # now with version-0.90 superblock -mdadm -CR $md0 -e0.90 -l0 -n4 $dev0 $dev1 $dev2 $dev3 +mdadm -CR $md0 -e0.90 -l0 -n4 $dev0 $dev1 $dev2 $dev3 check raid0 -testdev $md0 4 $mdsize0 512 +testdev $md0 4 $mdsize0 512 mdadm -S $md0 # now with no superblock -mdadm -B $md0 -l0 -n5 $dev0 $dev1 $dev2 $dev3 $dev4 +mdadm -B $md0 -l0 -n5 $dev0 $dev1 $dev2 $dev3 $dev4 check raid0 testdev $md0 5 $size 512 mdadm -S $md0 @@ -22,19 +22,19 @@ mdadm -S $md0 # now same again with different chunk size for chunk in 4 32 256 do - mdadm -CR $md0 -e0.90 -l raid0 --chunk $chunk -n3 $dev0 $dev1 $dev2 + mdadm -CR $md0 -e0.90 -l raid0 --chunk $chunk -n3 $dev0 $dev1 $dev2 check raid0 testdev $md0 3 $mdsize0 $chunk mdadm -S $md0 # now with version-1 superblock - mdadm -CR $md0 -e1.0 -l0 -c $chunk -n4 $dev0 $dev1 $dev2 $dev3 + mdadm -CR $md0 -e1.0 -l0 -c $chunk -n4 $dev0 $dev1 $dev2 $dev3 check raid0 testdev $md0 4 $mdsize1 $chunk mdadm -S $md0 # now with no superblock - mdadm -B $md0 -l0 -n5 --chun=$chunk $dev0 $dev1 $dev2 $dev3 $dev4 + mdadm -B $md0 -l0 -n5 --chun=$chunk $dev0 $dev1 $dev2 $dev3 $dev4 check raid0 testdev $md0 5 $size $chunk mdadm -S $md0 diff --git a/tests/00raid1 b/tests/00raid1 index eb9a658c..c93465d8 100644 --- a/tests/00raid1 +++ b/tests/00raid1 @@ -3,28 +3,28 @@ # test version0, version1, and no super # test resync and recovery. -mdadm -CR $md0 -l 1 -n2 $dev0 $dev1 +mdadm -CR $md0 -l 1 -n2 $dev0 $dev1 check resync check raid1 testdev $md0 1 $mdsize1a 64 mdadm -S $md0 # now with version-0.90 superblock, spare -mdadm -CR $md0 -e0.90 --level=raid1 -n3 -x2 $dev0 missing missing $dev1 $dev2 +mdadm -CR $md0 -e0.90 --level=raid1 -n3 -x2 $dev0 missing missing $dev1 $dev2 check recovery check raid1 testdev $md0 1 $mdsize0 64 mdadm -S $md0 # now with no superblock -mdadm -B $md0 -l mirror -n2 $dev0 $dev1 +mdadm -B $md0 -l mirror -n2 $dev0 $dev1 check resync check raid1 testdev $md0 1 $size 1 mdadm -S $md0 # again, but with no resync -mdadm -B $md0 -l 1 --assume-clean -n2 $dev0 $dev1 +mdadm -B $md0 -l 1 --assume-clean -n2 $dev0 $dev1 check raid1 check nosync testdev $md0 1 $size 1 diff --git a/tests/00raid4 b/tests/00raid4 index 97d3e3fd..00a14f2f 100644 --- a/tests/00raid4 +++ b/tests/00raid4 @@ -1,13 +1,13 @@ # create a simple raid4 set -mdadm -CfR $md0 -l 4 -n3 $dev0 $dev1 $dev2 +mdadm -CfR $md0 -l 4 -n3 $dev0 $dev1 $dev2 check resync ; check raid[45] testdev $md0 2 $mdsize1 512 mdadm -S $md0 # now with version-1 superblock -mdadm -CR $md0 -e1 --level=raid4 -n4 $dev0 $dev1 $dev2 $dev3 +mdadm -CR $md0 -e1 --level=raid4 -n4 $dev0 $dev1 $dev2 $dev3 check recovery; check raid[45] testdev $md0 3 $mdsize1 512 mdadm -S $md0 diff --git a/tests/00raid5 b/tests/00raid5 index a288c839..b2b7a971 100644 --- a/tests/00raid5 +++ b/tests/00raid5 @@ -1,13 +1,13 @@ # create a simple raid5 set -mdadm -CfR $md0 -e 0.90 -l 5 -n3 $dev0 $dev1 $dev2 +mdadm -CfR $md0 -e 0.90 -l 5 -n3 $dev0 $dev1 $dev2 check resync testdev $md0 2 $mdsize0 512 mdadm -S $md0 # now with version-1 superblock -mdadm -CR $md0 -e1 --level=raid5 -n4 $dev0 $dev1 $dev2 $dev3 +mdadm -CR $md0 -e1 --level=raid5 -n4 $dev0 $dev1 $dev2 $dev3 check recovery testdev $md0 3 $mdsize1 512 mdadm -S $md0 @@ -17,13 +17,13 @@ mdadm -S $md0 for lo in la ra left-symmetric right-symmetric do - mdadm -CfR $md0 -l 5 -p $lo -n3 $dev0 $dev1 $dev2 + mdadm -CfR $md0 -l 5 -p $lo -n3 $dev0 $dev1 $dev2 check resync ; check raid5 testdev $md0 2 $mdsize1 512 mdadm -S $md0 # now with version-1 superblock - mdadm -CR $md0 -e1 --level=raid5 --layout $lo -n4 $dev0 $dev1 $dev2 $dev3 + mdadm -CR $md0 -e1 --level=raid5 --layout $lo -n4 $dev0 $dev1 $dev2 $dev3 check recovery ; check raid5 testdev $md0 3 $mdsize1 512 mdadm -S $md0 diff --git a/tests/00raid6 b/tests/00raid6 index 63d60f5c..6977af9b 100644 --- a/tests/00raid6 +++ b/tests/00raid6 @@ -1,13 +1,13 @@ # create a simple raid6 set -mdadm -CfR $md0 -e0.90 -l 6 -n4 $dev0 $dev1 $dev2 $dev3 +mdadm -CfR $md0 -e0.90 -l 6 -n4 $dev0 $dev1 $dev2 $dev3 check resync ; check raid6 testdev $md0 2 $mdsize0 512 mdadm -S $md0 # now with version-1 superblock -mdadm -CR $md0 -e1 --level=raid6 -n5 $dev0 $dev1 $dev2 $dev3 $dev4 +mdadm -CR $md0 -e1 --level=raid6 -n5 $dev0 $dev1 $dev2 $dev3 $dev4 check resync ; check raid6 testdev $md0 3 $mdsize1 512 mdadm -S $md0 diff --git a/tests/01r1fail b/tests/01r1fail index 9f556321..389b813f 100644 --- a/tests/01r1fail +++ b/tests/01r1fail @@ -5,23 +5,23 @@ mdadm -CR $md0 -l1 -n4 $dev0 $dev1 $dev2 missing check resync -mdadm $md0 --fail $dev2 +mdadm $md0 --fail $dev2 check resync -mdadm $md0 --fail $dev1 +mdadm $md0 --fail $dev1 sleep 1 check nosync check state U___ -mdadm $md0 --add $dev4 $dev3 +mdadm $md0 --add $dev4 $dev3 check recovery # there could be two separate recoveries, one for each dev check wait check wait -mdadm $md0 --remove $dev2 $dev1 +mdadm $md0 --remove $dev2 $dev1 check nosync check state UUU_ mdadm --zero-superblock $dev2 -mdadm $md0 -a $dev2 +mdadm $md0 -a $dev2 check recovery check wait check state UUUU diff --git a/tests/01r5fail b/tests/01r5fail index 1d629321..873dba58 100644 --- a/tests/01r5fail +++ b/tests/01r5fail @@ -4,22 +4,22 @@ # Add two more, fail and remove one # wait for sync to complete, fail, remove, re-add -mdadm -CR $md0 -l5 -n4 $dev0 $dev1 $dev2 $dev3 +mdadm -CR $md0 -l5 -n4 $dev0 $dev1 $dev2 $dev3 check recovery mdadm $md0 --fail $dev3 sleep 1 check nosync check state UUU_ -mdadm $md0 --add $dev4 $dev5 +mdadm $md0 --add $dev4 $dev5 check recovery check wait -mdadm $md0 --fail $dev0 -mdadm $md0 --remove $dev3 $dev0 +mdadm $md0 --fail $dev0 +mdadm $md0 --remove $dev3 $dev0 check recovery check state _UUU -mdadm $md0 -a $dev3 +mdadm $md0 -a $dev3 check recovery check wait check state UUUU diff --git a/tests/01r5integ b/tests/01r5integ index ffb30ce9..48676a22 100644 --- a/tests/01r5integ +++ b/tests/01r5integ @@ -27,7 +27,7 @@ do exit 1 fi mdadm $md0 -a $i - check wait + while ! (check state 'U*'); do check wait; sleep 0.2; done done mdadm -S $md0 done diff --git a/tests/01raid6integ b/tests/01raid6integ index c6fcdae6..12f4d81b 100644 --- a/tests/01raid6integ +++ b/tests/01raid6integ @@ -47,10 +47,10 @@ do exit 1 fi mdadm $md0 -a $first - check wait + while ! (check state 'U*_U*'); do check wait; sleep 0.2; done done mdadm $md0 -a $second - check wait + while ! (check state 'U*'); do check wait; sleep 0.2; done totest="$totest $second" done mdadm -S $md0 diff --git a/tests/02r1add b/tests/02r1add index c07ec977..757f6965 100644 --- a/tests/02r1add +++ b/tests/02r1add @@ -1,7 +1,7 @@ # Make a raid1, add a device, then remove it again. -mdadm -CR $md0 -l1 -n2 -x1 $dev0 $dev1 $dev2 +mdadm -CR $md0 -l1 -n2 -x1 $dev0 $dev1 $dev2 check resync check wait check state UU @@ -11,7 +11,7 @@ check recovery check wait check state UUU -mdadm $md0 --fail $dev0 +mdadm $md0 --fail $dev0 check state _UU mdadm --grow $md0 -n 2 @@ -21,7 +21,7 @@ mdadm -S $md0 # same again for version-1 -mdadm -CR $md0 -l1 -n2 -e1.2 -x1 $dev0 $dev1 $dev2 +mdadm -CR $md0 -l1 -n2 -e1.2 -x1 $dev0 $dev1 $dev2 check resync check wait check state UU @@ -31,7 +31,7 @@ check recovery check wait check state UUU -mdadm $md0 --fail $dev0 +mdadm $md0 --fail $dev0 check state _UU mdadm --grow $md0 -n 2 diff --git a/tests/02r1grow b/tests/02r1grow index 6604208d..5754c88b 100644 --- a/tests/02r1grow +++ b/tests/02r1grow @@ -2,7 +2,7 @@ # create a small raid1 array, make it larger. Then make it smaller -mdadm -CR $md0 -e 0.90 --level raid1 --raid-disks 3 --size $[size/2] $dev1 $dev2 $dev3 +mdadm -CR $md0 -e 0.90 --level raid1 --raid-disks 3 --size $[size/2] $dev1 $dev2 $dev3 check wait check state UUU testdev $md0 1 $[size/2] 1 @@ -19,7 +19,7 @@ testdev $md0 1 $[size/2] 1 mdadm -S $md0 # same again with version 1.1 superblock -mdadm -CR $md0 --level raid1 --metadata=1.1 --raid-disks 3 --size $[size/2] $dev1 $dev2 $dev3 +mdadm -CR $md0 --level raid1 --metadata=1.1 --raid-disks 3 --size $[size/2] $dev1 $dev2 $dev3 check wait check state UUU testdev $md0 1 $[size/2] 1 diff --git a/tests/02r5grow b/tests/02r5grow index b91ffcd4..386e82ee 100644 --- a/tests/02r5grow +++ b/tests/02r5grow @@ -2,7 +2,7 @@ # create a small raid5 array, make it larger. Then make it smaller -mdadm -CR $md0 -e0.90 --level raid5 --chunk=64 --raid-disks 3 --size $[size/2] $dev1 $dev2 $dev3 +mdadm -CR $md0 -e0.90 --level raid5 --chunk=64 --raid-disks 3 --size $[size/2] $dev1 $dev2 $dev3 check wait check state UUU testdev $md0 2 $[size/2] 32 @@ -19,7 +19,7 @@ testdev $md0 2 $[size/2] 32 mdadm -S $md0 # same again with version 1.1 superblock -mdadm -CR $md0 --level raid5 --metadata=1.1 --chunk=128 --raid-disks 4 --size $[size/2] $dev1 $dev2 $dev3 $dev4 +mdadm -CR $md0 --level raid5 --metadata=1.1 --chunk=128 --raid-disks 4 --size $[size/2] $dev1 $dev2 $dev3 $dev4 check wait check state UUUU testdev $md0 3 $[size/2] 128 diff --git a/tests/02r6grow b/tests/02r6grow index 38c77810..759e6275 100644 --- a/tests/02r6grow +++ b/tests/02r6grow @@ -2,7 +2,7 @@ # create a small raid6 array, make it larger. Then make it smaller -mdadm -CR $md0 -e 0.90 --level raid6 --chunk=64 --raid-disks 4 --size $[size/2] $dev1 $dev2 $dev3 $dev4 +mdadm -CR $md0 -e 0.90 --level raid6 --chunk=64 --raid-disks 4 --size $[size/2] $dev1 $dev2 $dev3 $dev4 check wait check state UUUU testdev $md0 2 $[size/2] 32 @@ -19,7 +19,7 @@ testdev $md0 2 $[size/2] 32 mdadm -S $md0 # same again with version 1.1 superblock -mdadm -CR $md0 --level raid6 --metadata=1.1 --chunk=128 --raid-disks 4 --size $[size/2] $dev1 $dev2 $dev3 $dev4 +mdadm -CR $md0 --level raid6 --metadata=1.1 --chunk=128 --raid-disks 4 --size $[size/2] $dev1 $dev2 $dev3 $dev4 check wait check state UUUU testdev $md0 2 $[size/2] 128 diff --git a/tests/03r0assem b/tests/03r0assem index 0b998ec1..6744e322 100644 --- a/tests/03r0assem +++ b/tests/03r0assem @@ -4,63 +4,63 @@ # uuid, md-minor on command line with wildcard devices # mdadm.conf file -mdadm -CR $md2 -l0 -n3 $dev0 $dev1 $dev2 +mdadm -CR $md2 -l0 -n3 $dev0 $dev1 $dev2 check raid0 tst="testdev $md2 3 $mdsize1_l 512" $tst uuid=`mdadm -Db $md2 | sed 's/.*UUID=//'` mdadm -S $md2 -mdadm -A $md2 $dev0 $dev1 $dev2 +mdadm -A $md2 $dev0 $dev1 $dev2 $tst mdadm -S $md2 -mdadm -A $md2 -u $uuid $devlist +mdadm -A $md2 -u $uuid $devlist $tst mdadm -S $md2 -mdadm --assemble $md2 --name=2 $devlist +mdadm --assemble $md2 --name=2 $devlist $tst mdadm -S $md2 conf=$targetdir/mdadm.conf -{ +{ echo DEVICE $devlist echo array $md2 UUID=$uuid } > $conf -mdadm -As -c $conf $md2 +mdadm -As -c $conf $md2 $tst mdadm -S $md2 -{ +{ echo DEVICE $devlist echo array $md2 name=2 } > $conf -mdadm -As -c $conf $md2 +mdadm -As -c $conf $md2 $tst mdadm -S $md2 -{ +{ echo DEVICE $devlist echo array $md2 devices=$dev0,$dev1,$dev2 } > $conf -mdadm -As -c $conf $md2 +mdadm -As -c $conf $md2 $tst echo "DEVICE $devlist" > $conf mdadm -Db $md2 >> $conf mdadm -S $md2 -mdadm --assemble --scan --config=$conf $md2 +mdadm --assemble --scan --config=$conf $md2 $tst mdadm -S $md2 echo " metadata=0.90 devices=$dev0,$dev1,$dev2" >> $conf -mdadm --assemble --scan --config=$conf $md2 +mdadm --assemble --scan --config=$conf $md2 $tst mdadm -S $md2 @@ -68,7 +68,7 @@ mdadm -S $md2 ### Now for version 0... mdadm --zero-superblock $dev0 $dev1 $dev2 -mdadm -CR $md2 -l0 --metadata=0.90 -n3 $dev0 $dev1 $dev2 +mdadm -CR $md2 -l0 --metadata=0.90 -n3 $dev0 $dev1 $dev2 check raid0 tst="testdev $md2 3 $mdsize0 512" $tst @@ -76,56 +76,56 @@ $tst uuid=`mdadm -Db $md2 | sed 's/.*UUID=//'` mdadm -S $md2 -mdadm -A $md2 $dev0 $dev1 $dev2 +mdadm -A $md2 $dev0 $dev1 $dev2 $tst mdadm -S $md2 -mdadm -A $md2 -u $uuid $devlist +mdadm -A $md2 -u $uuid $devlist $tst mdadm -S $md2 -mdadm --assemble $md2 --super-minor=2 $devlist # +mdadm --assemble $md2 --super-minor=2 $devlist # $tst mdadm -S $md2 conf=$targetdir/mdadm.conf -{ +{ echo DEVICE $devlist echo array $md2 UUID=$uuid } > $conf -mdadm -As -c $conf $md2 +mdadm -As -c $conf $md2 $tst mdadm -S $md2 -{ +{ echo DEVICE $devlist echo array $md2 super-minor=2 } > $conf -mdadm -As -c $conf $md2 +mdadm -As -c $conf $md2 $tst mdadm -S $md2 -{ +{ echo DEVICE $devlist echo array $md2 devices=$dev0,$dev1,$dev2 } > $conf -mdadm -As -c $conf $md2 +mdadm -As -c $conf $md2 $tst echo "DEVICE $devlist" > $conf mdadm -Db $md2 >> $conf mdadm -S $md2 -mdadm --assemble --scan --config=$conf $md2 +mdadm --assemble --scan --config=$conf $md2 $tst mdadm -S $md2 echo " metadata=1 devices=$dev0,$dev1,$dev2" >> $conf -mdadm --assemble --scan --config=$conf $md2 +mdadm --assemble --scan --config=$conf $md2 $tst mdadm -S $md2 diff --git a/tests/03r5assem b/tests/03r5assem index de0d56b6..0c7fb8c6 100644 --- a/tests/03r5assem +++ b/tests/03r5assem @@ -2,108 +2,108 @@ # create a raid5 array and assemble it in various ways, # including with missing devices. -mdadm -CR -e 0.90 $md1 -l5 -n3 $dev0 $dev1 $dev2 +mdadm -CR -e 0.90 $md1 -l5 -n3 $dev0 $dev1 $dev2 tst="check raid5 ;testdev $md1 2 $mdsize0 512 ; mdadm -S $md1" uuid=`mdadm -Db $md1 | sed 's/.*UUID=//'` check wait eval $tst -mdadm -A $md1 $dev0 $dev1 $dev2 +mdadm -A $md1 $dev0 $dev1 $dev2 eval $tst -mdadm -A $md1 -u $uuid $devlist +mdadm -A $md1 -u $uuid $devlist eval $tst -mdadm -A $md1 -m 1 $devlist +mdadm -A $md1 -m 1 $devlist eval $tst conf=$targetdir/mdadm.conf -{ +{ echo DEVICE $devlist echo array $md1 UUID=$uuid } > $conf -mdadm -As -c $conf $md1 +mdadm -As -c $conf $md1 eval $tst -{ +{ echo DEVICE $devlist echo array $md1 super-minor=1 } > $conf -mdadm -As -c $conf +mdadm -As -c $conf eval $tst -{ +{ echo DEVICE $devlist echo array $md1 devices=$dev0,$dev1,$dev2 } > $conf -mdadm -As -c $conf +mdadm -As -c $conf echo "DEVICE $devlist" > $conf mdadm -Db $md1 >> $conf eval $tst -mdadm --assemble --scan --config=$conf $md1 +mdadm --assemble --scan --config=$conf $md1 eval $tst echo " metadata=0.90 devices=$dev0,$dev1,$dev2" >> $conf -mdadm --assemble --scan --config=$conf $md1 +mdadm --assemble --scan --config=$conf $md1 eval $tst ### Now with a missing device -mdadm -AR $md1 $dev0 $dev2 # +mdadm -AR $md1 $dev0 $dev2 # check state U_U eval $tst -mdadm -A $md1 -u $uuid $devlist +mdadm -A $md1 -u $uuid $devlist check state U_U eval $tst -mdadm -A $md1 -m 1 $devlist +mdadm -A $md1 -m 1 $devlist check state U_U eval $tst conf=$targetdir/mdadm.conf -{ +{ echo DEVICE $devlist echo array $md1 UUID=$uuid } > $conf -mdadm -As -c $conf $md1 +mdadm -As -c $conf $md1 check state U_U eval $tst -{ +{ echo DEVICE $devlist echo array $md1 super-minor=1 } > $conf -mdadm -As -c $conf +mdadm -As -c $conf check state U_U eval $tst -{ +{ echo DEVICE $devlist echo array $md1 devices=$dev0,$dev1,$dev2 } > $conf -mdadm -As -c $conf +mdadm -As -c $conf echo "DEVICE $devlist" > $conf mdadm -Db $md1 >> $conf check state U_U eval $tst -mdadm --assemble --scan --config=$conf $md1 +mdadm --assemble --scan --config=$conf $md1 check state U_U eval $tst echo " metadata=0.90 devices=$dev0,$dev1,$dev2" >> $conf -mdadm --assemble --scan --config=$conf $md1 +mdadm --assemble --scan --config=$conf $md1 check state U_U eval $tst diff --git a/tests/04r0update b/tests/04r0update index 0cd815ac..73ee3b9f 100644 --- a/tests/04r0update +++ b/tests/04r0update @@ -1,15 +1,15 @@ # create a raid0, re-assemble with a different super-minor -mdadm -CR -e 0.90 $md0 -l0 -n3 $dev0 $dev1 $dev2 +mdadm -CR -e 0.90 $md0 -l0 -n3 $dev0 $dev1 $dev2 testdev $md0 3 $mdsize0 512 minor1=`mdadm -E $dev0 | sed -n -e 's/.*Preferred Minor : //p'` mdadm -S /dev/md0 -mdadm -A $md1 $dev0 $dev1 $dev2 +mdadm -A $md1 $dev0 $dev1 $dev2 minor2=`mdadm -E $dev0 | sed -n -e 's/.*Preferred Minor : //p'` mdadm -S /dev/md1 -mdadm -A $md1 --update=super-minor $dev0 $dev1 $dev2 +mdadm -A $md1 --update=super-minor $dev0 $dev1 $dev2 minor3=`mdadm -E $dev0 | sed -n -e 's/.*Preferred Minor : //p'` mdadm -S /dev/md1 diff --git a/tests/04r1update b/tests/04r1update index 7a50131f..e22965bc 100644 --- a/tests/04r1update +++ b/tests/04r1update @@ -2,14 +2,14 @@ set -i # create a raid1 array, let it sync, then re-assemble with a force-sync -mdadm -CR $md0 -l1 -n2 $dev0 $dev1 +mdadm -CR $md0 -l1 -n2 $dev0 $dev1 check wait mdadm -S $md0 -mdadm -A $md0 $dev0 $dev1 +mdadm -A $md0 $dev0 $dev1 check nosync mdadm -S $md0 -mdadm -A $md0 -U resync $dev0 $dev1 +mdadm -A $md0 -U resync $dev0 $dev1 check resync mdadm -S $md0 diff --git a/tests/04update-metadata b/tests/04update-metadata index 10bb70f0..232fc1ff 100644 --- a/tests/04update-metadata +++ b/tests/04update-metadata @@ -32,7 +32,7 @@ then echo >&2 should fail during resync exit 1 fi mdadm -A $md0 $dlist -mdadm --wait $md0 +mdadm --wait $md0 || true mdadm -S $md0 # should succeed now diff --git a/tests/05r1-add-internalbitmap-v1b b/tests/05r1-add-internalbitmap-v1b index b077fa7e..da78fd61 100644 --- a/tests/05r1-add-internalbitmap-v1b +++ b/tests/05r1-add-internalbitmap-v1b @@ -1,4 +1,4 @@ -# +# # create a raid1 without any bitmap, add the bitmap and then write to # the device. This should catch the case where the bitmap is created # but not reloaded correctly, such as the case fixed by diff --git a/tests/05r1-add-internalbitmap-v1c b/tests/05r1-add-internalbitmap-v1c index 7b397844..9f2f128b 100644 --- a/tests/05r1-add-internalbitmap-v1c +++ b/tests/05r1-add-internalbitmap-v1c @@ -1,4 +1,4 @@ -# +# # create a raid1 without any bitmap, add the bitmap and then write to # the device. This should catch the case where the bitmap is created # but not reloaded correctly, such as the case fixed by diff --git a/tests/05r1-bitmapfile b/tests/05r1-bitmapfile index fcd8372b..f384f0ea 100644 --- a/tests/05r1-bitmapfile +++ b/tests/05r1-bitmapfile @@ -1,10 +1,10 @@ -# +# # create a raid1 with a bitmap file # bmf=$targetdir/bitmap rm -f $bmf -mdadm --create --run $md0 --level=1 -n2 --delay=1 --bitmap $bmf $dev1 $dev2 +mdadm --create --run $md0 --level=1 -n2 --delay=1 --bitmap $bmf $dev1 $dev2 check wait testdev $md0 1 $mdsize1a 64 mdadm -S $md0 @@ -24,7 +24,7 @@ testdev $md0 1 $mdsize1a 64 sleep 4 dirty3=`mdadm -X $bmf | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'` if [ $dirty3 -lt 400 ] -then +then echo >&2 "ERROR dirty count $dirty3 is too small" exit 2 fi diff --git a/tests/05r1-grow-external b/tests/05r1-grow-external index 49666369..69da3e90 100644 --- a/tests/05r1-grow-external +++ b/tests/05r1-grow-external @@ -21,7 +21,7 @@ dirty4=`mdadm -X $bmf | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'` #echo $dirty1 $dirty2 $dirty3 $dirty4 if [ $dirty2 -ne 0 -o $dirty4 -ne 0 -o $dirty3 -lt 400 ] -then +then echo bad dirty counts exit 1 fi diff --git a/tests/05r1-grow-internal b/tests/05r1-grow-internal index a648b440..24b3aece 100644 --- a/tests/05r1-grow-internal +++ b/tests/05r1-grow-internal @@ -19,7 +19,7 @@ dirty4=`mdadm -X $dev2 | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'` #echo $dirty1 $dirty2 $dirty3 $dirty4 if [ $dirty2 -ne 0 -o $dirty4 -ne 0 -o $dirty3 -lt 400 ] -then +then echo bad dirty counts exit 1 fi diff --git a/tests/05r1-grow-internal-1 b/tests/05r1-grow-internal-1 index a110f3b0..2f0d8237 100644 --- a/tests/05r1-grow-internal-1 +++ b/tests/05r1-grow-internal-1 @@ -19,7 +19,7 @@ dirty4=`mdadm -X $dev2 | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'` #echo $dirty1 $dirty2 $dirty3 $dirty4 if [ $dirty2 -ne 0 -o $dirty4 -ne 0 -o $dirty3 -lt 400 ] -then +then echo bad dirty counts exit 1 fi diff --git a/tests/05r1-internalbitmap b/tests/05r1-internalbitmap index 2bfeab8e..dd7232a7 100644 --- a/tests/05r1-internalbitmap +++ b/tests/05r1-internalbitmap @@ -1,8 +1,8 @@ -# +# # create a raid1 with an internal bitmap # -mdadm --create -e0.90 --run $md0 --level=1 -n2 --delay=1 --bitmap internal --bitmap-chunk=4 $dev1 $dev2 +mdadm --create -e0.90 --run $md0 --level=1 -n2 --delay=1 --bitmap internal --bitmap-chunk=4 $dev1 $dev2 check wait testdev $md0 1 $mdsize0 64 mdadm -S $md0 @@ -22,7 +22,7 @@ testdev $md0 1 $mdsize0 64 sleep 4 dirty3=`mdadm -X $dev2 | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'` if [ $dirty3 -lt 400 ] -then +then echo >&2 "ERROR dirty count $dirty3 is too small" exit 2 fi diff --git a/tests/05r1-internalbitmap-v1a b/tests/05r1-internalbitmap-v1a index 3fcb0249..3ddc082f 100644 --- a/tests/05r1-internalbitmap-v1a +++ b/tests/05r1-internalbitmap-v1a @@ -1,8 +1,8 @@ -# +# # create a raid1 with an internal bitmap # -mdadm --create --run $md0 --metadata=1.0 --level=1 -n2 --delay=1 --bitmap internal --bitmap-chunk=4 $dev1 $dev2 +mdadm --create --run $md0 --metadata=1.0 --level=1 -n2 --delay=1 --bitmap internal --bitmap-chunk=4 $dev1 $dev2 check wait check bitmap testdev $md0 1 $mdsize1b 64 @@ -23,7 +23,7 @@ testdev $md0 1 $mdsize1b 64 sleep 4 dirty3=`mdadm -X $dev2 | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'` if [ $dirty3 -lt 400 ] -then +then echo >&2 "ERROR dirty count $dirty3 is too small" exit 2 fi diff --git a/tests/05r1-internalbitmap-v1b b/tests/05r1-internalbitmap-v1b index 1097536b..40f7abea 100644 --- a/tests/05r1-internalbitmap-v1b +++ b/tests/05r1-internalbitmap-v1b @@ -1,8 +1,8 @@ -# +# # create a raid1 with an internal bitmap # -mdadm --create --run $md0 --metadata=1.1 --level=1 -n2 --delay=1 --bitmap internal --bitmap-chunk=4 $dev1 $dev2 +mdadm --create --run $md0 --metadata=1.1 --level=1 -n2 --delay=1 --bitmap internal --bitmap-chunk=4 $dev1 $dev2 check wait check bitmap testdev $md0 1 $mdsize11 64 @@ -24,7 +24,7 @@ testdev $md0 1 $mdsize11 64 sleep 4 dirty3=`mdadm -X $dev2 | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'` if [ $dirty3 -lt 400 ] -then +then echo >&2 "ERROR dirty count $dirty3 is too small" exit 2 fi diff --git a/tests/05r1-internalbitmap-v1c b/tests/05r1-internalbitmap-v1c index f6bbcf6b..2eaea59b 100644 --- a/tests/05r1-internalbitmap-v1c +++ b/tests/05r1-internalbitmap-v1c @@ -1,8 +1,8 @@ -# +# # create a raid1 with an internal bitmap # -mdadm --create --run $md0 --metadata=1.2 --level=1 -n2 --delay=1 --bitmap internal --bitmap-chunk 4 $dev1 $dev2 +mdadm --create --run $md0 --metadata=1.2 --level=1 -n2 --delay=1 --bitmap internal --bitmap-chunk 4 $dev1 $dev2 check wait check bitmap testdev $md0 1 $mdsize12 64 @@ -23,7 +23,7 @@ testdev $md0 1 $mdsize12 64 sleep 4 dirty3=`mdadm -X $dev2 | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'` if [ $dirty3 -lt 400 ] -then +then echo >&2 "ERROR dirty count $dirty3 is too small" exit 2 fi diff --git a/tests/05r1-n3-bitmapfile b/tests/05r1-n3-bitmapfile index 1bb9af16..f1c3f1ee 100644 --- a/tests/05r1-n3-bitmapfile +++ b/tests/05r1-n3-bitmapfile @@ -1,12 +1,12 @@ -# +# # create a raid1 with 3 devices and a bitmap file # make sure resync does right thing. # # bmf=$targetdir/bitmap rm -f $bmf -mdadm --create -e0.90 --run $md0 --level=1 -n3 --delay=1 --bitmap $bmf $dev1 $dev2 $dev3 +mdadm --create -e0.90 --run $md0 --level=1 -n3 --delay=1 --bitmap $bmf $dev1 $dev2 $dev3 check wait testdev $md0 1 $mdsize0 64 mdadm -S $md0 @@ -26,7 +26,7 @@ testdev $md0 1 $mdsize0 64 sleep 4 dirty3=`mdadm -X $bmf | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'` if [ $dirty3 -lt 400 ] -then +then echo >&2 "ERROR dirty count $dirty3 is too small" exit 2 fi diff --git a/tests/05r1-re-add b/tests/05r1-re-add index 44da8908..fa6bbcb4 100644 --- a/tests/05r1-re-add +++ b/tests/05r1-re-add @@ -24,13 +24,16 @@ mdadm $md0 -r $dev2 testdev $md0 1 $mdsize1a 64 mdadm $md0 -a $dev2 check wait -cmp --ignore-initial=$[16*512] --bytes=$[$mdsize0*1024] $dev1 $dev2 +blockdev --flushbufs $dev1 $dev2 +cmp --ignore-initial=$[64*512] --bytes=$[$mdsize0*1024] $dev1 $dev2 mdadm $md0 -f $dev2; sleep 1 mdadm $md0 -r $dev2 if dd if=/dev/zero of=$md0 ; then : ; fi +blockdev --flushbufs $md0 # ensure writes have been sent. mdadm $md0 -a $dev2 check recovery check wait -cmp --ignore-initial=$[16*512] --bytes=$[$mdsize0*1024] $dev1 $dev2 +blockdev --flushbufs $dev1 $dev2 +cmp --ignore-initial=$[64*512] --bytes=$[$mdsize0*1024] $dev1 $dev2 mdadm -S $md0 diff --git a/tests/05r1-re-add-nosuper b/tests/05r1-re-add-nosuper index 8025a685..058d602d 100644 --- a/tests/05r1-re-add-nosuper +++ b/tests/05r1-re-add-nosuper @@ -29,6 +29,7 @@ cmp --bytes=$[$mdsize0*1024] $dev1 $dev2 mdadm $md0 -f $dev2; sleep 1 mdadm $md0 -r $dev2 if dd if=/dev/zero of=$md0 ; then : ; fi +blockdev --flushbufs $md0 # make sure writes have been sent mdadm $md0 --re-add $dev2 check recovery check wait diff --git a/tests/05r6tor0 b/tests/05r6tor0 index 2e0f1853..2fd51f2e 100644 --- a/tests/05r6tor0 +++ b/tests/05r6tor0 @@ -4,24 +4,24 @@ set -x -e # then reshape back up to RAID5 and RAID5 mdadm -CR $md0 -l6 -n5 $dev0 $dev1 $dev2 $dev3 $dev4 -check wait +check wait; sleep 1 check raid6 testdev $md0 3 19456 512 mdadm -G $md0 -l5 -check wait +check wait; sleep 1 check raid5 testdev $md0 3 19456 512 mdadm -G $md0 -l0 -check wait +check wait; sleep 1 check raid0 testdev $md0 3 19456 512 mdadm -G $md0 -l5 --add $dev3 $dev4 -check wait +check wait; sleep 1 check raid5 check algorithm 2 testdev $md0 3 19456 512 mdadm -G $md0 -l 6 -check wait +check wait; sleep 1 check raid6 check algorithm 2 testdev $md0 3 19456 512 diff --git a/tests/07changelevelintr b/tests/07changelevelintr index 89cfff0c..18c63092 100644 --- a/tests/07changelevelintr +++ b/tests/07changelevelintr @@ -12,7 +12,8 @@ checkgeo() { shift sleep 0.5 check wait - for attr in level raid_disks chunk_size layout + sleep 1 + for attr in level raid_disks chunk_size layout do if [ $# -gt 0 ] ; then val=$1 diff --git a/tests/07changelevels b/tests/07changelevels index d33e007c..a328874a 100644 --- a/tests/07changelevels +++ b/tests/07changelevels @@ -26,7 +26,8 @@ checkgeo() { shift sleep 0.5 check wait - for attr in level raid_disks chunk_size layout + sleep 1 + for attr in level raid_disks chunk_size layout do if [ $# -gt 0 ] ; then val=$1 @@ -38,7 +39,7 @@ checkgeo() { fi done } - + bu=/tmp/md-test-backup rm -f $bu diff --git a/tests/07layouts b/tests/07layouts index 4c20eb8b..acd1a800 100644 --- a/tests/07layouts +++ b/tests/07layouts @@ -28,7 +28,7 @@ checkgeo() { shift sleep 0.5 check wait - for attr in level raid_disks chunk_size layout + for attr in level raid_disks chunk_size layout do if [ $# -gt 0 ] ; then val=$1 @@ -40,7 +40,7 @@ checkgeo() { fi done } - + bu=/tmp/md-test-backup rm -f $bu diff --git a/tests/07reshape5intr b/tests/07reshape5intr index 71ef2c78..0f4803ac 100644 --- a/tests/07reshape5intr +++ b/tests/07reshape5intr @@ -31,7 +31,7 @@ do echo 1000 > /proc/sys/dev/raid/speed_limit_min echo 2000 > /proc/sys/dev/raid/speed_limit_max check wait - echo check > /sys/block/md0/md/sync_action + while ! echo check > /sys/block/md0/md/sync_action; do sleep 0.1; done check wait mm=`cat /sys/block/md0/md/mismatch_cnt` if [ $mm -gt 0 ] diff --git a/tests/07revert-inplace b/tests/07revert-inplace index 48416c8f..a73eb977 100644 --- a/tests/07revert-inplace +++ b/tests/07revert-inplace @@ -8,7 +8,7 @@ mdadm -CR --assume-clean $md0 -l5 -n4 -x1 $devlist4 check raid5 testdev $md0 3 $mdsize1 512 mdadm -G $md0 -l 6 -sleep 3 +sleep 2 mdadm -S $md0 mdadm -A $md0 --update=revert-reshape $devlist4 --backup-file=/tmp/md-backup check wait @@ -22,7 +22,7 @@ mdadm -CR --assume-clean $md0 -l6 -n5 $devlist4 check raid6 testdev $md0 3 $mdsize1 512 mdadm -G $md0 -l 5 -sleep 3 +sleep 2 mdadm -S $md0 mdadm -A $md0 --update=revert-reshape $devlist4 --backup-file=/tmp/md-backup check wait @@ -35,7 +35,7 @@ mdadm -CR --assume-clean $md0 -l10 -n6 -c 64 $devlist5 check raid10 testdev $md0 3 $mdsize1 64 mdadm -G $md0 -c 32 -sleep 3 +sleep 2 mdadm -S $md0 strace -o /tmp/str ./mdadm -A $md0 --update=revert-reshape $devlist5 check wait diff --git a/tests/09imsm-assemble b/tests/09imsm-assemble index 2a42369e..d7028c62 100644 --- a/tests/09imsm-assemble +++ b/tests/09imsm-assemble @@ -31,19 +31,19 @@ num_disks=4 size=$((10*1024)) mdadm -CR $container -e imsm -n $num_disks $dev0 $dev1 $dev2 $dev3 mdadm -CR $member $dev0 $dev2 -n 2 -l 1 -z $size -mdadm --wait $member +mdadm --wait $member || true mdadm -Ss # make dev0 and dev1 a new rebuild family mdadm -A $container $dev0 $dev1 mdadm -IR $container -mdadm --wait ${member}_0 +mdadm --wait ${member}_0 || true mdadm -Ss # make dev2 and dev3 a new rebuild family mdadm -A $container $dev2 $dev3 mdadm -IR $container -mdadm --wait ${member}_0 +mdadm --wait ${member}_0 || true mdadm -Ss # reassemble and make sure one of the families falls out diff --git a/tests/09imsm-create-fail-rebuild b/tests/09imsm-create-fail-rebuild index 4b656b53..de17f321 100644 --- a/tests/09imsm-create-fail-rebuild +++ b/tests/09imsm-create-fail-rebuild @@ -71,7 +71,7 @@ check wait # FAIL / REBUILD imsm_check_hold $container $dev0 mdadm --fail $member0 $dev0 -mdadm --wait-clean --scan +mdadm --wait-clean --scan || true imsm_check_removal $container $dev0 mdadm --add $container $dev4 check wait diff --git a/tests/10ddf-assemble-missing b/tests/10ddf-assemble-missing index 17f17244..4bf21b25 100644 --- a/tests/10ddf-assemble-missing +++ b/tests/10ddf-assemble-missing @@ -12,8 +12,8 @@ ddf_check container 4 mdadm -CR $member1 -n 4 -l 10 $dev8 $dev10 $dev9 $dev11 -z 10000 mdadm -CR $member0 -n 2 -l 1 $dev8 $dev9 -z 10000 -mdadm --wait $member0 -mdadm --wait $member1 +mdadm --wait $member0 || true +mdadm --wait $member1 || true mdadm -Ss sleep 1 @@ -23,7 +23,7 @@ mdadm -I $dev10 mdadm -I $dev11 # Start runnable members -mdadm -IRs +mdadm -IRs || true mdadm -Ss #[ -f /var/tmp/mdmon.log ] && cat /var/tmp/mdmon.log diff --git a/tests/10ddf-create b/tests/10ddf-create index 2f7747cd..44e95441 100644 --- a/tests/10ddf-create +++ b/tests/10ddf-create @@ -78,7 +78,7 @@ mdadm -Ss # and now assemble fully incrementally. for i in $dev8 $dev9 $dev10 $dev11 $dev12 -do +do mdadm -I $i -c /var/tmp/mdadm.conf done check nosync diff --git a/tests/10ddf-create-fail-rebuild b/tests/10ddf-create-fail-rebuild index 525c24d3..a8e8ced9 100644 --- a/tests/10ddf-create-fail-rebuild +++ b/tests/10ddf-create-fail-rebuild @@ -70,7 +70,7 @@ check wait # FAIL / REBUILD ddf_check_hold $container $dev8 mdadm --fail $member0 $dev8 -mdadm --wait-clean --scan +mdadm --wait-clean --scan || true ddf_check_removal $container $dev8 mdadm --add $container $dev12 check wait diff --git a/tests/10ddf-fail-readd b/tests/10ddf-fail-readd index 746f049e..9cd78937 100644 --- a/tests/10ddf-fail-readd +++ b/tests/10ddf-fail-readd @@ -10,7 +10,7 @@ mdadm -CR $container -e ddf -l container -n 2 $dev8 $dev9 mdadm -CR $member0 -l raid1 -n 2 $container #$dir/mdadm -CR $member0 -l raid1 -n 2 $container >/tmp/mdmon.txt 2>&1 -mke2fs $member0 +mke2fs -F $member0 check wait set -- $(get_raiddisks $member0) @@ -28,7 +28,7 @@ good0=$1 mdadm $container --add $fail0 sleep 1 -mdadm --wait $member0 +mdadm --wait $member0 || true ret=0 set -- $(get_raiddisks $member0) diff --git a/tests/10ddf-fail-readd-readonly b/tests/10ddf-fail-readd-readonly index ed24585d..6a74d9c8 100644 --- a/tests/10ddf-fail-readd-readonly +++ b/tests/10ddf-fail-readd-readonly @@ -45,7 +45,7 @@ mdadm $container --remove $fail0 mdadm $container --add $fail0 sleep 1 -mdadm --wait $member0 +mdadm --wait $member0 || true set -- $(get_raiddisks $member0) case $1:$2 in diff --git a/tests/10ddf-fail-stop-readd b/tests/10ddf-fail-stop-readd index 4a0511a1..f8ebe176 100644 --- a/tests/10ddf-fail-stop-readd +++ b/tests/10ddf-fail-stop-readd @@ -11,7 +11,7 @@ mdadm -CR $member0 -l raid1 -n 2 $container #$dir/mdadm -CR $member0 -l raid1 -n 2 $container >/tmp/mdmon.txt 2>&1 # Write to the array -mke2fs $member0 +mke2fs -F $member0 check wait set -- $(get_raiddisks $member0) @@ -30,16 +30,16 @@ mdadm -Ss sleep 1 # Now simulate incremental assembly mdadm -I $good0 -mdadm -IRs +mdadm -IRs || true # Write to the array -mke2fs $member0 +mke2fs -F $member0 # We re-add the disk now mdadm $container --add $fail0 sleep 1 -mdadm --wait $member0 +mdadm --wait $member0 || true ret=0 set -- $(get_raiddisks $member0) diff --git a/tests/10ddf-fail-twice b/tests/10ddf-fail-twice index d0b4ac61..6af19434 100644 --- a/tests/10ddf-fail-twice +++ b/tests/10ddf-fail-twice @@ -7,7 +7,7 @@ ddf_check container $num_disks mdadm -CR $member0 -n 2 -l 1 $container mdadm -CR $member1 -n 3 -l 5 $container -mdadm --wait $member1 $member0 || mdadm --wait $member1 $member0 +mdadm --wait $member1 $member0 || mdadm --wait $member1 $member0 || true set -- $(get_raiddisks $member0) fail0=$1 @@ -18,7 +18,7 @@ mdadm $member1 --fail $fail1 mdadm $container --add $dev13 -mdadm --wait $member1 $member0 || mdadm --wait $member1 $member0 +mdadm --wait $member1 $member0 || mdadm --wait $member1 $member0 || true devs0="$(get_raiddisks $member0)" diff --git a/tests/10ddf-fail-two-spares b/tests/10ddf-fail-two-spares index fa6e2e8c..e00810d8 100644 --- a/tests/10ddf-fail-two-spares +++ b/tests/10ddf-fail-two-spares @@ -14,8 +14,8 @@ mdadm -CR $member0 -l raid6 -n 4 $dev10 $dev11 $dev12 $dev13 -z 16384 # >/tmp/mdmon.txt 2>&1 mdadm -CR $member1 -l raid10 -n 4 $dev10 $dev11 $dev12 $dev13 -z 16384 -dd if=$sda of=$member0 bs=1M -dd if=$sda of=$member1 bs=1M skip=16 +dd if=$sda of=$member0 bs=1M count=32 +dd if=$sda of=$member1 bs=1M skip=16 count=16 check wait @@ -27,8 +27,8 @@ sleep 1 mdadm --fail $member1 $dev12 # We will have 4 resync procedures, 2 spares for 2 arrays. -mdadm --wait $member1 $member0 -mdadm --wait $member1 $member0 +mdadm --wait $member1 $member0 || true +mdadm --wait $member1 $member0 || true devs0="$(get_raiddisks $member0)" devs1="$(get_raiddisks $member1)" diff --git a/tests/10ddf-incremental-wrong-order b/tests/10ddf-incremental-wrong-order index 2324f1d7..9ecf6bc2 100644 --- a/tests/10ddf-incremental-wrong-order +++ b/tests/10ddf-incremental-wrong-order @@ -14,11 +14,11 @@ ddf_check container 4 mdadm -CR $member1 -n 4 -l 10 $dev8 $dev10 $dev9 $dev11 -z 10000 mdadm -CR $member0 -n 2 -l 1 $dev8 $dev9 -z 10000 -mdadm --wait $member0 -mdadm --wait $member1 +mdadm --wait $member0 || true +mdadm --wait $member1 || true -mke2fs $member0 -mke2fs $member1 +mke2fs -F $member0 +mke2fs -F $member1 sha_0a=$(sha1_sum $member0) sha_1a=$(sha1_sum $member1) @@ -30,7 +30,7 @@ mdadm -I $dev10 mdadm -I $dev11 # Start runnable members ($member1) and write -mdadm -IRs +mdadm -IRs || true e2fsck -fy $member1 sha_1b=$(sha1_sum $member1) @@ -52,14 +52,14 @@ fi #[ -f /var/tmp/mdmon.log ] && cat /var/tmp/mdmon.log -# Now reassemble +# Now reassemble # Note that we add the previously missing disks first. # $dev10 should have a higher seq number than $dev8 for d in $dev8 $dev9 $dev10 $dev11; do - mdadm -I $d + mdadm -I $d done -mdadm -IRs +mdadm -IRs || true sha_0c=$(sha1_sum $member0) sha_1c=$(sha1_sum $member1) diff --git a/tests/10ddf-sudden-degraded b/tests/10ddf-sudden-degraded index 1eab361a..dc692aea 100644 --- a/tests/10ddf-sudden-degraded +++ b/tests/10ddf-sudden-degraded @@ -8,7 +8,7 @@ mdadm -CR $container -e ddf -n 2 $dev8 $dev9 ddf_check container 2 mdadm -CR $member1 -n 2 -l1 $dev8 $dev9 -mdadm --wait $member1 +mdadm --wait $member1 || true mdadm -Ss mdadm -I $dev8 diff --git a/tests/18imsm-1d-takeover-r0_1d b/tests/18imsm-1d-takeover-r0_1d index bf462e27..6f5cf5a6 100644 --- a/tests/18imsm-1d-takeover-r0_1d +++ b/tests/18imsm-1d-takeover-r0_1d @@ -8,12 +8,11 @@ vol0_comp_size=$((10 * 1024)) # Create container mdadm --create --run $container --auto=md --metadata=imsm --force --raid-disks=$vol0_num_comps $dev0 -wait +check wait imsm_check container $vol0_num_comps # Create RAID 0 volume mdadm --create --run $member0 --auto=md --level=0 --size=$vol0_comp_size --chunk=64 --force --raid-disks=$vol0_num_comps $dev0 -wait check wait # Test the member diff --git a/tests/18imsm-1d-takeover-r1_2d b/tests/18imsm-1d-takeover-r1_2d index fa02b6c3..72e4173e 100644 --- a/tests/18imsm-1d-takeover-r1_2d +++ b/tests/18imsm-1d-takeover-r1_2d @@ -8,12 +8,11 @@ vol0_comp_size=$((10 * 1024)) # Create container mdadm --create --run $container --auto=md --metadata=imsm --force --raid-disks=$vol0_num_comps $dev0 -wait +check wait imsm_check container $vol0_num_comps # Create RAID 1 volume mdadm --create --run $member0 --auto=md --level=1 --size=$vol0_comp_size --chunk=64 --raid-disks=$((vol0_num_comps + 1)) $dev0 missing -wait check wait # Test the member0 diff --git a/tests/18imsm-r1_2d-takeover-r0_1d b/tests/18imsm-r1_2d-takeover-r0_1d index 1697d60e..cb10ec97 100644 --- a/tests/18imsm-r1_2d-takeover-r0_1d +++ b/tests/18imsm-r1_2d-takeover-r0_1d @@ -10,7 +10,7 @@ device_list="$dev0 $dev1" vol0_level=1 vol0_comp_size=$((5 * 1024)) vol0_chunk=64 -vol0_num_comps=$(( $num_disks - 1 )) +vol0_num_comps=$(( $num_disks - 1 )) vol0_offset=0 # After: RAID 0 volume, 1 disks, 64k chunk size diff --git a/tests/19raid6auto-repair b/tests/19raid6auto-repair index 23b14e4b..ce4a7c08 100644 --- a/tests/19raid6auto-repair +++ b/tests/19raid6auto-repair @@ -10,34 +10,40 @@ data_offset_in_kib=$[2048/2] # make a raid5 from a file dd if=/dev/urandom of=/tmp/RandFile bs=1024 count=$array_data_size_in_kib -mdadm -CR $md0 -l6 -n$number_of_disks -c $chunksize_in_kib $devs -dd if=/tmp/RandFile of=$md0 bs=1024 count=$array_data_size_in_kib -blockdev --flushbufs $md0; sync -check wait -blockdev --flushbufs $devs; sync -echo 3 > /proc/sys/vm/drop_caches -cmp -s -n $array_data_size_in_b $md0 /tmp/RandFile || { echo sanity cmp failed ; exit 2; } - -# wipe out 5 chunks on each device -dd if=/dev/urandom of=$dev0 bs=1024 count=$[5*chunksize_in_kib] seek=$[data_offset_in_kib+chunksize_in_kib*0] -dd if=/dev/urandom of=$dev1 bs=1024 count=$[5*chunksize_in_kib] seek=$[data_offset_in_kib+chunksize_in_kib*5] -dd if=/dev/urandom of=$dev2 bs=1024 count=$[5*chunksize_in_kib] seek=$[data_offset_in_kib+chunksize_in_kib*10] -dd if=/dev/urandom of=$dev3 bs=1024 count=$[5*chunksize_in_kib] seek=$[data_offset_in_kib+chunksize_in_kib*15] -dd if=/dev/urandom of=$dev4 bs=1024 count=$[5*chunksize_in_kib] seek=$[data_offset_in_kib+chunksize_in_kib*20] - -blockdev --flushbufs $devs; sync -echo 3 > /proc/sys/vm/drop_caches - -$dir/raid6check $md0 0 0 2>&1 | grep -qs "Error" || { echo should detect errors; exit 2; } - -$dir/raid6check $md0 0 0 autorepair > /dev/null || { echo repair failed; exit 2; } -blockdev --flushbufs $md0 $devs; sync -echo 3 > /proc/sys/vm/drop_caches - -$dir/raid6check $md0 0 0 2>&1 | grep -qs "Error" && { echo errors detected; exit 2; } -cmp -s -n $array_data_size_in_b $md0 /tmp/RandFile || { echo cmp failed ; exit 2; } - -mdadm -S $md0 -udevadm settle -blockdev --flushbufs $md0 $devs; sync -echo 3 > /proc/sys/vm/drop_caches + +# perform test for every layout +layouts="ls rs la ra parity-first ddf-zero-restart ddf-N-restart ddf-N-continue \ + left-asymmetric-6 right-asymmetric-6 left-symmetric-6 \ + right-symmetric-6 parity-first-6" + +for layout in $layouts +do + mdadm -CR $md0 -l6 --layout=$layout -n$number_of_disks -c $chunksize_in_kib $devs + dd if=/tmp/RandFile of=$md0 bs=1024 count=$array_data_size_in_kib + blockdev --flushbufs $md0; sync + check wait + blockdev --flushbufs $devs; sync + echo 3 > /proc/sys/vm/drop_caches + cmp -s -n $array_data_size_in_b $md0 /tmp/RandFile || { echo sanity cmp failed ; exit 2; } + + # wipe out 5 chunks on each device + dd if=/dev/urandom of=$dev0 bs=1024 count=$[5*chunksize_in_kib] seek=$[data_offset_in_kib+chunksize_in_kib*0] + dd if=/dev/urandom of=$dev1 bs=1024 count=$[5*chunksize_in_kib] seek=$[data_offset_in_kib+chunksize_in_kib*5] + dd if=/dev/urandom of=$dev2 bs=1024 count=$[5*chunksize_in_kib] seek=$[data_offset_in_kib+chunksize_in_kib*10] + dd if=/dev/urandom of=$dev3 bs=1024 count=$[5*chunksize_in_kib] seek=$[data_offset_in_kib+chunksize_in_kib*15] + dd if=/dev/urandom of=$dev4 bs=1024 count=$[5*chunksize_in_kib] seek=$[data_offset_in_kib+chunksize_in_kib*20] + + blockdev --flushbufs $devs; sync + echo 3 > /proc/sys/vm/drop_caches + + $dir/raid6check $md0 0 0 2>&1 | grep -qs "Error" || { echo should detect errors; exit 2; } + + $dir/raid6check $md0 0 0 autorepair > /dev/null || { echo repair failed; exit 2; } + blockdev --flushbufs $md0 $devs; sync + echo 3 > /proc/sys/vm/drop_caches + + $dir/raid6check $md0 0 0 2>&1 | grep -qs "Error" && { echo errors detected; exit 2; } + cmp -s -n $array_data_size_in_b $md0 /tmp/RandFile || { echo cmp failed ; exit 2; } + + mdadm -S $md0 +done diff --git a/tests/19raid6check b/tests/19raid6check new file mode 100644 index 00000000..67958c6a --- /dev/null +++ b/tests/19raid6check @@ -0,0 +1,27 @@ +# +# Confirm that raid6check handles all RAID6 layouts. +# Try both 4 and 5 devices. + +layouts='ls rs la ra' +lv=`uname -r` +if expr $lv '>=' 2.6.30 > /dev/null +then + layouts="$layouts parity-first ddf-zero-restart ddf-N-restart ddf-N-continue \ + left-asymmetric-6 right-asymmetric-6 left-symmetric-6 right-symmetric-6 parity-first-6" +fi + +for layout in $layouts +do + for devs in 4 5 + do + dl="$dev0 $dev1 $dev2 $dev3" + if [ $devs = 5 ]; then dl="$dl $dev4"; fi + + mdadm -CR $md0 -l6 --layout $layout -n$devs $dl + check wait + tar cf - /etc > $md0 + ./raid6check $md0 0 0 | grep 'Error detected' && exit 1 + mdadm -S $md0 + done +done + diff --git a/tests/19raid6repair b/tests/19raid6repair index ecff2c3a..26846cc9 100644 --- a/tests/19raid6repair +++ b/tests/19raid6repair @@ -8,40 +8,49 @@ devs="$dev1 $dev2 $dev3 $dev4" # default 2048 sectors data_offset_in_kib=$[2048/2] -for failure in "$dev3 3 3 2" "$dev3 3 2 3" "$dev3 3 2 1" "$dev3 3 2 0" "$dev4 3 3 0" "$dev4 3 3 1" "$dev4 3 3 2" \ - "$dev1 3 0 1" "$dev1 3 0 2" "$dev1 3 0 3" "$dev2 3 1 0" "$dev2 3 1 2" "$dev2 3 1 3" ; do - failure_split=( $failure ) - device_with_error=${failure_split[0]} - stripe_with_error=${failure_split[1]} - repair_params="$stripe_with_error ${failure_split[2]} ${failure_split[3]}" - start_of_errors_in_kib=$[data_offset_in_kib+chunksize_in_kib*stripe_with_error] - - # make a raid5 from a file - dd if=/dev/urandom of=/tmp/RandFile bs=1024 count=$array_data_size_in_kib - mdadm -CR $md0 -l6 -n$number_of_disks -c $chunksize_in_kib $devs - dd if=/tmp/RandFile of=$md0 bs=1024 count=$array_data_size_in_kib - blockdev --flushbufs $md0; sync - - check wait - blockdev --flushbufs $devs; sync - echo 3 > /proc/sys/vm/drop_caches - cmp -s -n $array_data_size_in_b $md0 /tmp/RandFile || { echo sanity cmp failed ; exit 2; } - - dd if=/dev/urandom of=$device_with_error bs=1024 count=$chunksize_in_kib seek=$start_of_errors_in_kib - blockdev --flushbufs $device_with_error; sync - echo 3 > /proc/sys/vm/drop_caches - - $dir/raid6check $md0 0 0 2>&1 | grep -qs "Error" || { echo should detect errors; exit 2; } - - $dir/raid6check $md0 repair $repair_params > /dev/null || { echo repair failed; exit 2; } - blockdev --flushbufs $md0 $devs; sync - echo 3 > /proc/sys/vm/drop_caches - - $dir/raid6check $md0 0 0 2>&1 | grep -qs "Error" && { echo errors detected; exit 2; } - cmp -s -n $array_data_size_in_b $md0 /tmp/RandFile || { echo cmp failed ; exit 2; } - - mdadm -S $md0 - udevadm settle - blockdev --flushbufs $md0 $devs; sync - echo 3 > /proc/sys/vm/drop_caches +layouts="ls rs la ra parity-first ddf-zero-restart ddf-N-restart ddf-N-continue \ + left-asymmetric-6 right-asymmetric-6 left-symmetric-6 \ + right-symmetric-6 parity-first-6" + +for layout in $layouts +do + for failure in "$dev3 3 3 2" "$dev3 3 2 3" "$dev3 3 2 1" "$dev3 3 2 0" \ + "$dev4 3 3 0" "$dev4 3 3 1" "$dev4 3 3 2" \ + "$dev1 3 0 1" "$dev1 3 0 2" "$dev1 3 0 3" \ + "$dev2 3 1 0" "$dev2 3 1 2" "$dev2 3 1 3" ; do + failure_split=( $failure ) + device_with_error=${failure_split[0]} + stripe_with_error=${failure_split[1]} + repair_params="$stripe_with_error ${failure_split[2]} ${failure_split[3]}" + start_of_errors_in_kib=$[data_offset_in_kib+chunksize_in_kib*stripe_with_error] + + # make a raid5 from a file + dd if=/dev/urandom of=/tmp/RandFile bs=1024 count=$array_data_size_in_kib + mdadm -CR $md0 -l6 --layout=$layout -n$number_of_disks -c $chunksize_in_kib $devs + dd if=/tmp/RandFile of=$md0 bs=1024 count=$array_data_size_in_kib + blockdev --flushbufs $md0; sync + + check wait + blockdev --flushbufs $devs; sync + echo 3 > /proc/sys/vm/drop_caches + cmp -s -n $array_data_size_in_b $md0 /tmp/RandFile || { echo sanity cmp failed ; exit 2; } + + dd if=/dev/urandom of=$device_with_error bs=1024 count=$chunksize_in_kib seek=$start_of_errors_in_kib + blockdev --flushbufs $device_with_error; sync + echo 3 > /proc/sys/vm/drop_caches + + $dir/raid6check $md0 0 0 2>&1 | grep -qs "Error" || { echo should detect errors; exit 2; } + + $dir/raid6check $md0 repair $repair_params > /dev/null || { echo repair failed; exit 2; } + blockdev --flushbufs $md0 $devs; sync + echo 3 > /proc/sys/vm/drop_caches + + $dir/raid6check $md0 0 0 2>&1 | grep -qs "Error" && { echo errors detected; exit 2; } + cmp -s -n $array_data_size_in_b $md0 /tmp/RandFile || { echo cmp failed ; exit 2; } + + mdadm -S $md0 + udevadm settle + sync + echo 3 > /proc/sys/vm/drop_caches + done done diff --git a/tests/19repair-does-not-destroy b/tests/19repair-does-not-destroy index 1d3b9b45..a92883fd 100644 --- a/tests/19repair-does-not-destroy +++ b/tests/19repair-does-not-destroy @@ -26,4 +26,3 @@ cmp -s -n $array_data_size_in_b $md0 /tmp/RandFile || { echo should not mess up mdadm -S $md0 udevadm settle -blockdev --flushbufs $md0 $devs; sync diff --git a/tests/20raid5journal b/tests/20raid5journal new file mode 100644 index 00000000..f751aceb --- /dev/null +++ b/tests/20raid5journal @@ -0,0 +1,64 @@ +# check write journal of raid456 + +# test --detail +test_detail_shows_journal() { + mdadm -D $1 | grep journal || { + echo >&2 "ERROR --detail does show journal device!"; mdadm -D $1 ; exit 1; } +} + +# test --examine +test_examine_shows_journal() { + mdadm -E $1 | grep Journal || { + echo >&2 "ERROR --examine does show Journal device!"; mdadm -E $1 ; exit 1; } +} + +# test --create +create_with_journal_and_stop() { + mdadm -CR $md0 -l5 -n4 $dev0 $dev1 $dev2 $dev3 --write-journal $dev4 + check wait + tar cf - /etc > $md0 + ./raid6check $md0 0 0 | grep 'Error detected' && exit 1 + test_detail_shows_journal $md0 + test_examine_shows_journal $dev4 + mdadm -S $md0 +} + +# test --assemble +test_assemble() { + create_with_journal_and_stop + if mdadm -A $md0 $dev0 $dev1 $dev2 $dev3 + then + echo >&2 "ERROR should return 1 when journal is missing!"; cat /proc/mdstat ; exit 1; + fi + mdadm -S $md0 + + mdadm -A $md0 $dev0 $dev1 $dev2 $dev3 --force + check readonly + mdadm -S $md0 +} + +# test --incremental +test_incremental() { + create_with_journal_and_stop + for d in $dev0 $dev1 $dev2 $dev3 + do + mdadm -I $d + done + check inactive + mdadm -I $dev4 + check raid5 + mdadm -S $md0 + + # test --incremental with journal missing + for d in $dev0 $dev1 $dev2 $dev3 + do + mdadm -I $d + done + mdadm -R $md0 + check readonly + mdadm -S $md0 +} + +create_with_journal_and_stop +test_assemble +test_incremental diff --git a/tests/ToTest b/tests/ToTest index 31d70828..b98e266d 100644 --- a/tests/ToTest +++ b/tests/ToTest @@ -6,7 +6,7 @@ add/remove/fail raid5 DONE raid6/10 needed?? -assemble +assemble by devices DONE by uuid DONE by superminor DONE @@ -23,7 +23,7 @@ bitmap separate file internal filename in config file - + examine --scan --brief diff --git a/tests/imsm-grow-template b/tests/imsm-grow-template index 8022e3ad..71a0bbb1 100644 --- a/tests/imsm-grow-template +++ b/tests/imsm-grow-template @@ -33,17 +33,17 @@ function grow_member() { # Create container mdadm --create --run $container --auto=md --metadata=imsm --raid-disks=$num_disks $device_list -wait +check wait imsm_check container $num_disks # Create first volume inside the container mdadm --create --run $member0 --auto=md --level=$vol0_level --size=$vol0_comp_size --chunk=$vol0_chunk --raid-disks=$num_disks $device_list -wait +check wait # Create second volume inside the container (if defined) if [ ! -z $vol1_chunk ]; then mdadm --create --run $member1 --auto=md --level=$vol1_level --size=$vol1_comp_size --chunk=$vol1_chunk --raid-disks=$num_disks $device_list - wait + check wait fi # Wait for any RESYNC to complete @@ -63,7 +63,7 @@ fi for i in $spare_list do mdadm --add $container $i - wait + check wait num_disks=$((num_disks + 1)) done @@ -90,8 +90,10 @@ else exit 1 fi else + sleep 5 check wait sleep 5 + check wait imsm_check member $member0 $num_disks $vol0_level $vol0_comp_size $((vol0_comp_size * vol0_new_num_comps)) $vol0_offset $vol0_chunk testdev $member0 $vol0_new_num_comps $vol0_comp_size $vol0_chunk if [ $vol1_new_num_comps -ne 0 ]; then diff --git a/udev-md-raid-arrays.rules b/udev-md-raid-arrays.rules index c95ec7b1..440febcb 100644 --- a/udev-md-raid-arrays.rules +++ b/udev-md-raid-arrays.rules @@ -35,7 +35,7 @@ ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk ENV{MD_LEVEL}=="raid[1-9]*", ENV{SYSTEMD_WANTS}+="mdmonitor.service" # Tell systemd to run mdmon for our container, if we need it. -ENV{MD_LEVEL}=="raid[1-9]*", ENV{MD_CONTAINER}=="?*", PROGRAM="/usr/bin/readlink $env{MD_CONTAINER}", ENV{MD_MON_THIS}="%c" +ENV{MD_LEVEL}=="raid[1-9]*", ENV{MD_CONTAINER}=="?*", PROGRAM="/bin/readlink $env{MD_CONTAINER}", ENV{MD_MON_THIS}="%c" ENV{MD_MON_THIS}=="?*", PROGRAM="/usr/bin/basename $env{MD_MON_THIS}", ENV{SYSTEMD_WANTS}+="mdmon@%c.service" LABEL="md_end" @@ -24,6 +24,7 @@ #include "mdadm.h" #include "md_p.h" +#include <sys/poll.h> #include <sys/socket.h> #include <sys/utsname.h> #include <sys/wait.h> @@ -34,6 +35,8 @@ #include <ctype.h> #include <dirent.h> #include <signal.h> +#include <dlfcn.h> + /* * following taken from linux/blkpg.h because they aren't @@ -79,6 +82,143 @@ struct blkpg_partition { aren't permitted). */ #define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); })) +static int is_dlm_hooks_ready = 0; + +int dlm_funs_ready(void) +{ + return is_dlm_hooks_ready ? 1 : 0; +} + +#ifndef MDASSEMBLE +static struct dlm_hooks *dlm_hooks = NULL; +struct dlm_lock_resource *dlm_lock_res = NULL; +static int ast_called = 0; + +struct dlm_lock_resource { + dlm_lshandle_t *ls; + struct dlm_lksb lksb; +}; + +/* Using poll(2) to wait for and dispatch ASTs */ +static int poll_for_ast(dlm_lshandle_t ls) +{ + struct pollfd pfd; + + pfd.fd = dlm_hooks->ls_get_fd(ls); + pfd.events = POLLIN; + + while (!ast_called) + { + if (poll(&pfd, 1, 0) < 0) + { + perror("poll"); + return -1; + } + dlm_hooks->dispatch(dlm_hooks->ls_get_fd(ls)); + } + ast_called = 0; + + return 0; +} + +static void dlm_ast(void *arg) +{ + ast_called = 1; +} + +static char *cluster_name = NULL; +/* Create the lockspace, take bitmapXXX locks on all the bitmaps. */ +int cluster_get_dlmlock(int *lockid) +{ + int ret = -1; + char str[64]; + int flags = LKF_NOQUEUE; + + ret = get_cluster_name(&cluster_name); + if (ret) { + pr_err("The md can't get cluster name\n"); + return -1; + } + + dlm_lock_res = xmalloc(sizeof(struct dlm_lock_resource)); + dlm_lock_res->ls = dlm_hooks->create_lockspace(cluster_name, O_RDWR); + if (!dlm_lock_res->ls) { + pr_err("%s failed to create lockspace\n", cluster_name); + return -ENOMEM; + } + + /* Conversions need the lockid in the LKSB */ + if (flags & LKF_CONVERT) + dlm_lock_res->lksb.sb_lkid = *lockid; + + snprintf(str, 64, "bitmap%s", cluster_name); + /* if flags with LKF_CONVERT causes below return ENOENT which means + * "No such file or directory" */ + ret = dlm_hooks->ls_lock(dlm_lock_res->ls, LKM_PWMODE, &dlm_lock_res->lksb, + flags, str, strlen(str), 0, dlm_ast, + dlm_lock_res, NULL, NULL); + if (ret) { + pr_err("error %d when get PW mode on lock %s\n", errno, str); + dlm_hooks->release_lockspace(cluster_name, dlm_lock_res->ls, 1); + return ret; + } + + /* Wait for it to complete */ + poll_for_ast(dlm_lock_res->ls); + *lockid = dlm_lock_res->lksb.sb_lkid; + + return dlm_lock_res->lksb.sb_status; +} + +int cluster_release_dlmlock(int lockid) +{ + int ret = -1; + + if (!cluster_name) + return -1; + + /* if flags with LKF_CONVERT causes below return EINVAL which means + * "Invalid argument" */ + ret = dlm_hooks->ls_unlock(dlm_lock_res->ls, lockid, 0, + &dlm_lock_res->lksb, dlm_lock_res); + if (ret) { + pr_err("error %d happened when unlock\n", errno); + /* XXX make sure the lock is unlocked eventually */ + goto out; + } + + /* Wait for it to complete */ + poll_for_ast(dlm_lock_res->ls); + + errno = dlm_lock_res->lksb.sb_status; + if (errno != EUNLOCK) { + pr_err("error %d happened in ast when unlock lockspace\n", errno); + /* XXX make sure the lockspace is unlocked eventually */ + goto out; + } + + ret = dlm_hooks->release_lockspace(cluster_name, dlm_lock_res->ls, 1); + if (ret) { + pr_err("error %d happened when release lockspace\n", errno); + /* XXX make sure the lockspace is released eventually */ + goto out; + } + free(dlm_lock_res); + +out: + return ret; +} +#else +int cluster_get_dlmlock(int *lockid) +{ + return -1; +} +int cluster_release_dlmlock(int lockid) +{ + return -1; +} +#endif + /* * Parse a 128 bit uuid in 4 integers * format is 32 hexx nibbles with options :.<space> separator @@ -271,6 +411,16 @@ long parse_num(char *num) } #endif +int parse_cluster_confirm_arg(char *input, char **devname, int *slot) +{ + char *dev; + *slot = strtoul(input, &dev, 10); + if (dev == input || dev[0] != ':') + return -1; + *devname = dev+1; + return 0; +} + void remove_partitions(int fd) { /* remove partitions from this block devices. @@ -368,6 +518,13 @@ int enough(int level, int raid_disks, int layout, int clean, char *avail) case 1: return avail_disks >= 1; case 4: + if (avail_disks == raid_disks - 1 && + !avail[raid_disks - 1]) + /* If just the parity device is missing, then we + * have enough, even if not clean + */ + return 1; + /* FALL THROUGH */ case 5: if (clean) return avail_disks >= raid_disks-1; @@ -671,13 +828,13 @@ char *human_size(long long bytes) if (bytes < 5000*1024) buf[0] = 0; else if (bytes < 2*1024LL*1024LL*1024LL) { - long cMiB = (bytes / ( (1LL<<20) / 200LL ) +1) /2; + long cMiB = (bytes * 200LL / (1LL<<20) + 1) / 2; long cMB = (bytes / ( 1000000LL / 200LL ) +1) /2; snprintf(buf, sizeof(buf), " (%ld.%02ld MiB %ld.%02ld MB)", cMiB/100 , cMiB % 100, cMB/100, cMB % 100); } else { - long cGiB = (bytes / ( (1LL<<30) / 200LL ) +1) /2; + long cGiB = (bytes * 200LL / (1LL<<30) +1) / 2; long cGB = (bytes / (1000000000LL/200LL ) +1) /2; snprintf(buf, sizeof(buf), " (%ld.%02ld GiB %ld.%02ld GB)", cGiB/100 , cGiB % 100, @@ -706,11 +863,11 @@ char *human_size_brief(long long bytes, int prefix) buf[0] = 0; else if (prefix == IEC) { if (bytes < 2*1024LL*1024LL*1024LL) { - long cMiB = (bytes / ( (1LL<<20) / 200LL ) +1) /2; + long cMiB = (bytes * 200LL / (1LL<<20) +1) /2; snprintf(buf, sizeof(buf), "%ld.%02ldMiB", cMiB/100 , cMiB % 100); } else { - long cGiB = (bytes / ( (1LL<<30) / 200LL ) +1) /2; + long cGiB = (bytes * 200LL / (1LL<<30) +1) /2; snprintf(buf, sizeof(buf), "%ld.%02ldGiB", cGiB/100 , cGiB % 100); } @@ -990,7 +1147,7 @@ void wait_for(char *dev, int fd) delay *= 2; } if (i == 25) - dprintf("%s: timeout waiting for %s\n", __func__, dev); + dprintf("timeout waiting for %s\n", dev); } struct superswitch *superlist[] = @@ -1740,8 +1897,7 @@ int start_mdmon(char *devnm) status = execl("/bin/systemctl", "systemctl", "start", pathbuf, NULL); exit(1); - case -1: pr_err("cannot run mdmon. " - "Array remains readonly\n"); + case -1: pr_err("cannot run mdmon. Array remains readonly\n"); return -1; default: /* parent - good */ pid = wait(&status); @@ -1766,14 +1922,12 @@ int start_mdmon(char *devnm) devnm, NULL); } exit(1); - case -1: pr_err("cannot run mdmon. " - "Array remains readonly\n"); + case -1: pr_err("cannot run mdmon. Array remains readonly\n"); return -1; default: /* parent - good */ pid = wait(&status); if (pid < 0 || status != 0) { - pr_err("failed to launch mdmon. " - "Array remains readonly\n"); + pr_err("failed to launch mdmon. Array remains readonly\n"); return -1; } } @@ -1845,8 +1999,7 @@ int experimental(void) if (check_env("MDADM_EXPERIMENTAL")) return 1; else { - pr_err("To use this feature MDADM_EXPERIMENTAL" - " environment variable has to be defined.\n"); + pr_err("To use this feature MDADM_EXPERIMENTAL environment variable has to be defined.\n"); return 0; } } @@ -1973,3 +2126,80 @@ void reopen_mddev(int mdfd) if (fd >= 0 && fd != mdfd) dup2(fd, mdfd); } + +#ifndef MDASSEMBLE +static struct cmap_hooks *cmap_hooks = NULL; +static int is_cmap_hooks_ready = 0; + +void set_cmap_hooks(void) +{ + cmap_hooks = xmalloc(sizeof(struct cmap_hooks)); + cmap_hooks->cmap_handle = dlopen("libcmap.so.4", RTLD_NOW | RTLD_LOCAL); + if (!cmap_hooks->cmap_handle) + return; + + cmap_hooks->initialize = dlsym(cmap_hooks->cmap_handle, "cmap_initialize"); + cmap_hooks->get_string = dlsym(cmap_hooks->cmap_handle, "cmap_get_string"); + cmap_hooks->finalize = dlsym(cmap_hooks->cmap_handle, "cmap_finalize"); + + if (!cmap_hooks->initialize || !cmap_hooks->get_string || + !cmap_hooks->finalize) + dlclose(cmap_hooks->cmap_handle); + else + is_cmap_hooks_ready = 1; +} + +int get_cluster_name(char **cluster_name) +{ + int rv = -1; + cmap_handle_t handle; + + if (!is_cmap_hooks_ready) + return rv; + + rv = cmap_hooks->initialize(&handle); + if (rv != CS_OK) + goto out; + + rv = cmap_hooks->get_string(handle, "totem.cluster_name", cluster_name); + if (rv != CS_OK) { + free(*cluster_name); + rv = -1; + goto name_err; + } + + rv = 0; +name_err: + cmap_hooks->finalize(handle); +out: + return rv; +} + +void set_dlm_hooks(void) +{ + dlm_hooks = xmalloc(sizeof(struct dlm_hooks)); + dlm_hooks->dlm_handle = dlopen("libdlm_lt.so.3", RTLD_NOW | RTLD_LOCAL); + if (!dlm_hooks->dlm_handle) + return; + + dlm_hooks->create_lockspace = dlsym(dlm_hooks->dlm_handle, "dlm_create_lockspace"); + dlm_hooks->release_lockspace = dlsym(dlm_hooks->dlm_handle, "dlm_release_lockspace"); + dlm_hooks->ls_lock = dlsym(dlm_hooks->dlm_handle, "dlm_ls_lock"); + dlm_hooks->ls_unlock = dlsym(dlm_hooks->dlm_handle, "dlm_ls_unlock"); + dlm_hooks->ls_get_fd = dlsym(dlm_hooks->dlm_handle, "dlm_ls_get_fd"); + dlm_hooks->dispatch = dlsym(dlm_hooks->dlm_handle, "dlm_dispatch"); + + if (!dlm_hooks->create_lockspace || !dlm_hooks->ls_lock || + !dlm_hooks->ls_unlock || !dlm_hooks->release_lockspace || + !dlm_hooks->ls_get_fd || !dlm_hooks->dispatch) + dlclose(dlm_hooks->dlm_handle); + else + is_dlm_hooks_ready = 1; +} + +void set_hooks(void) +{ + set_dlm_hooks(); + set_cmap_hooks(); +} +#endif @@ -35,38 +35,50 @@ void *xmalloc(size_t len) { void *rv = malloc(len); char *msg; + int n; if (rv) return rv; - msg = Name ": memory allocation failure - aborting\n"; - exit(4+!!write(2, msg, strlen(msg))); + msg = ": memory allocation failure - aborting\n"; + n = write(2, Name, strlen(Name)); + n += write(2, msg, strlen(msg)); + exit(4+!!n); } void *xrealloc(void *ptr, size_t len) { void *rv = realloc(ptr, len); char *msg; + int n; if (rv) return rv; - msg = Name ": memory allocation failure - aborting\n"; - exit(4+!!write(2, msg, strlen(msg))); + msg = ": memory allocation failure - aborting\n"; + n = write(2, Name, strlen(Name)); + n += write(2, msg, strlen(msg)); + exit(4+!!n); } void *xcalloc(size_t num, size_t size) { void *rv = calloc(num, size); char *msg; + int n; if (rv) return rv; - msg = Name ": memory allocation failure - aborting\n"; - exit(4+!!write(2, msg, strlen(msg))); + msg = ": memory allocation failure - aborting\n"; + n = write(2, Name, strlen(Name)); + n += write(2, msg, strlen(msg)); + exit(4+!!n); } char *xstrdup(const char *str) { char *rv = strdup(str); char *msg; + int n; if (rv) return rv; - msg = Name ": memory allocation failure - aborting\n"; - exit(4+!!write(2, msg, strlen(msg))); + msg = ": memory allocation failure - aborting\n"; + n = write(2, Name, strlen(Name)); + n += write(2, msg, strlen(msg)); + exit(4+!!n); } |