Bug 592957
Summary: | libparted returns wrong path for partition | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Ruben Kerkhof <ruben> |
Component: | parted | Assignee: | Hans de Goede <hdegoede> |
Status: | CLOSED WORKSFORME | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | medium | Docs Contact: | |
Priority: | low | ||
Version: | 13 | CC: | dcantrell, hdegoede |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2010-08-12 19:57:20 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Ruben Kerkhof
2010-05-17 13:27:22 UTC
This is actually in libparted, which pyparted just calls: libparted/arch/linux.c: /* Check for devfs-style /disc => /partN transformation unconditionally; the system might be using udev with devfs rules, and if not the test is harmless. */ if (!strcmp (dev->path + path_len - 5, "/disc")) { /* replace /disc with /path%d */ strcpy (result, dev->path); snprintf (result + path_len - 5, 16, "/part%d", num); } else if (dev->type == PED_DEVICE_DAC960 || dev->type == PED_DEVICE_CPQARRAY || dev->type == PED_DEVICE_ATARAID || dev->type == PED_DEVICE_DM || isdigit (dev->path[path_len - 1])) snprintf (result, result_len, "%sp%d", dev->path, num); else snprintf (result, result_len, "%s%d", dev->path, num); The "%sp%d" format string is used, but probably should not be used for PED_DEVICE_DM. Reassigning to parted. Hi Ruben, Normally parted resolves symlinks which causes the behaviour you are seeing. There is a patch in parted to not do this for device mapper devices because of the lvm changes you refer to. But this patch keys of the device path starting with /dev/mapper, from the parted ChangeLog: * Tue Apr 6 2010 Hans de Goede <hdegoede> 2.1-6 - Parted should not canonicalize symlinks under /dev/mapper (#577824) So if you use the symlink under /dev/mapper rather then using the /dev/VgName/LvName one things should work. Please let us know if this resolves your issue. Regards, Hans Hi Hans, I've changed my scripts now to use the /dev/mapper entries, and this works ok. Closing per comment #3. |