xfs
[Top] [All Lists]

RE: LVM snapshot and XFS

To: "'Tom Carroll '" <tcarroll@xxxxxxxxxxxxx>
Subject: RE: LVM snapshot and XFS
From: Dale Stephenson <Steph@xxxxxxxxxx>
Date: Tue, 17 Jul 2001 11:54:57 -0700
Cc: "'linux-xfs '" <linux-xfs@xxxxxxxxxxx>
Sender: owner-linux-xfs@xxxxxxxxxxx
Here's two patches to allow writable snapshots.  One is against the lvm code
in the kernel.  I haven't updated it to apply against 1.0.1 yet, so you may
have to tweak it.  The other is to allow the lvchange LVM tool to set
snapshots to read/write (they are created read-only).

Once you've changed it to read/write you can do replays and change the uuid,
though a combination of xfs_freeze and nouuid mount should be cleaner.

I believe that the next generation of LVM (after 1.0 is finally out) will
have writeable snapshots and also file system sync before snapshot.

Dale Stephenson
steph@xxxxxxxxxx

-----Original Message-----
From: Ragnar Kjørstad
To: Tom Carroll
Cc: linux-xfs
Sent: 7/17/01 11:13 AM
Subject: Re: LVM snapshot and XFS

On Tue, Jul 17, 2001 at 10:57:07AM -0400, Tom Carroll wrote:
> Hello all,
> 
> I did some searching around and I could not find the answer to this
problem:
> 
> I created a snapshot of an XFS parition under LVM.
> 
> lvcreate -L1G -s -n bkup /dev/vol0/home
> 
> Then I attempted to mount the snapshot:
> 
> mount -oro /dev/vol0/bkup /mnt
> mount: wrong fs type, bad option, bad superblock on /dev/vol0/bkup,
>        or too many mounted file systems
> 
> klog states:
> XFS: Filesystem has duplicate UUID - can't mount
> 
> When I attempt to change the UUID:
> xfs_db -c'uuid generate' /dev/vol0/bkup
> 
> xfs_db: cannot open /dev/vol0/bkup: Permission denied
> 
> Even though I am root.  
> 
> Will anyone give a helping hand?  Thanks in advance

The snapshot device is read-only, so you can't change the UUID.

I believe there is a kernel patch floating around to allow you to mount
multiple filesystems with the same UUID.

You'll then run into the next problem:
The snapshot is of an unclean XFS filesystem, and since the device is
readonly you can't reply the journal or run fsck. For now the only way
around this is to unmount your filesystem when taking the snapshot.



-- 
Ragnar Kjorstad
Big Storage

Attachment: lvm_0.9.djs.lvchange.patch
Description: Binary data

Attachment: lvm-0.9.1beta7-writeable-snap.patch
Description: Binary data

<Prev in Thread] Current Thread [Next in Thread>