From owner-freebsd-fs@FreeBSD.ORG Thu Jul 3 20:35:59 2014 Return-Path: Delivered-To: freebsd-fs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 601BBD14; Thu, 3 Jul 2014 20:35:59 +0000 (UTC) Received: from archeo.suszko.eu (archeo.unixguru.pl [IPv6:2001:41d0:1:f47a::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA778220E; Thu, 3 Jul 2014 20:35:58 +0000 (UTC) Received: from archeo (localhost [127.0.0.1]) by archeo.suszko.eu (Postfix) with ESMTP id 696E22063809; Thu, 3 Jul 2014 22:35:54 +0200 (CEST) X-Virus-Scanned: amavisd-new at archeo.local Received: from archeo.suszko.eu ([127.0.0.1]) by archeo (archeo.local [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 1e8sb1piOiTP; Thu, 3 Jul 2014 22:35:54 +0200 (CEST) Received: from leo.lan (89-66-16-9.dynamic.chello.pl [89.66.16.9]) by archeo.suszko.eu (Postfix) with ESMTPSA id ABF0D2063807; Thu, 3 Jul 2014 22:35:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=suszko.eu; s=dkim; t=1404419754; bh=UL4f+KdyTz8yquSSrkQPCbbPqcqsF7HGcSrOWydRd2g=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=GqNgd7bYxkYQdIPsVL3PxLx/CL7a/J6NXomqUtbReVpZzy0GbcA3HkWPZibvdQZgN fmoaiTJC2jFF0z8afbBPbLAMtHRcVhvyvY6yB5C9hC48Ud+cKlEp9Em0C+Au9n3BK5 arosGOkpiKvkNmqpD2KstMwD/baqGY/bP1HmbimM= Date: Thu, 3 Jul 2014 22:35:48 +0200 From: Maciej Suszko To: Stefan Esser Subject: Re: ccdconfig and Linux mdadm Message-ID: <20140703223548.49b5c907@leo.lan> In-Reply-To: <53B57935.3090209@freebsd.org> References: <20140703114254.6472055a@helium> <53B5395B.6040301@freebsd.org> <20140703152801.695a39e6@helium> <53B57935.3090209@freebsd.org> X-Mailer: Claws Mail 3.10.1 (GTK+ 2.24.22; amd64-portbld-freebsd10.0) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; boundary="Sig_/aLwII0lQ=jMv_xdrIabXVFE"; protocol="application/pgp-signature" Cc: freebsd-fs@FreeBSD.org X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jul 2014 20:35:59 -0000 --Sig_/aLwII0lQ=jMv_xdrIabXVFE Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Stefan Esser wrote: > In this situation, I'd do the following: >=20 > 1) dd 1MB from the start of the partition from each underlying device > (sdb1, sdc1) and from the md device into named files under Linux >=20 > 2) Same as 1) under FreeBSD ... >=20 > 3) Dump the first 4KB of each file into a text file, e.g. with > "dd if=3D$FILE bs=3D4k count=3D1 | hd > $FILE.txt" and look for > signatures that are similar (e.g. for the "magic number" of > the ext3fs). Thanks for pointing me out. Studying [1] mdraid superblock formats I found that in my case superblock starts 4K from the beginning of each device (version 1.2). Checking byte by byte against the specification I hit data_offset field - it was 0x800 (2048 decimal), so having 512-byte sectors it means data starts at 1MB... Here's what I just did: 1) create gnop deviced with 1MB offset: root@fbsd:~ # gnop create -o 1M ada1s1 root@fbsd:~ # gnop create -o 1M ada2s1 2) create ccd device (this time md0 was created with chunksize 32) root@fbsd:~ # ccdconfig ccd0 32 linux /dev/ada1s1.nop /dev/ada2s1.nop root@fbsd:~ # ccdonfig -g ccd0 64 0 /dev/ada1s1.nop /dev/ada2s1.nop And finally, here are the results: root@fbsd:~ # file -s /dev/ccd0=20 /dev/ccd0: Linux rev 1.0 ext3 filesystem data, UUID=3Dc442e028-bfa8-4841-8b= b2-7d21a9835c00 root@fbsd:~ # df -ht ext2fs Filesystem Size Used Avail Capacity Mounted on /dev/ccd0 190M 185M 5.4M 97% /root/nobackup root@fbsd:~ # ls -la total 185062 drwxr-xr-x 3 root wheel 1024 Jul 3 22:04 . drwxr-xr-x 10 root wheel 512 Jul 3 20:34 .. -rw-r--r-- 1 root wheel 45 Jul 3 22:05 180mb.MD5 -rw-r--r-- 1 root wheel 188743680 Jul 3 22:03 180mb.file drwx------ 2 root wheel 12288 Jul 3 22:19 lost+found root@fbsd:~ # gmd5sum -c 180mb.MD5=20 180mb.file: OK 180mb.* files were created under Linux. Again I can say FreeBSD rocks! ... as usual :D [1] https://raid.wiki.kernel.org/index.php/RAID_superblock_formats --=20 regards, Maciej Suszko. --Sig_/aLwII0lQ=jMv_xdrIabXVFE Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlO1vqgACgkQCikUk0l7iGqMIwCfdrhS2MwmAYnwiQL5JYsQSZV0 FtMAnA7sbUBKem5Mg6pHJ4K7VDwydNPU =nCa/ -----END PGP SIGNATURE----- --Sig_/aLwII0lQ=jMv_xdrIabXVFE--