cd "${snap_mount}"
zcat "${snapback}/${snapfile}" | /bin/cpio --extract --preserve-modification-time --no-absolute-filenames --sparse --unconditional --make-directories > /dev/null 2>&1
RES=$?
+ if [ "${RES}" != "0" ]
+ then
+ log_warning_msg "failure to \"zcat ${snapback}/${snapfile} | /bin/cpio --extract --preserve-modification-time --no-absolute-filenames --sparse --unconditional --make-directories\""
+ fi
cd "${OLDPWD}"
fi
- umount "${snapback}"
+ umount "${snapback}" || log_warning_msg "failure to \"umount ${snapback}\""
if [ "${RES}" != "0" ]
then
fi
else
+ # Try to find if it could be a snapshot partition
dev=$(find_cow_device "${snap_label}")
if [ -b "${dev}" ]
then
+ log_success_msg "found snapshot device on ${dev}"
if echo "${dev}" | grep -qs loop
then
# strange things happens, user confused?
mountp="/mnt/tmp_fs_size"
mkdir -p "${mountp}"
- mount -t $(get_fstype "${dev}") -o ro "${dev}" "${mountp}"
+ mount -t $(get_fstype "${dev}") -o ro "${dev}" "${mountp}" || log_warning_msg "cannot mount -t $(get_fstype ${dev}) -o ro ${dev} ${mountp}"
doumount=1
fi
if [ -n "${doumount}" ]
then
- umount "${mountp}"
+ umount "${mountp}" || log_warning_msg "cannot umount ${mountp}"
rmdir "${mountp}"
fi
if [ -f "${snap_backing}/${filename}" ]
then
echo "${devname} ${snap_backing} ${filename}"
+ # return without mounting, it will be umounted later
return 0
fi
done