Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem in lib/compatibility-functions.sh because blkid shows no output when there are no partitions #73

Closed
kpieth opened this issue Apr 24, 2012 · 1 comment
Assignees
Labels
Milestone

Comments

@kpieth
Copy link

kpieth commented Apr 24, 2012

Theres a problem in lib/compatibility-functions.sh. blkid shows no output when there are no partitions. Therefore on Proliant servers with newly created RAID arrays i get this message when starting "rear -Dv recover":

Required udev program 'vol_id' or a suitable 'blkid' could not be found !
Activating a very primitive builtin replacement that supports
Ext2/3: LABEL and UUID
Reiserfs, xfs, swap...

WARNING ! This replacement has been tested on i386/x86_64 ONLY !!

looking at lib/compatibility-functions.sh line 47 this function expects that blkid has output:
elif has_binary blkid && blkid -o udev >&8 2>&1; then
Debug "Using 'blkid' for rear_vol_id"

System is SLES11SP2. When i create a disk label and partition then there is no error.

@dagwieers
Copy link
Contributor

Looking at the man-page of blkid, it seems as if return code 2 (which you get in this case) is not in fact an error in our case.

Can you check if on SLES11SP2 return code 2 is in fact what we'd expect if no disks have partitions ?

However, while fixing this case, I noticed that now that we have removed the old dr code, this function is no longer used. So you should not have had this problem in the first place on any recent Rear release, unless you disabled USE_LAYOUT (which we no longer recommend).

In case you want to backport my fix, you need to use the following patch:

--- a/usr/share/rear/lib/compatibility-functions.sh
+++ b/usr/share/rear/lib/compatibility-functions.sh
@@ -44,7 +44,8 @@ elif has_binary udev_volume_id; then
             -e "s/^U:\(.*\)/ID_FS_UUID='\1'/" | grep =
     }
 # NOTE: We use blkid ONLY if it is a newer one and reports information back in udev-style
-elif has_binary blkid && blkid -o udev >&8 2>&1; then
+#       But we need to accept both return code 0, and return code 2 (no partition)
+elif has_binary blkid && blkid -o udev >&8 2>&1 || (( $? == 2 )); then
     Debug "Using 'blkid' for rear_vol_id"
     # since udev 142 vol_id was removed and udev depends on blkid
     # blkid -o udev returns the same output as vol_id used to

In any case, I am going to close this issue, but feel free to reopen it if you have more feedback or anything else to report (the good, the bad or the ugly ;-)). Thanks for the report !

@ghost ghost assigned dagwieers Jun 8, 2012
dagwieers added a commit to dagwieers/rear that referenced this issue Jun 8, 2012
This fixes rear#73 when backported to older releases ;-)
dagwieers added a commit to dagwieers/rear that referenced this issue Jun 10, 2012
…d or blkid anymore.

We may want to resurrect this in the future if we need it again.

This fixes rear#107.
Although we might want to revive it for rear#73.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants