Public bug reported:
Binary package hint: mdadm
When running /sbin/mdrun i get the following error (mdrun is
automatically called on startup in /etc/init.d/mdadm-raid):
# /sbin/mdrun
/sbin/mdrun: eval: line 104: syntax error near unexpected token `then'
/sbin/mdrun: eval: line 104: `8 0 1171832832 sda 8 1 1171829263 sda1 if [ ! -b
hda ]; then mknod hda b 3 0; fi ; if [ ! -b hda1 ]; then mknod hda1 b 3 1; fi ;
if [ ! -b hda5 ]; then mknod hda5 b 3 5; fi ; if [ ! -b hda6 ]; then mknod hda6
b 3 6; fi ; if [ ! -b dm ]; then mknod dm b 254 0; fi ; if [ ! -b dm ]; then
mknod dm b 254 1; fi ; 254 2 1090519040 dm-2 if [ ! -b dm ]; then mknod dm b
254 3; fi ; if [ ! -b dm ]; then mknod dm b 254 4; fi ; if [ ! -b dm ]; then
mknod dm b 254 5; fi ; if [ ! -b dm ]; then mknod dm b 254 6; fi ; 254 7
1171829263 dm-7 254 8 1090519040 dm-8'
line 104 of /sbin/mdrun:
eval $CREATECMD ;
$CREATECMD is populated in line 98:
CREATECMD=$(sed -e "s/.*major.*//; s/.*\ \([:0-9:]\+\)\ \+\
\([:0-9:]\+\)\ \+\ [:0-9:]\+\ \+\([:a-z0-9\/:]\+\).*/if [ ! -b \3 ];
then mknod \3 b \1 \2; fi ; / ; s/\//_/g" < /proc/partitions)
# cat /proc/partitions
major minor #blocks name
8 0 1171832832 sda
8 1 1171829263 sda1
3 0 39082680 hda
3 1 1 hda1
3 5 248944 hda5
3 6 38829073 hda6
254 0 37302272 dm-0
254 1 1523712 dm-1
254 2 1090519040 dm-2
254 3 248944 dm-3
254 4 38829073 dm-4
254 5 37302272 dm-5
254 6 1523712 dm-6
254 7 1171829263 dm-7
254 8 1090519040 dm-8
The problem is the device size. Between the minor number and the size of
the device are for devices < 1TB at least 2 spaces. The sed regular
expression expects these 2 spaces. When changing the regexp to:
CREATECMD=$(sed -e "s/.*major.*//; s/.*\ \([:0-9:]\+\)\ \+\
\([:0-9:]\+\)\ \+[:0-9:]\+\ \+\([:a-z0-9\/:]\+\).*/if [ ! -b \3 ]; then
mknod \3 b \1 \2; fi ; / ; s/\//_/g" < /proc/partitions)
the script works as expected.
DISCLAIMER: I am not a sed/regexp expert. Please double check!
** Affects: mdadm (Ubuntu)
Importance: Untriaged
Status: Unconfirmed
--
Does not create device nodes ("eval: line 104: syntax error near unexpected
token `then'")
https://launchpad.net/bugs/53510
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs