Other Alignment on hardware RAID

Hi,

I have HP ProLiant DL320G5p, which comes with HP Smart Array E200 RAID controller, configured with RAID-5. I'd like to use it for hosting jails on ZFS partition. I partitioned it manually as follows:

Code:
gpart destroy -F da0
gpart create -s gpt da0
gpart add -t freebsd-boot -a1m -s512k da0
gpart add -t freebsd-ufs -a1m -s6g da0
gpart add -t freebsd-swap -a1m -s8g da0
gpart add -t freebsd-zfs -a1m da0
However, it gives me strange alignment:
Code:
pacija@warden1:~ % gpart show da0
=>  34  1757614617  da0  GPT  (838G)
  34  758  - free -  (379K)
  792  1024  1  freebsd-boot  (512K)
  1816  1024  - free -  (512K)
  2840  12582912  2  freebsd-ufs  (6.0G)
  12585752  16777216  3  freebsd-swap  (8.0G)
  29362968  1728249856  4  freebsd-zfs  (824G)
  1757612824  1827  - free -  (914K)
Zpool also complains:
Code:
pacija@warden1:~ % zpool status
  pool: alcatraz
state: ONLINE
status: One or more devices are configured to use a non-native block size.
   Expect reduced performance.
action: Replace affected devices with devices that support the
   configured block size, or migrate data to a properly configured
   pool.
  scan: none requested
config:

   NAME  STATE  READ WRITE CKSUM
   alcatraz  ONLINE  0  0  0
    da0p4  ONLINE  0  0  0  block size: 8192B configured, 1048576B native
On another server without RAID controller but with two disks in ZFS mirror, similar partitioning scheme (-a1m) aligns differently (OK), and zpool does not complain:
Code:
pacija@hulk:~ % gpart show ada0
=>  34  488397101  ada0  GPT  (233G)
  34  2014  - free -  (1.0M)
  2048  1024  1  freebsd-boot  (512K)
  3072  1024  - free -  (512K)
  4096  16777216  2  freebsd-swap  (8.0G)
  16781312  41943040  3  freebsd-ufs  (20G)
  58724352  429672448  4  freebsd-zfs  (205G)
  488396800  335  - free -  (168K)
Code:
pacija@hulk:~ % zpool status
  pool: pkg
state: ONLINE
  scan: none requested
config:

   NAME  STATE  READ WRITE CKSUM
   pkg  ONLINE  0  0  0
    mirror-0  ONLINE  0  0  0
    gpt/0pkgzfs  ONLINE  0  0  0
    gpt/1pkgzfs  ONLINE  0  0  0

errors: No known data errors

How to correct problems with partitioning on my server with hardware RAID?

Thank you in advance.
 
Using -a1m -s512k is asking for conflicting things. To align to 1M, both the start location and size would be multiples of 1M. That is kind of impossible with a 512K size.

ZFS is complaining about block size, which is not alignment.

Putting this all on top of hardware RAID prevents ZFS from working like it wants and introduces the possibility that the hardware RAID works in different block sizes.
 
Ok, let's simplify by not involving ZFS.

Here's how FreeBSD sees RAID array:

Code:
pacija@warden1:~ % diskinfo -v da0
da0
  512              # sectorsize
  899898718208     # mediasize in bytes (838G)
  1757614684       # mediasize in sectors
  1048576          # stripesize
  643072           # stripeoffset
  215393           # Cylinders according to firmware.
  255              # Heads according to firmware.
  32               # Sectors according to firmware.
  PA6C90R9SXK07P   # Disk ident.

Using bsdinstall(8)'s Auto (UFS) Guided Disk Setup I get the following alignment:
Code:
pacija@warden1:~ % gpart show da0
=>  34  1757614617  da0  GPT  (838G)
  34  2014  - free -  (1.0M)
  2048  1024  1  freebsd-boot  (512K)
  3072  1024  - free -  (512K)
  4096  1749021696  2  freebsd-ufs  (834G)
  1749025792  1024  - free -  (512K)
  1749026816  8388608  3  freebsd-swap  (4.0G)
  1757415424  199227  - free -  (97M)

Notice that all the partitions start on sector which is multiple value of 2048. Now, if number of sectors they occupied was also dividable by 2048, this would mean that partitions are 1m aligned (at least that is my understanding). But number of sectors that da0p2 occupies is not dividable by 2048. What confuses me even more is the fact that if there weren't 1024 unused sectors between da0p2 and da0p3, but they were added to da0p2, da0p2 would be dividable by 2048, and thus 1m aligned.

I already wrote that, when partitioning manually and specifying 1m alignment, I get numbers I don't really understand:

Code:
pacija@warden1:~ % gpart show da0
=>  34  1757614617  da0  GPT  (838G)
  34  758  - free -  (379K)
  792  1024  1  freebsd-boot  (512K)
  1816  1024  - free -  (512K)
  2840  12582912  2  freebsd-ufs  (6.0G)
  12585752  16777216  3  freebsd-swap  (8.0G)
  29362968  1728249856  4  freebsd-zfs  (824G)
  1757612824  1827  - free -  (914K)
Obviously, partitions are created with number of sectors dividable with 2048, but they do not start on sector dividable by 2048.

When manually creating partitions which start on sector dividable by 2048 (by specifying -b option), I get warning that 'da0pX added, but partition is not aligned on 1048576 bytes'. Notice that 1048576 is stripesize from diskinfo(8).

What is the influence of stripesize and stripeoffset on correct partitioning? How should I partition my volume given diskinfo it shows?

Thank you in advance.
.
 
Let's start by getting the first two partitions correct:
gpart destroy -F da0
gpart create -s gpt da0

Boot code is only read once at system start, and it is small. Alignment is not a performance issue. Still, we'll align it to 4K mostly for neatness.
gpart add -t freebsd-boot -a4k -s512k da0

The first filesystem partition should start at 1M. This is a standard least-common-multiple value. Aligning it to 1M will not hurt. Probably will not help performance any more than aligning it to 4K, but whatever.
gpart add -t freebsd-ufs -a1m -b1m -s6g da0

On single disks, stripesize represents the physical block size. A 4K disk typically shows 512 byte blocksize and 4K stripesize. What will happen with a RAID card, don't know.
 
Back
Top