Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#623 closed defect (fixed)

SLES11 SP2 : incorrect mountlist during mondoarchive

Reported by: rue Owned by: Bruno Cornec
Priority: high Milestone: 3.0.3
Component: mondo Version: 3.0.1
Severity: major Keywords:

Description (last modified by Bruno Cornec)

Versions are : mindi-2.1.1-1.sles11 afio-2.5-64 mindi-busybox-1.18.5-1.sles11 mondo-3.0.1-1.sles11

With SLES 11 SP2 the mountlist is created incorrectly during backup, which is causing troubles during restore. The mountlist has to be edited manually during restore.

$ df result:
/dev/mapper/vg00-lv_tmp       ext3       2064208    620164   1339188  32% /tmp
/dev/mapper/vg00-lv_usr       ext3       5160576   3917264    981168  80% /usr

From mondoarchive.log, mountlist.txt file content is:

/dev/dm-5 /tmp ext3 2097152
/dev/dm-7 /usr ext3 5242880

SLES 11 SP2 has links in /dev/vg00 pointing to dm-X devices - that's the difference from SLES 11 SP1. This problem doesn't exist with SLES 11 SP1.

Change History (6)

comment:1 by Bruno Cornec, 12 years ago

Description: modified (diff)
Status: newassigned

comment:2 by rue, 12 years ago

function ListAllLogicalVolumesSortedBydm() in analyze-my-lvm will sort dm-0, dm-1, dm-10, dm-11, dm-2, dm-3, dm-4, dm-5, dm-6, dm-7, dm-8, dm-9 instead of dm-0, dm-1, dm-2, dm-3, dm-4, dm-5, dm-6, dm-7, dm-8, dm-9, dm-10, dm-11.

Replace in ListAllLogicalVolumesSortedBydm() function :

sort -t'|' $MINDI_TMP/sorteddm | cut -d'|' -f2 


cut -d'-' -f2- $MINDI_TMP/sorteddm | sort -t'|' -n | cut -d'|' -f2
Last edited 12 years ago by Bruno Cornec (previous) (diff)

comment:3 by Matthew Ross, 12 years ago

This is true for RHEL 6.* (CentOS). Udev rules 10-dm.rules and 11-dm-lvm.rules create symbolic links for the /dev/mapper/<vg>-<lv> and /dev/<vg>/<lv> devices to the dm-X nodes. These links are resolved by readlink in Mindi's MakeMountlist.

I would think that the /dev/mapper/ devices would be preferred here since they should remain consistent.

comment:4 by Bruno Cornec, 12 years ago

Resolution: fixed
Status: assignedclosed

Should be fixed in rev [3037].

in reply to:  4 comment:5 by Matthew Ross, 12 years ago

Replying to bruno:

Should be fixed in rev [3037].

I may be confused on the original post but the sort fix does not resolve the mountlist issue described; the mountlist will still use the dynamically created /dev/dm-N nodes versus the /dev/mapper/<vg>-<lv> nodes.

Under RHEL and Cent (version 6+ at the least) there is no guarantee the logical volumes will link to the same dm-N nodes across boots and it is recommended that the /dev/mapper/<vg>-<lv> nodes be used to reference the logical volume devices.

The issue presented itself to me when restoring from a library disk of backups. The library disk has a logical volume (for easy identification) to store multiple mondo backups. During restore there were conflicts partitioning the LVM partitions due to the dm-N nodes not being allocated the same as when the backup was created; one of the restore dm-N nodes being used allocated to the library disk in the restore environment.

In MakeMountlist (~1078) the readlink sets the current partition to the dm-N node. Additionally there is an check on the next line to ensure that the readlink did not resolve to a /dev/mapper node which leads me to wonder if there is a case I am missing where the mapper node is undesired? In any case I changed the block as follows.


current_partition=`readlink -f $c_p`
[ "`echo "$current_partition" | grep -F "/dev/mapper"`" != "" ] && current_partition="$c_p"
[ "`echo "$useless_dev" | grep -F "$current_partition"`" ] && continue


current_partition=`readlink -f $c_p`
if [ "`echo "$current_partition" | grep -F "/dev/mapper"`" != "" ]; then
elif [ "`echo $current_partition | grep -E '^/dev/dm-'`" ]; then
    current_partition=$(MINDI_LIB/analyze-my-lvm --givemapperofdm $current_parition)
[ "`echo "$useless_dev" | grep -F "$current_partition"`" ] && continue

comment:6 by Bruno Cornec, 12 years ago

Patch adopted in rev [3046]

Note: See TracTickets for help on using tickets.