All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-lvm] Problem to remove LVM snaphots
@ 2010-04-18  8:54 François Valenduc
  2010-04-18 23:04 ` Phillip Susi
  0 siblings, 1 reply; 5+ messages in thread
From: François Valenduc @ 2010-04-18  8:54 UTC (permalink / raw)
  To: linux-lvm

Hello everybody,

I am using gentoo and I use LVM snapshots to make backups of my system.
Unfortunately, I always have a problem to remove these. LVM always
complains that it can't remove an open logical volume. However, the
snapshot is unmounted when I try to remove it. It seems it's only
possible to remove the snapshot if the corresponding volume is
deactivated. So, I am forced to boot on a live cd to remove the snapshot
of my root partition. Is this really normal ?
I already had that problem a long time ago and I thought it was solved
if a do a sync before removing the snapshot. It seems it's no more
sufficient. I am using LVM 2.02.56-r2, udev 149 and kernel 2.6.33.2

What is even more strange is that I can't even remove snapshot of
logical volumes which I have never mount. In fact, I do the following steps:
	lvcreate -L5G -n test gentoo
	lvcreate -n test1 -L1G -s /dev/gentoo/test
	lvremove gentoo/test1
And, I always get this error: Can't remove open logical volume "test1"

Am I forgetting something ? Until 2 month agos, this worked without any
error. Does anybody have an idea about this problem ?

Thanks in advance for your help,

Fran�ois Valenduc

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [linux-lvm] Problem to remove LVM snaphots
  2010-04-18  8:54 [linux-lvm] Problem to remove LVM snaphots François Valenduc
@ 2010-04-18 23:04 ` Phillip Susi
  2010-04-19 16:47   ` François Valenduc
  0 siblings, 1 reply; 5+ messages in thread
From: Phillip Susi @ 2010-04-18 23:04 UTC (permalink / raw)
  To: LVM general discussion and development; +Cc: François Valenduc

On 04/18/2010 04:54 AM, Fran�ois Valenduc wrote:
> Hello everybody,
>
> I am using gentoo and I use LVM snapshots to make backups of my system.
> Unfortunately, I always have a problem to remove these. LVM always
> complains that it can't remove an open logical volume. However, the
> snapshot is unmounted when I try to remove it. It seems it's only
> possible to remove the snapshot if the corresponding volume is
> deactivated. So, I am forced to boot on a live cd to remove the snapshot
> of my root partition. Is this really normal ?

No, it is not normal.  Obviously something on your system has the 
snapshot open.  Perhaps it is being auto mounted?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [linux-lvm] Problem to remove LVM snaphots
  2010-04-18 23:04 ` Phillip Susi
@ 2010-04-19 16:47   ` François Valenduc
  2010-04-20  5:48     ` Luca Berra
  2010-04-26  9:56     ` Zdenek Kabelac
  0 siblings, 2 replies; 5+ messages in thread
From: François Valenduc @ 2010-04-19 16:47 UTC (permalink / raw)
  To: linux-lvm

Le 19/04/10 01:04, Phillip Susi a �crit :
> On 04/18/2010 04:54 AM, Fran�ois Valenduc wrote:
>> Hello everybody,
>>
>> I am using gentoo and I use LVM snapshots to make backups of my system.
>> Unfortunately, I always have a problem to remove these. LVM always
>> complains that it can't remove an open logical volume. However, the
>> snapshot is unmounted when I try to remove it. It seems it's only
>> possible to remove the snapshot if the corresponding volume is
>> deactivated. So, I am forced to boot on a live cd to remove the snapshot
>> of my root partition. Is this really normal ?
> 
> No, it is not normal.  Obviously something on your system has the
> snapshot open.  Perhaps it is being auto mounted?
> 
> _______________________________________________
> linux-lvm mailing list
> linux-lvm@redhat.com
> https://www.redhat.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
> 
I would really like to know the process which has the snapshot open.The
script I use to backup my system is the following:

#!/bin/sh
logrotate -v -f /etc/logrotate.conf
vgcfgbackup
lvcreate -L1G -n backup -s /dev/gentoo/root
if [ $? = 0 ]; then
        if [ ! -e /mnt/backup ]; then
                mkdir /mnt/backup
        fi
        mount -o ro /dev/gentoo/backup /mnt/backup
        cd /mnt/backup
        NAME="/home/francois/Backup/gentoo_64_$(date +%F).tar.bz2"
        tar cvfpj ${NAME} --exclude=tmp/* *
        cd /
        umount /mnt/backup
        if [ $? = 0 ]; then
                sync
                lvremove -f gentoo/backup
        fi
fi


So, the snaphot is clearly unmounted before I try to remove it. But I
can almost never remove the snaphot. In fact, I have noticed that if I
don't use the "-f" option, I can remove the snapshot but it always fails
if I use it. But, I would like to use my script without any confirmation
message.

Fran�ois

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [linux-lvm] Problem to remove LVM snaphots
  2010-04-19 16:47   ` François Valenduc
@ 2010-04-20  5:48     ` Luca Berra
  2010-04-26  9:56     ` Zdenek Kabelac
  1 sibling, 0 replies; 5+ messages in thread
From: Luca Berra @ 2010-04-20  5:48 UTC (permalink / raw)
  To: linux-lvm

On Mon, Apr 19, 2010 at 06:47:33PM +0200, Fran�ois Valenduc wrote:
>I would really like to know the process which has the snapshot open.The
did you try checking with fuser or /sys/block/dm-*/holders?

>script I use to backup my system is the following:
unrelated to problem but:

>#!/bin/sh
>logrotate -v -f /etc/logrotate.conf
>vgcfgbackup
>lvcreate -L1G -n backup -s /dev/gentoo/root
>if [ $? = 0 ]; then
>        if [ ! -e /mnt/backup ]; then
>                mkdir /mnt/backup
>        fi
>        mount -o ro /dev/gentoo/backup /mnt/backup
add error checking here
>        cd /mnt/backup
>        NAME="/home/francois/Backup/gentoo_64_$(date +%F).tar.bz2"
>        tar cvfpj ${NAME} --exclude=tmp/* *
ugly wildcards, quote the first and consider using . instead of second

>        cd /
>        umount /mnt/backup
>        if [ $? = 0 ]; then
>                sync
>                lvremove -f gentoo/backup
>        fi
>fi
>
>
>So, the snaphot is clearly unmounted before I try to remove it. But I
>can almost never remove the snaphot. In fact, I have noticed that if I
>don't use the "-f" option, I can remove the snapshot but it always fails
>if I use it. But, I would like to use my script without any confirmation
>message.
>
>Fran�ois
>
>_______________________________________________
>linux-lvm mailing list
>linux-lvm@redhat.com
>https://www.redhat.com/mailman/listinfo/linux-lvm
>read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

-- 
Luca Berra -- bluca@comedia.it
         Communication Media & Services S.r.l.
  /"\
  \ /     ASCII RIBBON CAMPAIGN
   X        AGAINST HTML MAIL
  / \

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [linux-lvm] Problem to remove LVM snaphots
  2010-04-19 16:47   ` François Valenduc
  2010-04-20  5:48     ` Luca Berra
@ 2010-04-26  9:56     ` Zdenek Kabelac
  1 sibling, 0 replies; 5+ messages in thread
From: Zdenek Kabelac @ 2010-04-26  9:56 UTC (permalink / raw)
  To: LVM general discussion and development; +Cc: François Valenduc

Dne 19.4.2010 18:47, Fran�ois Valenduc napsal(a):
> Le 19/04/10 01:04, Phillip Susi a �crit :
>> On 04/18/2010 04:54 AM, Fran�ois Valenduc wrote:
>>> Hello everybody,
>>>
>>> I am using gentoo and I use LVM snapshots to make backups of my system.
>>> Unfortunately, I always have a problem to remove these. LVM always
>>> complains that it can't remove an open logical volume. However, the
>>> snapshot is unmounted when I try to remove it. It seems it's only
>>> possible to remove the snapshot if the corresponding volume is
>>> deactivated. So, I am forced to boot on a live cd to remove the snapshot
>>> of my root partition. Is this really normal ?
>>
>> No, it is not normal.  Obviously something on your system has the
>> snapshot open.  Perhaps it is being auto mounted?
>>
>> _______________________________________________
>> linux-lvm mailing list
>> linux-lvm@redhat.com
>> https://www.redhat.com/mailman/listinfo/linux-lvm
>> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
>>
> I would really like to know the process which has the snapshot open.The
> script I use to backup my system is the following:
> 
> #!/bin/sh
> logrotate -v -f /etc/logrotate.conf
> vgcfgbackup
> lvcreate -L1G -n backup -s /dev/gentoo/root
> if [ $? = 0 ]; then
>         if [ ! -e /mnt/backup ]; then
>                 mkdir /mnt/backup
>         fi
>         mount -o ro /dev/gentoo/backup /mnt/backup
>         cd /mnt/backup
>         NAME="/home/francois/Backup/gentoo_64_$(date +%F).tar.bz2"
>         tar cvfpj ${NAME} --exclude=tmp/* *
>         cd /
>         umount /mnt/backup
>         if [ $? = 0 ]; then
>                 sync
>                 lvremove -f gentoo/backup
>         fi
> fi
> 
> 
> So, the snaphot is clearly unmounted before I try to remove it. But I
> can almost never remove the snaphot. In fact, I have noticed that if I
> don't use the "-f" option, I can remove the snapshot but it always fails
> if I use it. But, I would like to use my script without any confirmation
> message.

Sounds like udev problem.  Most probably gentoo stepped into the udev
mine-field. It's hard to give a good advice - udev currently has its problems.

You may try to experiment - try to disable udev to see whether it helps in
this script case and renable after the script...

Zdenek

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-04-26  9:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-18  8:54 [linux-lvm] Problem to remove LVM snaphots François Valenduc
2010-04-18 23:04 ` Phillip Susi
2010-04-19 16:47   ` François Valenduc
2010-04-20  5:48     ` Luca Berra
2010-04-26  9:56     ` Zdenek Kabelac

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.