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? Joubert This message posted from opensolaris.org
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. 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". You can go from EFI label back to SMI (traditional) label by relabelling the disk from within "format -e". James C. McPherson -- Solaris kernel software engineer Sun Microsystems
> 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
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
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
Richard,> 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.What I meant is that when I do "zpool create" on a disk, the entire contents of the disk doesn''t seem to be overwritten/destroyed. I.e. I suspect that if I didn''t copy any data to this disk, a large portion of what was on it is potentially recoverable. If so, is there a tool that can help with such recovery? Joubert This message posted from opensolaris.org
> 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?It was ZFS with a few GB of data.> > > 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.OK, so if I didn''t copy any data to this disk, presumably a large portion of what was on the disk previously is theoretically recoverable. There is really one file in particular that I''d like to recover (it is a cpio backup). Is there a tool that can accomplish this? Joubert This message posted from opensolaris.org
On Thu, Jun 21, 2007 at 07:34:13PM -0700, Joubert Nel wrote:> > OK, so if I didn''t copy any data to this disk, presumably a large > portion of what was on the disk previously is theoretically > recoverable. There is really one file in particular that I''d like to > recover (it is a cpio backup). > > Is there a tool that can accomplish this?For ZFS, no. In addition to the fact that ZFS uses variable blocksizes and compression, there is no distinction between metadata and data. Without knowing the pool configuration and the ''root'' of the tree (the uberblock), there is no way for ZFS to recover data. An interesting tool could be written to try to recover data from trivial (single vdev, non-RAID-Z, uncompressed) pools by trying to interpret each block as metadata and verifying the checksums, but it would still be quite difficult (and painfully slow). - Eric -- Eric Schrock, Solaris Kernel Development http://blogs.sun.com/eschrock
> What I meant is that when I do "zpool create" on a disk, the entire > contents of the disk doesn''t seem to be overwritten/destroyed. I.e. I > suspect that if I didn''t copy any data to this disk, a large portion > of what was on it is potentially recoverable.Presumably a scavenger program could try to find the top of the oldest tree and construct an uberblock that points to it.> If so, is there a tool that can help with such recovery?Not that I''m aware of. -- Darren Dunham ddunham at taos.com Senior Technical Consultant TAOS http://www.taos.com/ Got some Dr Pepper? San Francisco, CA bay area < This line left intentionally blank to confuse you. >
Joubert Nel wrote:> What I meant is that when I do "zpool create" on a disk, the entire > contents of the disk doesn''t seem to be overwritten/destroyed. I.e. I > suspect that if I didn''t copy any data to this disk, a large portion of > what was on it is potentially recoverable. > > If so, is there a tool that can help with such recovery?I can''t answer this in detail, but, to borrow from Tim O''Reilly, think of it as the text of a book where you''ve lost the table of contents and the first few chapters, and thrown all the remaining pages on the floor... -- Michael Schuster Sun Microsystems, Inc. recursion, n: see ''recursion''