Date: Thu, 3 Jul 2014 22:35:48 +0200 From: Maciej Suszko <maciej@suszko.eu> To: Stefan Esser <se@freebsd.org> Cc: freebsd-fs@FreeBSD.org 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>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] Stefan Esser <se@freebsd.org> wrote: > In this situation, I'd do the following: > > 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 > > 2) Same as 1) under FreeBSD ... > > 3) Dump the first 4KB of each file into a text file, e.g. with > "dd if=$FILE bs=4k count=1 | 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 /dev/ccd0: Linux rev 1.0 ext3 filesystem data, UUID=c442e028-bfa8-4841-8bb2-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 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 -- regards, Maciej Suszko. [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlO1vqgACgkQCikUk0l7iGqMIwCfdrhS2MwmAYnwiQL5JYsQSZV0 FtMAnA7sbUBKem5Mg6pHJ4K7VDwydNPU =nCa/ -----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140703223548.49b5c907>
