Trying to recover data from a ZFS Hard disk which no zpool name
Shamim Shahriar
shamim.shahriar at gmail.com
Sun Aug 20 08:04:11 UTC 2017
On 20/08/2017 02:30, Eduardo Lemos de Sa wrote:
> Dear
>
> I loose my main hard disk this week. There is a secondary hard dish where I
> had created a zfs filesystem named zee-root at /dev/ada0p1. I replaced the
> main hard disk but I couldn't recover data from the working /dev/ada0p1. I
> read a lot, but I couldn't find a easy way, if there is one, to recreate
> zee-root and recover data.
> Here, the output from some commands;
>
> gpart status:
>
> Name Status Components
> ada0p1 OK ada0 <---- so, adaop1 is there
> ada1p1 OK ada1
> ada1p2 OK ada1
> ada1p3 OK ada1
> ada1p4 OK ada1
>
>
> gpart list:
>
> Geom name: ada0
> modified: false
> state: OK
> fwheads: 16
> fwsectors: 63
> last: 976773134
> first: 34
> entries: 128
> scheme: GPT
> Providers:
> 1. Name: ada0p1
> Mediasize: 500106788864 (466G)
> Sectorsize: 512
> Stripesize: 0
> Stripeoffset: 1048576
> Mode: r0w0e0
> rawuuid: f1ba7289-40a0-11e7-b35b-40167ee6fc4f
> rawtype: 516e7cba-6ecf-11d6-8ff8-00022d09712b
> label: disk0
> length: 500106788864
> offset: 1048576
> type: freebsd-zfs
> index: 1
> end: 976773119
> start: 2048
> Consumers:
> 1. Name: ada0
> Mediasize: 500107862016 (466G)
> Sectorsize: 512
> Mode: r0w0e0
>
> Geom name: ada1
> modified: false
> state: OK
> fwheads: 16
> fwsectors: 63
> last: 1953523015
> first: 40
> entries: 152
> scheme: GPT
> Providers:
> 1. Name: ada1p1
> Mediasize: 819200 (800K)
> Sectorsize: 512
> Stripesize: 0
> Stripeoffset: 20480
> Mode: r0w0e0
> rawuuid: 7bc0df74-827e-11e7-a914-40167ee6fc4f
> rawtype: c12a7328-f81f-11d2-ba4b-00a0c93ec93b
> label: efiboot0
> length: 819200
> offset: 20480
> type: efi
> index: 1
> end: 1639
> start: 40
> 2. Name: ada1p2
> Mediasize: 524288 (512K)
> Sectorsize: 512
> Stripesize: 0
> Stripeoffset: 839680
> Mode: r0w0e0
> rawuuid: 7be10150-827e-11e7-a914-40167ee6fc4f
> rawtype: 83bd6b9d-7f41-11dc-be0b-001560b84f0f
> label: gptboot0
> length: 524288
> offset: 839680
> type: freebsd-boot
> index: 2
> end: 2663
> start: 1640
> 3. Name: ada1p3
> Mediasize: 17179869184 (16G)
> Sectorsize: 512
> Stripesize: 0
> Stripeoffset: 2097152
> Mode: r1w1e0
> rawuuid: 7c06e4ed-827e-11e7-a914-40167ee6fc4f
> rawtype: 516e7cb5-6ecf-11d6-8ff8-00022d09712b
> label: swap0
> length: 17179869184
> offset: 2097152
> type: freebsd-swap
> index: 3
> end: 33558527
> start: 4096
> 4. Name: ada1p4
> Mediasize: 983021125632 (916G)
> Sectorsize: 512
> Stripesize: 0
> Stripeoffset: 2097152
> Mode: r1w1e1
> rawuuid: 7c27f290-827e-11e7-a914-40167ee6fc4f
> rawtype: 516e7cba-6ecf-11d6-8ff8-00022d09712b
> label: zfs0
> length: 983021125632
> offset: 17181966336
> type: freebsd-zfs
> index: 4
> end: 1953521663
> start: 33558528
> Consumers:
> 1. Name: ada1
> Mediasize: 1000203804160 (932G)
> Sectorsize: 512
> Mode: r2w2e3
>
> So, my main disk is working ...
>
>
> glabel status:
>
> Name Status Components
> gpt/disk0 N/A ada0p1
> gpt/efiboot0 N/A ada1p1
> msdosfs/EFI N/A ada1p1
> gpt/gptboot0 N/A ada1p2
>
>
> and, finally, zpool list and zpool status:
>
> NAME SIZE ALLOC FREE EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
> zroot 912G 25.4G 887G - 1% 2% 1.00x ONLINE -
> pool: zroot
> state: ONLINE
> scan: none requested
> config:
>
> NAME STATE READ WRITE CKSUM
> zroot ONLINE 0 0 0
> ada1p4 ONLINE 0 0 0
>
> errors: No known data errors
>
>
> My main HD (/dev/ada1 = 912 GB) is working as /dev/ada0, but zpool only
> knows the first one. Please, could you advise me how to solve this problem?
>
> Thank you in advance for your attention
>
> My best wishes
>
> Eduardo
>
>
>
>
>
Hi Eduardo
I am getting slightly confused here. You said your main HDD was lost,
was that not ada0? Because you mention that there was a second hdd where
you had zee-root in ada0p1 -- generally the first HDD is ada0, second
one is ada1. If you lost ada0, and then replaced that with a different
drive/disk, then you have already replaced whatever contained your
zee-root. But later you showed you have zroot in ada1 (p4), so maybe I
am mistaken.
But just to be clear, can you please post the result of
zpool import
and
zfs list
so a better picture can be obtaine?
Thanks
More information about the freebsd-questions
mailing list