All of lore.kernel.org
 help / color / mirror / Atom feed
* xfs duplicate UUID
@ 2020-03-24 16:13 Pawan Prakash Sharma
  2020-03-24 16:16 ` Christoph Hellwig
  2020-03-24 17:38 ` Emmanuel Florac
  0 siblings, 2 replies; 10+ messages in thread
From: Pawan Prakash Sharma @ 2020-03-24 16:13 UTC (permalink / raw)
  To: linux-xfs

Hi,

I am using ZFS filesystem and created a block device(ZVOL) and mounted
and formatted that as xfs filesystem. I have one application running
which is using this xfs file system.

Now, when I am creating a ZFS snapshot and ZFS clone and trying to
mount the clone filesystem, I am getting duplicate UUID error and I am
not able to moiunt it.

After searching I found there is xfs_freeze binary available to freeze
the file system. xfs_freeze is intended to be used with volume
managers and hardware RAID devices that support the creation of
snapshots. As zfs file system is volume manager also so this looks
good solution. So I tried the below steps:-

1. xfs_freeze -f <mountpath>
2. take the zfs snapshot
3. create the clone from the snapshot
4. xfs_freeze -u <mountpath>
5. generate new uuid with "xfs_admin -U generate <device>"

This is not working. xfs_admin command itself is throwing the error,
it is returning this error :

ERROR: The filesystem has valuable metadata changes in a log which needs to
be replayed.  Mount the filesystem to replay the log, and unmount it before
re-running xfs_admin.  If you are unable to mount the filesystem, then use
the xfs_repair -L option to destroy the log and attempt a repair.
Note that destroying the log may cause corruption -- please attempt a mount
of the filesystem before doing this.

But this error does not make any sense since as per man page
(https://linux.die.net/man/8/xfs_freeze)

All dirty data, metadata, and log information are written to disk,
then why I am getting this error. Am I missing something?


Regards,
Pawan.

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

* Re: xfs duplicate UUID
  2020-03-24 16:13 xfs duplicate UUID Pawan Prakash Sharma
@ 2020-03-24 16:16 ` Christoph Hellwig
  2020-03-24 17:28   ` Emmanuel Florac
  2020-03-24 17:38 ` Emmanuel Florac
  1 sibling, 1 reply; 10+ messages in thread
From: Christoph Hellwig @ 2020-03-24 16:16 UTC (permalink / raw)
  To: Pawan Prakash Sharma; +Cc: linux-xfs

On Tue, Mar 24, 2020 at 09:43:25PM +0530, Pawan Prakash Sharma wrote:
> Hi,
> 
> I am using ZFS filesystem and created a block device(ZVOL) and mounted
> and formatted that as xfs filesystem. I have one application running
> which is using this xfs file system.
> 
> Now, when I am creating a ZFS snapshot and ZFS clone and trying to
> mount the clone filesystem, I am getting duplicate UUID error and I am
> not able to moiunt it.

Don't ask for our help if you are intentionally violating our
copyrights.

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

* Re: xfs duplicate UUID
  2020-03-24 16:16 ` Christoph Hellwig
@ 2020-03-24 17:28   ` Emmanuel Florac
  0 siblings, 0 replies; 10+ messages in thread
From: Emmanuel Florac @ 2020-03-24 17:28 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Pawan Prakash Sharma, linux-xfs

[-- Attachment #1: Type: text/plain, Size: 1012 bytes --]

Le Tue, 24 Mar 2020 09:16:55 -0700
Christoph Hellwig <hch@infradead.org> écrivait:

> On Tue, Mar 24, 2020 at 09:43:25PM +0530, Pawan Prakash Sharma wrote:
> > Hi,
> > 
> > I am using ZFS filesystem and created a block device(ZVOL) and
> > mounted and formatted that as xfs filesystem. I have one
> > application running which is using this xfs file system.
> > 
> > Now, when I am creating a ZFS snapshot and ZFS clone and trying to
> > mount the clone filesystem, I am getting duplicate UUID error and I
> > am not able to moiunt it.  
> 
> Don't ask for our help if you are intentionally violating our
> copyrights.

Come on, do you think he's an Oracle peon? :)

-- 
------------------------------------------------------------------------
Emmanuel Florac     |   Direction technique
                    |   Intellique
                    |	<eflorac@intellique.com>
                    |   +33 1 78 94 84 02
------------------------------------------------------------------------

[-- Attachment #2: Signature digitale OpenPGP --]
[-- Type: application/pgp-signature, Size: 163 bytes --]

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

* Re: xfs duplicate UUID
  2020-03-24 16:13 xfs duplicate UUID Pawan Prakash Sharma
  2020-03-24 16:16 ` Christoph Hellwig
@ 2020-03-24 17:38 ` Emmanuel Florac
  2020-03-24 17:44   ` Pawan Prakash Sharma
  1 sibling, 1 reply; 10+ messages in thread
From: Emmanuel Florac @ 2020-03-24 17:38 UTC (permalink / raw)
  To: Pawan Prakash Sharma; +Cc: linux-xfs

[-- Attachment #1: Type: text/plain, Size: 653 bytes --]

Le Tue, 24 Mar 2020 21:43:25 +0530
Pawan Prakash Sharma <pawanprakash101@gmail.com> écrivait:

> Now, when I am creating a ZFS snapshot and ZFS clone and trying to
> mount the clone filesystem, I am getting duplicate UUID error and I am
> not able to moiunt it.
> 

Did you try to mount it with the "nouuid" option?

-- 
------------------------------------------------------------------------
Emmanuel Florac     |   Direction technique
                    |   Intellique
                    |	<eflorac@intellique.com>
                    |   +33 1 78 94 84 02
------------------------------------------------------------------------

[-- Attachment #2: Signature digitale OpenPGP --]
[-- Type: application/pgp-signature, Size: 163 bytes --]

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

* Re: xfs duplicate UUID
  2020-03-24 17:38 ` Emmanuel Florac
@ 2020-03-24 17:44   ` Pawan Prakash Sharma
  2020-03-24 18:26     ` Emmanuel Florac
  0 siblings, 1 reply; 10+ messages in thread
From: Pawan Prakash Sharma @ 2020-03-24 17:44 UTC (permalink / raw)
  To: Emmanuel Florac; +Cc: linux-xfs

> Did you try to mount it with the "nouuid" option?

yes, that is working fine. I am able to mount it. But I am not sure
the side effect of doing that as there will not be any uuid generated
and xfsdump/xfsrestore might need that. Correct me if I am wrong.

Regards,
Pawan.

On Tue, Mar 24, 2020 at 11:08 PM Emmanuel Florac <eflorac@intellique.com> wrote:
>
> Le Tue, 24 Mar 2020 21:43:25 +0530
> Pawan Prakash Sharma <pawanprakash101@gmail.com> écrivait:
>
> > Now, when I am creating a ZFS snapshot and ZFS clone and trying to
> > mount the clone filesystem, I am getting duplicate UUID error and I am
> > not able to moiunt it.
> >
>
> Did you try to mount it with the "nouuid" option?
>
> --
> ------------------------------------------------------------------------
> Emmanuel Florac     |   Direction technique
>                     |   Intellique
>                     |   <eflorac@intellique.com>
>                     |   +33 1 78 94 84 02
> ------------------------------------------------------------------------

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

* Re: xfs duplicate UUID
  2020-03-24 17:44   ` Pawan Prakash Sharma
@ 2020-03-24 18:26     ` Emmanuel Florac
       [not found]       ` <CABS7VHDt=v1SmSggnn8288uE5Cs27RqXpPsbiGk9=wyJ-pz1pQ@mail.gmail.com>
  0 siblings, 1 reply; 10+ messages in thread
From: Emmanuel Florac @ 2020-03-24 18:26 UTC (permalink / raw)
  To: Pawan Prakash Sharma; +Cc: linux-xfs

[-- Attachment #1: Type: text/plain, Size: 834 bytes --]

Le Tue, 24 Mar 2020 23:14:03 +0530
Pawan Prakash Sharma <pawanprakash101@gmail.com> écrivait:

> > Did you try to mount it with the "nouuid" option?  
> 
> yes, that is working fine. I am able to mount it. But I am not sure
> the side effect of doing that as there will not be any uuid generated
> and xfsdump/xfsrestore might need that. Correct me if I am wrong.
> 

Your problem is that the log is dirty. You need to mount it once to
clean up the log, then you'll be able to change the UUID.

-- 
------------------------------------------------------------------------
Emmanuel Florac     |   Direction technique
                    |   Intellique
                    |	<eflorac@intellique.com>
                    |   +33 1 78 94 84 02
------------------------------------------------------------------------

[-- Attachment #2: Signature digitale OpenPGP --]
[-- Type: application/pgp-signature, Size: 163 bytes --]

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

* Re: xfs duplicate UUID
       [not found]       ` <CABS7VHDt=v1SmSggnn8288uE5Cs27RqXpPsbiGk9=wyJ-pz1pQ@mail.gmail.com>
@ 2020-03-25 14:24         ` Emmanuel Florac
  2020-03-25 16:55           ` Pawan Prakash Sharma
       [not found]           ` <CABS7VHCuGgu0N5ZSXXSKQE9R5ngzAedv_TdZDMt-CHWDfhRZEg@mail.gmail.com>
  0 siblings, 2 replies; 10+ messages in thread
From: Emmanuel Florac @ 2020-03-25 14:24 UTC (permalink / raw)
  To: Pawan Prakash Sharma, xfs

[-- Attachment #1: Type: text/plain, Size: 1118 bytes --]

Le Tue, 24 Mar 2020 23:58:24 +0530
Pawan Prakash Sharma <pawanprakash101@gmail.com> écrivait:

> >Your problem is that the log is dirty. You need to mount it once to  
> clean up the log, then you'll be able to change the UUID.
> 
> But why xfs_freeze is not clearing that as man page says that it does
> that?

Please reply to the list so that anyone interested can learn about it. 

This is mentioned in the man page at the next line:

 Note that even after freezing, the on-disk filesystem can contain
 information on files that are still in  the process of unlinking.
 These files will not be unlinked until the filesystem is unfrozen or a
 clean mount of the snapshot is complete.

You probably have open unlinked files (such as temporary files). It's
very common.

-- 
------------------------------------------------------------------------
Emmanuel Florac     |   Direction technique
                    |   Intellique
                    |	<eflorac@intellique.com>
                    |   +33 1 78 94 84 02
------------------------------------------------------------------------

[-- Attachment #2: Signature digitale OpenPGP --]
[-- Type: application/pgp-signature, Size: 163 bytes --]

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

* Re: xfs duplicate UUID
  2020-03-25 14:24         ` Emmanuel Florac
@ 2020-03-25 16:55           ` Pawan Prakash Sharma
       [not found]           ` <CABS7VHCuGgu0N5ZSXXSKQE9R5ngzAedv_TdZDMt-CHWDfhRZEg@mail.gmail.com>
  1 sibling, 0 replies; 10+ messages in thread
From: Pawan Prakash Sharma @ 2020-03-25 16:55 UTC (permalink / raw)
  To: Emmanuel Florac; +Cc: xfs

> Note that even after freezing, the on-disk filesystem can contain
 information on files that are still in  the process of unlinking.
 These files will not be unlinked until the filesystem is unfrozen or a
 clean mount of the snapshot is complete.

hmmm, ok, so what is the right way to do it?
Should I mount the cloned volume with nouuid first so that log is
replayed and filesystem is clean, then umount it and then generated
the UUID for this using xfs_admin command?

Or should I use xfs_repair with -L option to clear the logs and then
generate the UUID with xfs_admin command. but as per man page when
using this option the filesystem will likely appear to be corrupt, and
can cause the loss of user files and/or data?

Man xfs_repair :
-L : Force Log Zeroing. Forces xfs_repair to zero the log even if it
is dirty (contains metadata changes). When using this option the
filesystem will likely appear to be corrupt, and can cause the loss of
user files and/or data.

Regards,
Pawan.

Regards,
Pawan.


On Wed, Mar 25, 2020 at 7:54 PM Emmanuel Florac <eflorac@intellique.com> wrote:
>
> Le Tue, 24 Mar 2020 23:58:24 +0530
> Pawan Prakash Sharma <pawanprakash101@gmail.com> écrivait:
>
> > >Your problem is that the log is dirty. You need to mount it once to
> > clean up the log, then you'll be able to change the UUID.
> >
> > But why xfs_freeze is not clearing that as man page says that it does
> > that?
>
> Please reply to the list so that anyone interested can learn about it.
>
> This is mentioned in the man page at the next line:
>
>  Note that even after freezing, the on-disk filesystem can contain
>  information on files that are still in  the process of unlinking.
>  These files will not be unlinked until the filesystem is unfrozen or a
>  clean mount of the snapshot is complete.
>
> You probably have open unlinked files (such as temporary files). It's
> very common.
>
> --
> ------------------------------------------------------------------------
> Emmanuel Florac     |   Direction technique
>                     |   Intellique
>                     |   <eflorac@intellique.com>
>                     |   +33 1 78 94 84 02
> ------------------------------------------------------------------------

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

* Re: xfs duplicate UUID
       [not found]           ` <CABS7VHCuGgu0N5ZSXXSKQE9R5ngzAedv_TdZDMt-CHWDfhRZEg@mail.gmail.com>
@ 2020-03-25 17:37             ` Emmanuel Florac
  2020-03-25 20:05               ` Pawan Prakash Sharma
  0 siblings, 1 reply; 10+ messages in thread
From: Emmanuel Florac @ 2020-03-25 17:37 UTC (permalink / raw)
  To: Pawan Prakash Sharma; +Cc: xfs

[-- Attachment #1: Type: text/plain, Size: 1090 bytes --]

Le Wed, 25 Mar 2020 20:35:03 +0530
Pawan Prakash Sharma <pawanprakash101@gmail.com> écrivait:

> > Note that even after freezing, the on-disk filesystem can contain  
>  information on files that are still in  the process of unlinking.
>  These files will not be unlinked until the filesystem is unfrozen or
> a clean mount of the snapshot is complete.
> 
> hmmm, ok, so what is the right way to do it?
> Sould mount the cloned volume with nouuid first so that log is
> replayed and filesystem is clean, then umount it and then generated
> the UUID for this using xfs_admin command.
> 

Yes, that looks like the proper way to do it. Zeroing the og with
xfs_repair is usually a last resort thing that you'd rather not do
unless it's unavoidable.

-- 
------------------------------------------------------------------------
Emmanuel Florac     |   Direction technique
                    |   Intellique
                    |	<eflorac@intellique.com>
                    |   +33 1 78 94 84 02
------------------------------------------------------------------------

[-- Attachment #2: Signature digitale OpenPGP --]
[-- Type: application/pgp-signature, Size: 163 bytes --]

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

* Re: xfs duplicate UUID
  2020-03-25 17:37             ` Emmanuel Florac
@ 2020-03-25 20:05               ` Pawan Prakash Sharma
  0 siblings, 0 replies; 10+ messages in thread
From: Pawan Prakash Sharma @ 2020-03-25 20:05 UTC (permalink / raw)
  To: Emmanuel Florac; +Cc: xfs

>Yes, that looks like the proper way to do it. Zeroing the og with
xfs_repair is usually a last resort thing that you'd rather not do
unless it's unavoidable.

Thanks for confirming and thanks for helping me.

Regards,
Pawan.

Regards,
Pawan.


On Wed, Mar 25, 2020 at 11:07 PM Emmanuel Florac <eflorac@intellique.com> wrote:
>
> Le Wed, 25 Mar 2020 20:35:03 +0530
> Pawan Prakash Sharma <pawanprakash101@gmail.com> écrivait:
>
> > > Note that even after freezing, the on-disk filesystem can contain
> >  information on files that are still in  the process of unlinking.
> >  These files will not be unlinked until the filesystem is unfrozen or
> > a clean mount of the snapshot is complete.
> >
> > hmmm, ok, so what is the right way to do it?
> > Sould mount the cloned volume with nouuid first so that log is
> > replayed and filesystem is clean, then umount it and then generated
> > the UUID for this using xfs_admin command.
> >
>
> Yes, that looks like the proper way to do it. Zeroing the og with
> xfs_repair is usually a last resort thing that you'd rather not do
> unless it's unavoidable.
>
> --
> ------------------------------------------------------------------------
> Emmanuel Florac     |   Direction technique
>                     |   Intellique
>                     |   <eflorac@intellique.com>
>                     |   +33 1 78 94 84 02
> ------------------------------------------------------------------------

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

end of thread, other threads:[~2020-03-25 20:05 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-24 16:13 xfs duplicate UUID Pawan Prakash Sharma
2020-03-24 16:16 ` Christoph Hellwig
2020-03-24 17:28   ` Emmanuel Florac
2020-03-24 17:38 ` Emmanuel Florac
2020-03-24 17:44   ` Pawan Prakash Sharma
2020-03-24 18:26     ` Emmanuel Florac
     [not found]       ` <CABS7VHDt=v1SmSggnn8288uE5Cs27RqXpPsbiGk9=wyJ-pz1pQ@mail.gmail.com>
2020-03-25 14:24         ` Emmanuel Florac
2020-03-25 16:55           ` Pawan Prakash Sharma
     [not found]           ` <CABS7VHCuGgu0N5ZSXXSKQE9R5ngzAedv_TdZDMt-CHWDfhRZEg@mail.gmail.com>
2020-03-25 17:37             ` Emmanuel Florac
2020-03-25 20:05               ` Pawan Prakash Sharma

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.