From owner-freebsd-questions@freebsd.org Sun Aug 20 08:04:11 2017 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3F6DDE6362 for ; Sun, 20 Aug 2017 08:04:11 +0000 (UTC) (envelope-from shamim.shahriar@gmail.com) Received: from mail-wm0-x22e.google.com (mail-wm0-x22e.google.com [IPv6:2a00:1450:400c:c09::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2C0117C489 for ; Sun, 20 Aug 2017 08:04:11 +0000 (UTC) (envelope-from shamim.shahriar@gmail.com) Received: by mail-wm0-x22e.google.com with SMTP id t201so27393789wmt.1 for ; Sun, 20 Aug 2017 01:04:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=WJ/+Y+75rPrZ+HddgxfQIvyj+wFWpwMeutwetAGqfi4=; b=i2zfqasKdYTVDVjThx8COY34j/Bv1Faqa7zmqfvNBQyOeIeiqYioioJu/rJeJ25yOy 9sG7jUuG5urJruXAdDG9DMumhB75Jix9hgMX/YXne+74ojJQ1B1jcBThzpZLDKpJeXDp ZjC2l4nPmM2nNpp/2lZSgk0mQllIyQphq2+DTX7pBo2iqRwXWPGkDrNmzzVfpYKoskjw pv3zGhI3Y3XJ6P0LnUwsnoCz4jF2YGS6k5pNKi/5O7MqlDJuLFJkK88Vp90fwM9lAlwV 7ujA8AvYnqFFVqws6xYgO8ZXfqWmhz32t6hrJs8JUuiBWW0Y+w0lvA5yf/RbkmJpjlQv JIhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=WJ/+Y+75rPrZ+HddgxfQIvyj+wFWpwMeutwetAGqfi4=; b=A3KISoBEx1xAyT8mrTQLsgnatjiI9ygX5y8h7bsF6Dpvkq+iVwgd4ku7or3OGbM4cd OfKQMfn1q8pIxFaqLrH27y24IjTS0AbntUtsLD9GCgV5B8mwgL3rHLPZia5XwXJWMzxW EOR3Pt0l7QKUMqnYXUxK+x2vIj36ZQ+OY0iXTHngwEsuyzc7JqLGtk1fcHuxwnLUDkgu f/X6vJdMC2cMtkb3AdBtSdtzn3ikT82HVp68ULH48lKxxC3fR4lkdCvUCzRsO95Fcn3t aVBjcIMl2QqTFBTyEOKyvI7Cf1kMUdbQGAHPDiV4g7IUs0tnoVt47iyRZCAz1SghM1oN Cd8Q== X-Gm-Message-State: AHYfb5ggXKIDTaLJGJ9GRwqtZm1eLMM39odQfF6x0p4IfQXUuZ6PkFuq HM3q49Ut0dH1NCFT X-Received: by 10.28.193.203 with SMTP id r194mr4117724wmf.85.1503216247950; Sun, 20 Aug 2017 01:04:07 -0700 (PDT) Received: from osk.homenet ([2001:470:196e:17:f2de:f1ff:fed1:783c]) by smtp.googlemail.com with ESMTPSA id 63sm2310483wra.30.2017.08.20.01.04.06 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 20 Aug 2017 01:04:07 -0700 (PDT) Subject: Re: Trying to recover data from a ZFS Hard disk which no zpool name To: freebsd-questions@freebsd.org References: From: Shamim Shahriar Message-ID: Date: Sun, 20 Aug 2017 09:04:05 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Aug 2017 08:04:11 -0000 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