public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andreas Sundstrom <sunkan@zappa.cx>
To: linux-kernel@vger.kernel.org
Subject: 2.6.28 ext4, xen and lvm volume becomes ro after snapshot
Date: Fri, 26 Dec 2008 12:06:19 +0100	[thread overview]
Message-ID: <4954BAAB.9090108@zappa.cx> (raw)

Decided to try out 2.6.28 on a xen VM yesterday.
Used my old 2.6.27 .config as a base and did an "make oldconfig" and
answered any questions that came up.

Everything went fine and the new kernel booted and worked nicely.

Now I wanted to try the new ext4 fs (for no particular reason other than
it being new)
So to start with I tried it without updating the actual fs layout to
ext4, I left it at ext3 and only mounted it as ext4.

That meant adding this to the xen VM config file:
extra = "console=hvc0 rootfstype=ext4"

And also changing to ext4 in /etc/fstab

That also worked fine and I saw that some stuff was being enabled (like
barriers)
But today I noticed that something was wrong with the VM and I noticed
after a while that the root volume was read-only (this VM only has a
root partition).

I noticed the time that the logs were written to last and that was
around the time my backups are being run.

I use a little script that backup this xen VM from xen dom0.

Here is the interesting part of my script:
/usr/sbin/xm sysrq xenfw1 s
/usr/sbin/xm pause xenfw1
sync
/sbin/lvm lvcreate --snapshot --permission rw --size 1G --name xenfw1_s
/dev/3w250g/xenfw1 > /dev/null
/usr/sbin/xm unpause xenfw1
/bin/mount -o ro,noatime /dev/3w250g/xenfw1_s /mnt/snapshots/xenfw1 ||
/bin/rmdir /mnt/snapshots/xenfw1
# Here's where the actual backups take place
/bin/umount /mnt/snapshots/xenfw1 2> /dev/null
/sbin/lvm lvremove --force /dev/3w250g/xenfw1_s > /dev/null

After the "lvcreate --snapshot" if I check within the xen VM (with cat
/proc/mounts) I can see that / changed from rw to ro:
Before snapshot:
/dev/root / ext4 rw,noatime,barrier=1,noextents,data=ordered 0 0
After snapshot:
/dev/root / ext4 ro,noatime,barrier=1,noextents,data=ordered 0 0

It was not possible to do "mount -o remount,rw /":
mount -o remount,rw
/                                                                                      

mount: block device /dev/xvda1 is write-protected, mounting read-only  

I don't see how this could be an expected behaviour so I thought it
might be good to report it here.
I hope I explained the scenario good enough, I can reproduce this if you
want more details (now I'm back on ext3 on this xen VM)

P.S. I'm currently not subscribed so please CC me on any posts regarding
this.

/Andreas Sundstrom

             reply	other threads:[~2008-12-26 11:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-26 11:06 Andreas Sundstrom [this message]
2008-12-26 14:07 ` 2.6.28 ext4, xen and lvm volume becomes ro after snapshot Theodore Tso
2008-12-26 15:42   ` Andreas Sundstrom
2008-12-26 18:21     ` Theodore Tso
2008-12-26 18:48       ` Andreas Sundstrom
2008-12-26 19:33         ` Theodore Tso
2008-12-26 22:00           ` Andreas Sundstrom
2008-12-27  3:06             ` Theodore Tso
2008-12-27  9:19               ` Andreas Sundstrom
2009-01-02  3:11                 ` Theodore Tso
2009-01-02  8:29                   ` Andreas Sundstrom
2009-01-02 14:10                     ` Theodore Tso
2009-01-03 10:25                       ` Andreas Sundstrom

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4954BAAB.9090108@zappa.cx \
    --to=sunkan@zappa.cx \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox