From: Falko Zurell <falko.zurell@idmedia.com>
To: linux-lvm@redhat.com
Subject: [linux-lvm] snapshots can't be deactivated
Date: Tue, 17 Jul 2007 16:33:17 +0200 [thread overview]
Message-ID: <469CD32D.6040104@idmedia.com> (raw)
Hello list,
I have a strange behaviour on my snapshots.
I got a Ubuntu Server 7.04 with LVM2 setup:
lvm> version
LVM version: 2.02.06 (2006-05-12)
Library version: 1.02.08 (2006-07-17)
Driver version: 4.11.0
I have two logical volumes I want to make snapshots of every night:
/dev/vg0/home with XFS
/dev/vg0/opt with XFS
These snapshots will be mounted read-only under /backup
So in principle the steps to achieve this should be:
- unmount the snapshot from yesterday (umount /backup/home)
- discard the snapshot from yesterday (lvremove -f
/dev/vg0/daily-snapshot-home)
- freeze the filesystem (xfs_freeze -f /dev/vg0/home)
- create the snapshot (lvcreate --snapshot --size 20G --name
daily-snap-home -v /dev/vg0/home)
- unfreeze the filesystem (xfs_freeze -u /dev/vg0/home)
- mount the new snapshot ro (mount -oro,nouuid
/dev/vg0/daily-snap-home /backup/home)
I wrote a script for that with some error checking too. But sometimes
this doesn't work. The problem seems to be that the snapshot isn't
removed even if "lvremove -f " sais it is removed. I got the following
error message when I then recreate the snapshot:
root@konrad:~# ./create-snapshot-home.sh
+ /sbin/lvs
LV VG Attr LSize Origin Snap% Move Log Copy%
daily-snap-home vg0 swi-ao 20.00G home 0.00
daily-snap-opt vg0 swi-ao 20.00G opt 0.08
home vg0 owi-ao 100.00G
opt vg0 owi-ao 100.00G
root vg0 -wi-ao 10.00G
video vg0 -wi-ao 800.00G
+ /bin/umount -f /backup/home
+ /sbin/lvdisplay
+ grep /dev/vg0/daily-snap-home
/dev/vg0/daily-snap-home [active]
LV Name /dev/vg0/daily-snap-home
+ [ 0 -eq 0 ]
+ [ -b /dev/mapper/vg0-daily--snap--home ]
+ /sbin/lvremove -f /dev/vg0/daily-snap-home
Logical volume "daily-snap-home" successfully removed
+ sleep 5
+ [ -b /dev/mapper/vg0-daily--snap--home ]
+ [ 0 -eq 0 ]
+ /usr/sbin/xfs_freeze -f /home
+ [ 0 -eq 0 ]
+ /sbin/lvcreate --snapshot --size 20G --name daily-snap-home -v
/dev/vg0/home
Setting chunksize to 16 sectors.
Finding volume group "vg0"
Archiving volume group "vg0" metadata (seqno 116).
Creating logical volume daily-snap-home
Creating volume group backup "/etc/lvm/backup/vg0" (seqno 117).
Found volume group "vg0"
Creating vg0-daily--snap--home
Loading vg0-daily--snap--home table
Resuming vg0-daily--snap--home (254:5)
Clearing start of logical volume "daily-snap-home"
Found volume group "vg0"
LV vg0/daily-snap-home in use: not deactivating
Couldn't deactivate new snapshot.
+ /usr/sbin/xfs_freeze -u /home
+ /bin/mount -oro,nouuid /dev/vg0/daily-snap-home /backup/home
mount: you must specify the filesystem type
I don't know why this happens. The script will work perfectly 3 out of 5
times. But sometimes it comes up with the error above.
Are my steps right in principle? Did I forget to do something before or
after removing?
Thanks and kind regards
--
Falko Zurell
Head of Application Management
/i-d media AG
Ohlauer Stra�e 43
D-10999 Berlin
Tel +49 (0)30 - 2 59 47 - 357
Fax +49 (0)30 - 2 59 47 - 471
www.idmedia.com
_______________________________________________
Board: Regine Haschka-Helmer (CEO), Franz Klose (CFO)
Chairman of the Supervisory Board: Christian A. Hufnagl
Headquarters: Berlin, Place of Jurisdiction: Berlin HRB 76342
UST-Id. DE812698340
_______________________________________________
This message may contain confidential information and must not be
copied, disclosed or used by anybody other than the intended recipient.
If you have received this message in error, please notify us immediately
by reply e-mail and delete all records of the message from your
computer. The views represented in this message are solely those of the
author. Neither the author nor I-D Media AG accepts any liability for
the contents of this message.
next reply other threads:[~2007-07-17 14:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-17 14:33 Falko Zurell [this message]
2007-07-18 11:37 ` [linux-lvm] snapshots can't be deactivated Joachim Banzhaf
2007-07-19 7:48 ` Falko Zurell
2007-07-19 14:52 ` Stuart D. Gathman
2007-07-19 21:50 ` David Timms
2007-07-20 6:24 ` Falko Zurell
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=469CD32D.6040104@idmedia.com \
--to=falko.zurell@idmedia.com \
--cc=linux-lvm@redhat.com \
/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;
as well as URLs for NNTP newsgroup(s).