+Changes Priot to this release
+ - When creating devices in /dev/md/ create matching symlinks
+ from /dev. e.g. /dev/md0 -> /dev/md/0.
+ Allow this to be disabled in mdadm.conf or on command line.
+
Changes Prior to 2.5.3 release
- Document v0.91 superblocks in md.4
- Make GPL explicit in man pages.
{"re-add", 0, 0, ReAdd},
{"homehost", 1, 0, HomeHost},
{"auto-update-homehost", 0, 0, AutoHomeHost},
+ {"symlinks", 1, 0, Symlinks},
/* For assemble */
{"uuid", 1, 0, 'u'},
}
struct createinfo createinfo = {
+ .symlinks = 1,
#ifdef DEBIAN
.gid = 6, /* disk */
.mode = 0660,
if (!createinfo.supertype)
fprintf(stderr, Name ": metadata format %s unknown, ignoring\n",
w+9);
-
- } else {
+ } else if (strncasecmp(w, "symlinks=yes", 12) == 0)
+ createinfo.symlinks = 1;
+ else if (strncasecmp(w, "symlinks=no", 11) == 0)
+ createinfo.symlinks = 0;
+ else {
fprintf(stderr, Name ": unrecognised word on CREATE line: %s\n",
w);
}
number, and there is no entry in /dev for that number and with a
non-standard name.
+.TP
+.BR --symlink = no
+Normally when
+.B --auto
+causes
+.I mdadm
+to create devices in
+.B /dev/md/
+it will also create symlinks from
+.B /dev/
+with names starting with
+.B md
+or
+.BR md_ .
+Use
+.B --symlink=no
+to suppress this, or
+.B --symlink=yes
+to enforce this even if it is suppressing
+.IR mdadm.conf .
+
+
.SH For assemble:
.TP
int force = 0;
int test = 0;
int assume_clean = 0;
+ char *symlinks = NULL;
/* autof indicates whether and how to create device node.
* bottom 3 bits are style. Rest (when shifted) are number of parts
* 0 - unset
autof = parse_auto(optarg, "--auto flag", 0);
continue;
+ case O(CREATE,Symlinks):
+ case O(BUILD,Symlinks):
+ case O(ASSEMBLE,Symlinks): /* auto creation of symlinks in /dev to /dev/md */
+ symlinks = optarg;
+ continue;
+
case O(BUILD,'f'): /* force honouring '-n 1' */
case O(GROW,'f'): /* ditto */
case O(CREATE,'f'): /* force honouring of device list */
fputs(Usage, stderr);
exit(2);
}
+
+ if (symlinks) {
+ struct createinfo *ci = conf_get_create_info();
+
+ if (strcasecmp(symlinks, "yes") == 0)
+ ci->symlinks = 1;
+ else if (strcasecmp(symlinks, "no") == 0)
+ ci->symlinks = 0;
+ else {
+ fprintf(stderr, Name ": option --symlinks must be 'no' or 'yes'\n");
+ exit(2);
+ }
+ }
/* Ok, got the option parsing out of the way
* hopefully it's mostly right but there might be some stuff
* missing
The name of the metadata format to use if none is explicitly given.
This can be useful to impose a system-wide default of version-1 superblocks.
+.TP
+.B symlinks=no
+Normally when creating devices in
+.B /dev/md/
+.I mdadm
+will create a matching symlink from
+.B /dev/
+with a name starting
+.B md
+or
+.BR md_ .
+Give
+.B symlinked=no
+to suppress this symlink creation.
.RE
int gid;
int autof;
int mode;
+ int symlinks;
struct supertype *supertype;
};
BackupFile,
HomeHost,
AutoHomeHost,
+ Symlinks,
};
/* structures read from config file */
}
-void make_parts(char *dev, int cnt)
+void make_parts(char *dev, int cnt, int symlinks)
{
/* make 'cnt' partition devices for 'dev'
* We use the major/minor from dev and add 1..cnt
perror("chown");
if (chmod(name, stb2.st_mode & 07777))
perror("chmod");
- if (strncmp(name, "/dev/md/", 8) == 0)
+ if (symlinks && strncmp(name, "/dev/md/", 8) == 0)
make_dev_symlink(name);
stat(name, &stb2);
add_dev(name, &stb2, 0, NULL);
return -1;
} else {
if (major != MD_MAJOR && parts > 0)
- make_parts(dev, parts);
+ make_parts(dev, parts, ci->symlinks);
return mdfd;
}
}
}
stat(dev, &stb);
add_dev(dev, &stb, 0, NULL);
- if (strncmp(dev, "/dev/md/", 8) == 0)
+ if (ci->symlinks && strncmp(dev, "/dev/md/", 8) == 0)
make_dev_symlink(dev);
if (major != MD_MAJOR)
- make_parts(dev,parts);
+ make_parts(dev,parts, ci->symlinks);
}
}
mdfd = open(dev, O_RDWR, 0);