OpenSolaris derived ZFS NAS/ SAN (OmniOS, OpenIndiana, Solaris and napp-it)

Discussion in 'SSDs & Data Storage' started by _Gea, Dec 30, 2010.

  1. IdiotInCharge

    IdiotInCharge [H]ardForum Junkie

    Messages:
    8,836
    Joined:
    Jun 13, 2003
    Thanks for the detailed response!
     
    mikeo likes this.
  2. WishYou

    WishYou n00b

    Messages:
    7
    Joined:
    Oct 19, 2016
    Hi _Gea !

    I've found and fixed a bug in your zpool cap calculations.
    There is a rounding error that may or may not hit hard depending on the layout and usage of the pools.
    'zfs list' outputs numbers with _comma_ but perl requires _point_ to handle calculations correctly.

    I've added a quick fix to zfslib_val2kb:
    Code:
    ###############
     sub zfslib_val2kb  {  #hide:
    ###############
    
          my $w1=$_[0];
    ->    $w1=~s/,/./;
          if ($w1=~/K/) { $w1=~s/K//;  }
          if ($w1=~/M/) { $w1=~s/M//; $w1=$w1*1000; }
          if ($w1=~/G/) { $w1=~s/G//; $w1=$w1*1000000; }
          if ($w1=~/T/) { $w1=~s/T//; $w1=$w1*1000000000; }
          if ($w1=~/P/) { $w1=~s/P//; $w1=$w1*1000000000000; }
          return ($w1);
     }
    

    Before:
    Code:
    NAME    USED    AVAIL   MOUNTPOINT      %
    rpool   23,2G   15,3G   /rpool  39%
    storage 5,62T   5,61T   /storage        50%
    tank    17,3T   3,95T   /tank   15%!
    vmstore 304G    107G    /vmstore        26%
    
    After, I've added a decimal point as well here, because it looks nicer... :)
    Code:
    NAME    USED    AVAIL   MOUNTPOINT      %
    rpool   23,2G   15,3G   /rpool  39.7%
    storage 5,62T   5,61T   /storage        50.0%
    tank    17,3T   3,95T   /tank   18.6%
    vmstore 304G    107G    /vmstore        26.0%
    

    Regards,
    Wish
     
    mikeo and _Gea like this.
  3. _Gea

    _Gea 2[H]4U

    Messages:
    3,800
    Joined:
    Dec 5, 2010
  4. dedobot

    dedobot [H]Lite

    Messages:
    86
    Joined:
    Jun 19, 2012
    SMB file sharing quick tip: If you can afford it -disable smb sighning at the windows client too, not only at the SMB server. Via domain policy or local gpo, depend of the situation. Leave smb1 restrictions untouched. Same for macos.