ccdconfig and Linux mdadm

Maciej Suszko maciej at suszko.eu
Thu Jul 3 20:35:59 UTC 2014


Stefan Esser <se at 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 at fbsd:~ # gnop create -o 1M ada1s1
root at fbsd:~ # gnop create -o 1M ada2s1

2) create ccd device (this time md0 was created with chunksize 32)

root at fbsd:~ # ccdconfig ccd0 32 linux /dev/ada1s1.nop /dev/ada2s1.nop
root at fbsd:~ # ccdonfig -g
ccd0            64      0       /dev/ada1s1.nop /dev/ada2s1.nop


And finally, here are the results:

root at fbsd:~ # file -s /dev/ccd0 
/dev/ccd0: Linux rev 1.0 ext3 filesystem data, UUID=c442e028-bfa8-4841-8bb2-7d21a9835c00

root at fbsd:~ # df -ht ext2fs
Filesystem    Size    Used   Avail Capacity  Mounted on
/dev/ccd0     190M    185M    5.4M    97%    /root/nobackup

root at 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 at 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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-fs/attachments/20140703/67310953/attachment.sig>


More information about the freebsd-fs mailing list