Changeset 5c0de09


Ignore:
Timestamp:
07/09/13 10:40:03 (14 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, 9.2-release, releng/10.0, releng/10.0.1, releng/10.0.2, releng/10.0.3
Children:
51d6c4b, e6c2871
Parents:
1d87ed6
Message:

Re-enable the GNOP fix to set ZFS 4k sector sizes, includes a fix to make
raidz play nicely with GRUB now

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src-sh/pc-sysinstall/backend/functions-newfs.sh

    rd464bcc r5c0de09  
    6363  # Check if we have some custom zpool arguments and use them if so 
    6464  if [ ! -z "${ZPOOLOPTS}" ] ; then 
    65     echo_log "Creating zpool ${ZPOOLNAME} with $ZPOOLOPTS" 
    66     rc_halt "zpool create -m none -f ${ZPOOLNAME} ${ZPOOLOPTS}" 
     65    # Sort through devices and run gnop on them 
     66    local gnopDev="" 
     67    local newOpts="" 
     68    local hGnop=0 
     69    for i in $ZPOOLOPTS 
     70    do 
     71       echo "$i" | grep -q '/dev/' 
     72       if [ $? -eq 0 -a $hGnop -eq 0 ] ; then 
     73          rc_halt "gnop create -S 4096 ${i}" 
     74          gnopDev="$gnopDev $i" 
     75          newOpts="$newOpts ${i}.nop" 
     76          hGnop=1 
     77       else 
     78          newOpts="$newOpts $i" 
     79       fi 
     80    done 
     81     
     82    echo_log "Creating zpool ${ZPOOLNAME} with $newOpts" 
     83    rc_halt "zpool create -m none -f ${ZPOOLNAME} ${newOpts}" 
     84 
     85    # Export the pool 
     86    rc_halt "zpool export ${ZPOOLNAME}" 
     87 
     88    # Destroy the gnop devices 
     89    for i in $gnopDev 
     90    do 
     91       rc_halt "gnop destroy ${i}.nop" 
     92    done 
     93 
     94    # And lastly re-import the pool 
     95    rc_halt "zpool import ${ZPOOLNAME}" 
    6796  else 
     97    # Lets do our pseudo-4k drive 
     98    rc_halt "gnop create -S 4096 ${PART}${EXT}" 
     99 
    68100    # No zpool options, create pool on single device 
    69101    echo_log "Creating zpool ${ZPOOLNAME} on ${PART}${EXT}" 
    70     rc_halt "zpool create -m none -f ${ZPOOLNAME} ${PART}${EXT}" 
     102    rc_halt "zpool create -m none -f ${ZPOOLNAME} ${PART}${EXT}.nop" 
     103 
     104    # Finish up the gnop 4k trickery 
     105    rc_halt "zpool export ${ZPOOLNAME}" 
     106    rc_halt "gnop destroy ${PART}${EXT}.nop" 
     107    rc_halt "zpool import ${ZPOOLNAME}" 
    71108  fi 
    72  
    73   # Disable atime for this zfs partition, speed increase 
    74   rc_nohalt "zfs set atime=off ${ZPOOLNAME}" 
    75109 
    76110}; 
Note: See TracChangeset for help on using the changeset viewer.