Discussion:
Label a EFI disk to VTOC by mistake, how to get it back?
sun via illumos-zfs
2014-05-13 14:37:47 UTC
Permalink
Hi All,

I have a disk with zpool on it and it was EFI labeled.
When I put this disk on Solaris 8, it does not know there was a file
system on it.
By mistake, I labeled it to VTOC. Back to Solaris 10, the zpool can not
be imported again.
So, how can I get my data back ?

It seems that it can be done by the following method(I tested it on a
new disk, it works well):
1) re-format the disk to EFI label
# format -e
2) write the original partition map back to the disk.
# cat EFI_original_partition_information | fmthard -s - /dev/rdsk/c2d1s0
3) Then, the pool can be imported normally.

But, what if I don't know the original partition map?
Can any one help me?
Jim Klimov via illumos-zfs
2014-05-13 16:28:52 UTC
Permalink
Post by sun via illumos-zfs
Hi All,
I have a disk with zpool on it and it was EFI labeled.
When I put this disk on Solaris 8, it does not know there was a file
system on it.
By mistake, I labeled it to VTOC. Back to Solaris 10, the zpool can not
be imported again.
So, how can I get my data back ?
It seems that it can be done by the following method(I tested it on a
1) re-format the disk to EFI label
# format -e
2) write the original partition map back to the disk.
# cat EFI_original_partition_information | fmthard -s -
/dev/rdsk/c2d1s0
3) Then, the pool can be imported normally.
But, what if I don't know the original partition map?
Can any one help me?
-------------------------------------------
illumos-zfs
Archives: https://www.listbox.com/member/archive/182191/=now
https://www.listbox.com/member/archive/rss/182191/22497542-d75cd9d9
https://www.listbox.com/member/?&
Powered by Listbox: http://www.listbox.com
You can use 'od' to read the disk in Hex and grep for the offset of 00bab10c header of the zfs structures (note that depending on chosen output format, the byte order may be mangled). See the zfs on-disk guide (google) to find the offset, iirc it is 128kb from start of partition.
--
Typos courtesy of K-9 Mail on my Samsung Android
Toomas Soome via illumos-zfs
2014-05-13 16:38:38 UTC
Permalink
if the disk was labelled as whole disk, then the EFI label is as following:

slice 0, tag usr, first sector: 256, last sector is at end - 8MB.
slice 8, tag reserved, first sector is last sector of slice 0 + 1, size 8MB.

rgds,
toomas
Post by Jim Klimov via illumos-zfs
Post by sun via illumos-zfs
Hi All,
I have a disk with zpool on it and it was EFI labeled.
When I put this disk on Solaris 8, it does not know there was a file
system on it.
By mistake, I labeled it to VTOC. Back to Solaris 10, the zpool can not
be imported again.
So, how can I get my data back ?
It seems that it can be done by the following method(I tested it on a
1) re-format the disk to EFI label
# format -e
2) write the original partition map back to the disk.
# cat EFI_original_partition_information | fmthard -s -
/dev/rdsk/c2d1s0
3) Then, the pool can be imported normally.
But, what if I don't know the original partition map?
Can any one help me?
-------------------------------------------
illumos-zfs
Archives: https://www.listbox.com/member/archive/182191/=now
https://www.listbox.com/member/archive/rss/182191/22497542-d75cd9d9
https://www.listbox.com/member/?&
Powered by Listbox: http://www.listbox.com
You can use 'od' to read the disk in Hex and grep for the offset of 00bab10c header of the zfs structures (note that depending on chosen output format, the byte order may be mangled). See the zfs on-disk guide (google) to find the offset, iirc it is 128kb from start of partition.
--
Typos courtesy of K-9 Mail on my Samsung Android
-------------------------------------------
illumos-zfs
Archives: https://www.listbox.com/member/archive/182191/=now
RSS Feed: https://www.listbox.com/member/archive/rss/182191/25767303-368b6a9e
Modify Your Subscription: https://www.listbox.com/member/?&
Powered by Listbox: http://www.listbox.com
Loading...