I'm not sure if this patch would be useful (or desirable) to anyone else, but I thought I'd share it just in case. Using udev to assign 3 character sd names (sdaaa, for example), generated based on where a disk is physically located. There are problems using sg_map in this situation for two reasons: 1) the names are too long, and 2) the names are sparsely allocated and sg_map doesn't like this. This patch (sg_map.c.1.14.patch, against version 1.14 of sg3_utils) modifies sg_map to allow 3 character sparse names. Here's what I changed: - increase MAX_SD_DEVS to the maximum # for up to 3 character names - modified make_dev_name to handle 3 character names - ignore ENOENT in scan_dev_type to allow for names to be sparsely allocated This was the quickest, easiest way to make sg_map work in this situation... I realize it's not a nice general solution to the problem. Nate Dailey Stratus Technologies Signed-off-by: Nate Dailey <nate.dailey@xxxxxxxxxxx>
Attachment:
sg_map.c-1.14.patch
Description: Binary data