Opened 11 years ago
Closed 11 years ago
#696 closed defect (fixed)
LVM check
Reported by: | victor gattegno | Owned by: | Bruno Cornec |
---|---|---|---|
Priority: | normal | Milestone: | 3.0.4 |
Component: | mondo | Version: | 3.0.3 |
Severity: | normal | Keywords: | LVM |
Cc: | victor gattegno, rue |
Description
About mondo 3.0.3, in libmondo-devices.c, line 1909 :
mr_asprintf(&command, "mount 2>/dev/null|grep -E \"/dev/mapper/%s-|/dev/%s/\"|awk '{printf(\"%%s \",$3)}END{print \"\"}'", VG, VG);
I think that it should be :
mr_asprintf(&command, "mount 2>/dev/null|grep -E \"/dev/mapper/%s|/dev/%s\"|awk '{printf(\"%%s \",$3)}END{print \"\"}'", VG, VG);
Change History (4)
comment:2 by , 11 years ago
Also I don't see why %%s in the awk, should it be simply %s ?
As this :
mr_asprintf(&command, "mount 2>/dev/null|grep -E \"/dev/mapper/%s-|/dev/%s/\"|awk '{print(\"%s \",$3)}END{print \"\"}'", VG, VG, VG);
Example :
# mount 2>/dev/null|grep -E "/dev/mapper/VGDD0-|/dev/VGDD0/" |awk '{print("VGDD0 ",$3)}END{print ""}' VGDD0 /mnt/data0
Version 0, edited 11 years ago by (next)
comment:4 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
I agree with the first one, not the second. For the second in C, you need to prepend a % by another % sign to be correct, thus the double %%
Wrt the first part, it is now in rev [3152], thanks for tracking it down !
Note:
See TracTickets
for help on using tickets.
About: grep -E \"/dev/mapper/%s-
If we have for example /dev/mapper/XXXXX-YYYYY then %s=XXXXX and "grep /dev/mapper/%s-" will work.
But it should be replaced by %s because %s- will not work if the name is a wwid (or an user alias) in /dev/mapper (with multipath it can be defined in "multipaths" section of /etc/multipath.conf) ; because there could be no '-' in the alias, for example:
/dev/mapper/36050468008b0423a0000400003ab0000
or : /dev/mapper/vgdbdisk01
if we have in /etc/multipath.conf :