[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-users] Where does xen chache domUs grub.conf ?


  • To: xen-users@xxxxxxxxxxxxxxxxxxx
  • From: "Al Tobey" <tobert@xxxxxxxxx>
  • Date: Mon, 28 Jan 2008 18:29:10 -0800
  • Cc: Alain BARTHE <Alain_BARTHE@xxxxxxxxxxxxxxxxx>, John Madden <jmadden@xxxxxxxxxxx>
  • Delivery-date: Mon, 28 Jan 2008 18:30:27 -0800
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=ia1u4z5eWnDeSidPkkPhC6waOnIiwFi/aRlGOf3QrqWdXXGKNh2bMLKGczNte6Ib8zec8UkfZyla0VGtAv/35FyeIl6GX+1Reb2QXflUF6yy6Tkb5inBIvUUWfbGIdQRM4k+6zcqquNwmamRv7lj/fpv495933OkbSnHtE2SOIw=
  • List-id: Xen user discussion <xen-users.lists.xensource.com>

On Dec 11, 2007 8:08 AM, John Madden <jmadden@xxxxxxxxxxx> wrote:
> > By "reboot", I meant "shutdown/restart". Among others things, I tried
> > to run pygrub on the dom0 on the LV that support the domU's virtual
> > disk, while the domU is off. Without seeing any change.
> > I also verified the grub.conf to be effectively updated by mounting
> > the domU boot partition on the dom0, while the domU is off. The
> > grub.conf was actually changed. That's why I suppose something to be
> > cached somewhere on the dom0.
>
> dom0 can/will certainly cache the contents of the disk you're sharing to
> the domU: I had another case where "grub wasn't getting installed inside
> domU" when it certainly was; less -f /dev/disk from dom0 didn't show the
> grub sectors on the disk when they were definitely there, a domU
> shutdown "cleared the cache."  So again, my experience has been that
> shutting it down completely fixed the problem, but perhaps it doesn't
> for you.

A domU shutdown will not necessarily clear the cache that is causing
the pygrub problem.   In fact, the problem has nothing to do with Xen
or pygrub at all.   It's the linux kernel that's caching the blocks in
RAM and not noticing that they've changed on the disk.     I ran into
this when editing the grub configuration by mounting a kpartx device
then trying to boot the VM off the normal LVM device.    The kernel
had no way of knowing that the pages containing grub.conf were dirty,
so it just returned what it had cached in RAM.    I'll let a kernel
hacker can explain this more thoroughly.

Either of the following commands should clear the cache and let pygrub
get the right information:

echo 1 > /proc/sys/vm/drop_caches
blockdev --flushbufs <device>

See also:
http://linux-mm.org/Drop_Caches
blockdev(8)
linux-2.6.xx/Documentation/filesystems/proc.txt (from the linux kernel source)

-Al Tobey

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.