Alter.Org.UA  
 << Back Home RU ru   Donate Donate www/www1/www2

Alternative metadata storage for GMIRROR
(fix for AR and GMIRROR compatibility)

by Alter (alterX@alter.org.ua (remove X))

Today I was installing FreeBSD on Fujistsu-Siemens server. It has onboard PATA and SATA-RAID LSI MegaRaid. There is CD/DVD on PATA and 4 HDDs on SATA, they are visible both as ad and ar
I need two RAID-1 arrays. Seems to be simple:

  • either use native RAID controller functionality
  • or gmirror.

Appears, that FreeBSD don't know how to update metadata for this type of controllers. It can read/write, but can't maintain array. I've checked CURRENT, it cannot do that too. Array maintainance only with BIOS is unacceptable :(. Ok, let's use gmirror. After reboot appears, that LSI MegaRaid

  • always modifies last sector of attached disks.
  • can't boot from disks without its own (LSI) metadata.
  • there is no passthrough option to expose disk as non-raid storage.

I was to update gmirror. Now it can optionally store its metadata in the previous sector. You can use -o 1 option with label and insert to chose alternative location. gmirror attempts to load metadata from last sector. If this attempt fails, it tries previous one. gmirror shall not overwrite last sector if metadata is stored in previous. So, we have compatibility option for ar*.

Setup BIOS to use all drives as separate STRIPE arrays (one disk in each one). Use gmirror with -o 1 option to setup proper array.

Patch for 7.х includes performance updates from CURRENT.

PS. would be nice if ATA or ATARAID check for presence of Soft-RAID metadata and inform gmirror management tools.

Benefits

  • platform independency for gmirror-volumes. It would be possible to mount volume on other RAID-controller or without it.
  • hot swap without BIOS assistance and system downtime.

Example 1

#> gmirror label -b load -o 1 gm1 ad8
#> gmirror insert -o 1 gm1 ad10
#> gmirror dump ad8
Found metadata on ad8 at offset 1.
Metadata on ad8[1]:
     magic: GEOM::MIRROR
   version: 4
   ....
#> gmirror dump ad10
Found metadata on ad10 at offset 1.
Metadata on ad10[1]:
     magic: GEOM::MIRROR
   version: 4
   ....
#> atacontrol status ar2
ar2: ATA RAID0 stripesize=128 status: READY
 subdisks:
   0 ad8  ONLINE
#> atacontrol status ar3
ar3: ATA RAID0 stripesize=128 status: READY
 subdisks:
   0 ad10  ONLINE

Example 2

#> gmirror label -v -b load gm1 ad8
#> gmirror insert -v gm1 ad10
#> gmirror dump ad8
Metadata on ad8[0]:
     magic: GEOM::MIRROR
   version: 4
   ....
#> gmirror dump ad10
Metadata on ad10[0]:
     magic: GEOM::MIRROR
   version: 4
   ....
#> atacontrol status ar2
atacontrol: ioctl(IOCATARAIDSTATUS): ....

Patch download:
7.2fbsd7-gmirror-mdoffs.20120617.patch.gz
8.x, HEADfbsd8-gmirror-mdoffs.20120617.patch.gz

FreeBSD bugtrack ID: 169539

2012.06.17


Mail to alterX@alter.org.ua (remove X)  
designed by Alter aka Alexander A. Telyatnikov powered by Apache+PHP under FBSD © 2002-2017