From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Murray Subject: Possible bug with fsimage/pygrub Date: Wed, 31 May 2017 18:41:12 +0000 (UTC) Message-ID: <1288784150.7402967.1496256072038@mail.yahoo.com> References: <1288784150.7402967.1496256072038.ref@mail.yahoo.com> Reply-To: Ian Murray Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8507132063288000023==" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org --===============8507132063288000023== Content-Type: multipart/alternative; boundary="----=_Part_7402966_1936777648.1496256072035" Content-Length: 9208 ------=_Part_7402966_1936777648.1496256072035 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable All, Having a very strange problem. I created a CentOS 7 PV vm but could not get= pygrub to pick-up the grub entries. I did some fault finding and concluded= that `fsimage` was unable to find the grub.cfg. I could start the vm as an HVM guest with no problem. I renamed the `grub2`= folder to be `grub2.x` and `cp -a` that back to `grub2`. pygrub/fsimage we= re able to find the file after that. fsimage couldn't see grub2.x/grub.cfg. =C2=A0I wrote small test case in python to illustrate the issue: I can only think it is a bug in fsimage, or there is something very hidden = about that directory that is causing this. Any suggestions would be most welcome, Thanks, Ian import fsimagefs =3D fsimage.open('/dev/xen2/email', 1048576, "seclabel")if= fs.file_exists('/grub2.x/grub.cfg'):=C2=A0 print "found"else:=C2=A0 print = "not found"if fs.file_exists('/grub2/grub.cfg'):=C2=A0 print "found"else:= =C2=A0 print "not found" The results are:-=C2=A0=C2=A0# python ~/test.py=C2=A0not foundfound (mounted locally, after an update, but same behaviour as previously. The pa= rtition is on LVM and is formatted ext4)# ls -al grub2*grub2:total 52drwxr-= xr-x. 6 root root =C2=A04096 May 31 02:39 .dr-xr-xr-x. 7 root root =C2=A040= 96 May 31 02:41 ..-rw-r--r--. 1 root root =C2=A0 =C2=A086 Jan 10 23:32 devi= ce.mapdrwxr-xr-x. 2 root root =C2=A04096 Jan 10 23:32 fonts-rw-r--r--. 1 ro= ot root =C2=A04806 May 31 02:39 grub.cfg-rw-r--r--. 1 root root =C2=A04045 = Jan 10 23:33 grub.cfg.1496194637.rpmsave-rw-r--r--. 1 root root =C2=A01024 = May 31 02:39 grubenvdrwxr-xr-x. 2 root root 12288 Jan 10 23:32 i386-pcdrwxr= -xr-x. 2 root root =C2=A04096 Jan 10 23:32 localedrwxr-xr-x. 3 root root = =C2=A04096 Jan 10 23:28 themes-rw-r--r--. 1 root root =C2=A0 =C2=A0 0 May 3= 1 02:13 xxxx grub2.x:total 44drwxr-xr-x. 6 root root =C2=A04096 May 31 02:13 .dr-xr-xr-x= . 7 root root =C2=A04096 May 31 02:41 ..-rw-r--r--. 1 root root =C2=A0 =C2= =A086 Jan 10 23:32 device.mapdrwxr-xr-x. 2 root root =C2=A04096 Jan 10 23:3= 2 fonts-rw-r--r--. 1 root root =C2=A04045 Jan 10 23:33 grub.cfg-rw-r--r--. = 1 root root =C2=A01024 Jan 10 23:33 grubenvdrwxr-xr-x. 2 root root 12288 Ja= n 10 23:32 i386-pcdrwxr-xr-x. 2 root root =C2=A04096 Jan 10 23:32 localedrw= xr-xr-x. 3 root root =C2=A04096 Jan 10 23:28 themes-rw-r--r--. 1 root root = =C2=A0 =C2=A0 0 May 31 02:13 xxxx ------=_Part_7402966_1936777648.1496256072035 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
All,

Ha= ving a very strange problem. I created a CentOS 7 PV vm but could not get p= ygrub to pick-up the grub entries. I did some fault finding and concluded t= hat `fsimage` was unable to find the grub.cfg.

I could start the vm as an HVM guest with no problem. I renamed t= he `grub2` folder to be `grub2.x` and `cp -a` that back to `grub2`. pygrub/= fsimage were able to find the file after that. fsimage couldn't see grub2.x= /grub.cfg.

 I wrote small test case in python to illustrate the= issue:

I can only think it is a bug in fsimage, or there is somethi= ng very hidden about that directory that is causing this.

Any sugges= tions would be most welcome,

Thanks,

Ian

import fsimag= e
fs =3D fsimage.open= ('/dev/xen2/email', 1048576, "seclabel")
if fs.file_exists('/grub2.x/grub.cfg'):
  print "found"
else:
  print "not found"
if fs.file_exists('/grub2/grub.cfg'):
  print "found"
else:
  print "not found"

The results a= re:-
  
# python ~/test.py =
not found
found

(mounted locally, = after an update, but same behaviour as previously. The partition is on LVM = and is formatted ext4)
# ls -al grub2*
gru= b2:
total 52
drwxr-xr-x. 6 root root  = ;4096 May 31 02:39 .
= dr-xr-xr-x. 7 root root  4096 May 31 02:41 ..
-rw-r--r--. 1 root root    86 Jan 1= 0 23:32 device.map
dr= wxr-xr-x. 2 root root  4096 Jan 10 23:32 fonts
-rw-r--r--. 1 root root  4806 May 31 02= :39 grub.cfg
-rw-r--r= --. 1 root root  4045 Jan 10 23:33 grub.cfg.1496194637.rpmsave
-rw-r--r--. 1 root root &nbs= p;1024 May 31 02:39 grubenv
drwxr-xr-x. 2 root root 12288 Jan 10 23:32 i386-pc
drwxr-xr-x. 2 root root  4096 Jan= 10 23:32 locale
drwx= r-xr-x. 3 root root  4096 Jan 10 23:28 themes
-rw-r--r--. 1 root root     0 May 3= 1 02:13 xxxx

grub2.x:
total 44
dr= wxr-xr-x. 6 root root  4096 May 31 02:13 .
dr-xr-xr-x. 7 root root  4096 May 31 02:41 = ..
-rw-r--r--. 1 root= root    86 Jan 10 23:32 device.map
drwxr-xr-x. 2 root root  4096 Jan 10 23:32 fo= nts
-rw-r--r--. 1 roo= t root  4045 Jan 10 23:33 grub.cfg
-rw-r--r--. 1 root root  1024 Jan 10 23:33 grubenv<= /div>
drwxr-xr-x. 2 root ro= ot 12288 Jan 10 23:32 i386-pc
drwxr-xr-x. 2 root root  4096 Jan 10 23:32 locale
drwxr-xr-x. 3 root root  40= 96 Jan 10 23:28 themes
-rw-r--r--. 1 root root     0 May 31 02:13 xxxx


------=_Part_7402966_1936777648.1496256072035-- --===============8507132063288000023== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwczovL2xpc3RzLnhlbi5v cmcveGVuLWRldmVsCg== --===============8507132063288000023==--