[zfs-discuss] Re: Undo/reverse zpool create

2007-06-21 Thread Joubert Nel
 Joubert Nel wrote:
  Hi,
  
  If I add an entire disk to a new pool by doing
 zpool create, is this
  reversible?
  
  I.e. if there was data on that disk (e.g. it was
 the sole disk in a zpool
  in another system) can I get this back or is zpool
 create destructive?
 
 Short answer: you're stuffed, and no, it's not
 reversible.
 
 Long answer: see the short answer.

Darn!

 
 If the device was actually in use on another system,
 I
 would expect that libdiskmgmt would have warned you
 about
 this when you ran zpool create.

When I ran zpool create, the pool got created without a warning. 

What is strange, and maybe I'm naive here, is that there was no formatting of 
this physical disk so I'm optimistic that the data is still recoverable from 
it, even though the new pool shadows it.

Or is this way off mark?

Joubert
 
 
This message posted from opensolaris.org
___
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss


Re: [zfs-discuss] Re: Undo/reverse zpool create

2007-06-21 Thread Eric Schrock
On Thu, Jun 21, 2007 at 11:03:39AM -0700, Joubert Nel wrote:
 
 When I ran zpool create, the pool got created without a warning. 

zpool(1M) will diallow creation of the disk if it contains data in
active use (mounted fs, zfs pool, dump device, swap, etc).  It will warn
if it contains a recognized filesystem (zfs, ufs, etc) that is not
currently mounted, but allow you to override it with '-f'.  What was
previously on the disk?

 What is strange, and maybe I'm naive here, is that there was no
 formatting of this physical disk so I'm optimistic that the data is
 still recoverable from it, even though the new pool shadows it.
 
 Or is this way off mark?

You are guaranteed to have lost all data within the vdev label portions
of the disk (see on-disk specification from opensolaris.org).  How much
else you lost depends on how long the device was active in the pool and
how much data was written to it.

- Eric

--
Eric Schrock, Solaris Kernel Development   http://blogs.sun.com/eschrock
___
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss


Re: [zfs-discuss] Re: Undo/reverse zpool create

2007-06-21 Thread Richard Elling

Joubert Nel wrote:

If the device was actually in use on another system, I
would expect that libdiskmgmt would have warned you about
this when you ran zpool create.


AFAIK, libdiskmgmt is not multi-node aware.  It does know about local
uses of the disk.  Remote uses of the disk, especially those shared with
other OSes, is a difficult problem to solve where there are no standards.
Reason #84612 why I hate SANs.

When I ran zpool create, the pool got created without a warning. 


If the device was not currently in use, why wouldn't it proceed?


What is strange, and maybe I'm naive here, is that there was no formatting of 
this physical disk so I'm optimistic that the data is still recoverable from it, even 
though the new pool shadows it.

Or is this way off mark?


If you define formatting as writing pertinent information to the disk
such that ZFS works, then it was formatted.  The uberblock and its replicas
only take a few iops.
 -- richard
___
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss