Lines Matching +full:slice +full:- +full:per +full:- +full:line

69 # $2 filesystem type; optional - defaulted to zfs
76 [[ -z $fstype ]] && fstype=zfs
92 out=$(df -F $fstype $1 2>/dev/null)
112 # $2 filesystem type; optional - defaulted to zfs
124 # $2 filesystem type; optional - defaulted to zfs
133 # split line on ","
135 # $1 - line to split
162 [[ -d /$TESTPOOL ]] && rm -rf /$TESTPOOL
163 log_must zpool create -f $TESTPOOL $disklist
168 rm -rf $TESTDIR || log_unresolved Could not remove $TESTDIR
169 mkdir -p $TESTDIR || log_unresolved Could not create $TESTDIR
174 if [[ -n $container ]]; then
175 rm -rf $TESTDIR1 || \
177 mkdir -p $TESTDIR1 || \
187 if [[ -n $volume ]]; then
189 log_must zfs create -V $VOLSIZE $TESTPOOL/$TESTVOL
238 typeset fs_vol=${1:-$TESTPOOL/$TESTFS}
239 typeset snap=${2:-$TESTSNAP}
241 [[ -z $fs_vol ]] && log_fail "Filesystem or volume's name is undefined."
242 [[ -z $snap ]] && log_fail "Snapshot's name is undefined."
261 typeset snap=${1:-$TESTPOOL/$TESTFS@$TESTSNAP}
262 typeset clone=${2:-$TESTPOOL/$TESTCLONE}
264 [[ -z $snap ]] && \
266 [[ -z $clone ]] && \
282 typeset fs_vol=${1:-$TESTFS}
283 typeset snap=${2:-$TESTSNAP}
284 typeset bkmark=${3:-$TESTBKMARK}
286 [[ -z $fs_vol ]] && log_fail "Filesystem or volume's name is undefined."
287 [[ -z $snap ]] && log_fail "Snapshot's name is undefined."
288 [[ -z $bkmark ]] && log_fail "Bookmark's name is undefined."
310 typeset sendfs="${2:-$TESTPOOL/create_recv_clone}"
316 [[ -z $recvfs ]] && log_fail "Recv filesystem's name is undefined."
321 log_must zfs create -o mountpoint="$mountpoint" $sendfs
323 log_must eval "zfs send $snap | zfs recv -u $recvfs"
326 log_must eval "zfs send -i $snap $incr | dd bs=10k count=1 > $sendfile"
327 log_mustnot eval "zfs recv -su $recvfs < $sendfile"
328 destroy_dataset "$sendfs" "-r"
329 log_must rm -f "$sendfile"
331 if [[ $(get_prop 'inconsistent' "$recvfs/%recv") -ne 1 ]]; then
361 [[ -z $primary ]] && \
363 [[ -z $secondary ]] && \
365 [[ -d /$TESTPOOL ]] && rm -rf /$TESTPOOL
366 log_must zpool create -f $TESTPOOL mirror $@
374 # on the command line. These mirrors are *not* mounted
380 typeset -i nmirrors=$1
384 log_must test -n "$1" -a -n "$2"
385 [[ -d /$TESTPOOL$nmirrors ]] && rm -rf /$TESTPOOL$nmirrors
386 log_must zpool create -f $TESTPOOL$nmirrors mirror $1 $2
388 ((nmirrors = nmirrors - 1))
395 # on the command line. These pools are *not* mounted
401 typeset -i nraidzs=$1
405 log_must test -n "$1" -a -n "$2"
406 [[ -d /$TESTPOOL$nraidzs ]] && rm -rf /$TESTPOOL$nraidzs
407 log_must zpool create -f $TESTPOOL$nraidzs raidz $1 $2
409 ((nraidzs = nraidzs - 1))
425 # Given a minimum of two disks, set up a storage pool and dataset for the raid-z
433 if [[ ${#disks[*]} -lt 2 ]]; then
434 log_fail "A raid-z requires a minimum of two disks."
437 [[ -d /$TESTPOOL ]] && rm -rf /$TESTPOOL
438 log_must zpool create -f $TESTPOOL raidz $disklist
450 # sub-tests to ensure errors from one set of tests doesn't
469 zfs unmount -a > /dev/null 2>&1
471 ALL_POOLS=$(zpool list -H -o name \
472 | grep -v "$NO_POOLS" | egrep -v "$exclude")
476 while [ ! -z ${ALL_POOLS} ]
484 ALL_POOLS=$(zpool list -H -o name \
485 | grep -v "$NO_POOLS" \
486 | egrep -v "$exclude")
490 zfs mount -a
493 for fs in $(zfs list -H -o name \
495 destroy_dataset "$fs" "-Rf"
499 for fs in $(zfs list -H -o name); do
501 [[ -d $fs ]] && log_must rm -rf $fs/*
508 for fs in $(zfs list -H -o name); do
515 if [[ $? -ne 0 ]] || [[ -z "$enc" ]] || \
532 [[ -d $TESTDIR ]] && \
533 log_must rm -rf $TESTDIR
548 [[ $? -eq 0 ]] && \
551 destroy_dataset "$TESTPOOL/$TESTCTR/$TESTFS1" "-R"
552 destroy_dataset "$TESTPOOL/$TESTCTR" "-Rf"
554 [[ -e $TESTDIR1 ]] && \
555 log_must rm -rf $TESTDIR1 > /dev/null 2>&1
568 typeset snap=${1:-$TESTPOOL/$TESTFS@$TESTSNAP}
587 [[ $mtpt != "" && -d $mtpt ]] && \
588 log_must rm -rf $mtpt
598 typeset clone=${1:-$TESTPOOL/$TESTCLONE}
613 [[ $mtpt != "" && -d $mtpt ]] && \
614 log_must rm -rf $mtpt
625 typeset bkmark=${1:-$TESTPOOL/$TESTFS#$TESTBKMARK}
636 # $1 - snapshot name
640 zfs list -H -t snapshot "$1" > /dev/null 2>&1
647 # $1 - bookmark name
651 zfs list -H -t bookmark "$1" > /dev/null 2>&1
664 # non-zero otherwise.
704 [[ -z $dataset ]] && return 1
707 typeset -i found=0
714 [[ $found -eq 0 ]] && return 2
715 if [[ -n $COMPRESSION_PROP ]]; then
720 if [[ -n $CHECKSUM_PROP ]]; then
756 # Given a slice, size and disk, this function
757 # formats the slice to the specified size.
758 # Size should be specified with units as per
763 typeset -i slicenum=$1
767 [[ -z $slicenum || -z $size || -z $disk ]] && \
768 log_fail "The slice, size or disk name is unspecified."
782 format -e -s -d $disk -f $format_file
784 rm -f $format_file
785 [[ $ret_val -ne 0 ]] && \
786 log_fail "Unable to format $disk slice $slicenum to $size"
791 # Get the end cyl of the given slice
793 function get_endslice #<disk> <slice>
796 typeset slice=$2
797 if [[ -z $disk || -z $slice ]] ; then
798 log_fail "The disk name or slice number is unspecified."
805 typeset -i ratio=0
814 typeset -i endcyl=$(prtvtoc -h /dev/rdsk/${disk}s2 |
815 nawk -v token="$slice" '{if ($1==token) print $6}')
823 # Given a size,disk and total slice number, this function formats the
824 # disk slices from 0 to the total slice number with the same specified
829 typeset -i i=0
850 # maximum number of files per directory have been written.
860 # dirnum: the maximum number of subdirectories to use, -1 no limit
861 # filenum: the maximum number of files per subdirectory
873 typeset destdir=${1:-$TESTDIR}
874 typeset -i dirnum=${2:-50}
875 typeset -i filenum=${3:-50}
876 typeset -i bytes=${4:-8192}
877 typeset -i num_writes=${5:-10240}
878 typeset data=${6:-0}
880 typeset -i odirnum=1
881 typeset -i idirnum=0
882 typeset -i fn=0
883 typeset -i retval=0
885 mkdir -p $destdir/$idirnum
891 file_write -o create -f $destdir/$idirnum/$TESTFILE.$fn \
892 -b $bytes -c $num_writes -d $data
901 mkdir -p $destdir/$idirnum
913 # Note property is in 'parsable' format (-p)
921 prop_val=$(zfs get -pH -o value $prop $dataset 2>/dev/null)
922 if [[ $? -ne 0 ]]; then
943 prop_val=$(zpool get $prop $pool 2>/dev/null | tail -1 | \
945 if [[ $? -ne 0 ]]; then
961 # $1 - pool name
967 if [[ -z $pool ]]; then
978 # $1-n dataset name
997 # $1-n dataset name
1006 zfs list -H -t filesystem,snapshot,volume $1 > /dev/null 2>&1 \
1030 none|legacy|-) return 1
1044 typeset stat=$(svcs -H -o STA nfs/server:default)
1089 # Cannot share directory in non-global zone.
1097 if [[ $(svcs -Ho STA $nfs_fmri) != "ON" ]]; then
1104 if [[ -d $dummy ]]; then
1105 log_must rm -rf $dummy
1120 while [[ timeout -ne 0 && $(svcs -Ho STA $nfs_fmri) == *'*' ]]
1124 ((timeout -= 1))
1128 log_must rm -rf $dummy
1131 log_note "Current NFS status: '$(svcs -Ho STA,FMRI $nfs_fmri)'"
1137 # Return 0 if in global zone, 1 in non-global zone
1160 [[ -z $limit ]] && return 0
1169 *) log_note "Warning: unknown limit $limit - " \
1180 *) log_note "Warning: unknown limit $limit - " \
1194 # $1 - pool name
1195 # $2-n - [keyword] devs_list
1203 if [[ -z $pool ]]; then
1213 [[ -d /$pool ]] && rm -rf /$pool
1214 log_must zpool create -f $pool $@
1223 # $1 - pool name
1231 if [[ -z $pool ]]; then
1244 typeset -i wait_time=10 ret=1 count=0
1246 while [[ $ret -ne 0 ]]; do
1247 $must zpool destroy -f $pool
1249 [[ $ret -eq 0 ]] && break
1251 [[ count++ -ge 7 ]] && must=log_must
1255 [[ -d $mtpt ]] && \
1256 log_must rm -rf $mtpt
1268 # $1 - dataset name
1269 # $2-n - dataset options
1277 if [[ -z $dataset ]]; then
1294 # $1 - dataset name
1295 # $2 - custom arguments for zfs destroy
1302 typeset args=${2:-""}
1304 if [[ -z $dataset ]]; then
1314 [[ -d $mtpt ]] && \
1315 log_must rm -rf $mtpt
1336 typeset zone_name=${1:-$(hostname)-z}
1337 typeset zone_root=${2:-"/zone_root"}
1338 typeset zone_ip=${3:-"10.1.1.10"}
1341 typeset -i cntctr=5
1342 typeset -i i=0
1346 [[ -d /$pool_name ]] && rm -rf /$pool_name
1347 log_must zpool create -f $pool_name $DISKS
1354 log_must zfs create -V 1g $pool_name/zone_zvol
1371 [[ -d $zone_root ]] && \
1372 log_must rm -rf $zone_root/$zone_name
1373 [[ ! -d $zone_root ]] && \
1374 log_must mkdir -p -m 0700 $zone_root/$zone_name
1410 log_must zonecfg -z $zone_name -f $zone_conf
1411 log_must rm -f $zone_conf
1414 zoneadm -z $zone_name install
1416 log_note "SUCCESS: zoneadm -z $zone_name install"
1418 log_fail "FAIL: zoneadm -z $zone_name install"
1435 log_must zoneadm -z $zone_name boot
1439 # Reexport TESTPOOL & TESTPOOL(1-4)
1443 typeset -i cntctr=5
1444 typeset -i i=0
1473 zpool status -v $pool | grep "$disk" \
1474 | grep -i "$state" > /dev/null 2>&1
1486 typeset dataset=${1:-$TESTPOOL/$TESTFS@$TESTSNAP}
1495 if [[ -z $fs || -z $snap ]]; then
1510 zdb -e -lll $device | nawk -v ashift=$ashift '/ashift: / {
1542 zfs unmount -a > /dev/null 2>&1
1545 if [[ -n $dirs ]] ; then
1547 search_path="$search_path -d $dir"
1553 zdb -cudi $filesys > $zdbout 2>&1
1555 log_note "Output: zdb -cudi $filesys"
1560 log_must zfs mount -a
1561 log_must rm -rf $zdbout
1569 typeset pool=${1:-$TESTPOOL}
1577 log_must zpool status -v
1589 disklist=$(zpool iostat -v $1 | nawk '(NR >4) {print $1}' | \
1590 grep -v "\-\-\-\-\-" | \
1591 egrep -v -e "^(mirror|raidz[1-3]|spare|log|cache|special|dedup)$")
1608 typeset -i TIMEOUT=$1
1619 ps -p $pid > /dev/null 2>&1
1621 log_must kill -USR1 $pid
1655 typeset timeout=${4:-60}
1656 typeset -i i=0
1658 while [[ $i -lt $timeout ]]; do
1718 typeset timeout=${4:-60}
1719 typeset -i i=0
1721 while [[ $i -lt $timeout ]]; do
1734 # Check the output of 'zpool status -v <pool>',
1744 typeset verbose=${4:-false}
1746 scan=$(zpool status -v "$pool" 2>/dev/null | nawk -v token="$token:" '
1751 echo $scan | grep -i "$keyword" > /dev/null 2>&1
1758 # is_pool_resilvering - to check if the pool is resilver in progress
1759 # is_pool_resilvered - to check if the pool is resilver completed
1760 # is_pool_scrubbing - to check if the pool is scrub in progress
1761 # is_pool_scrubbed - to check if the pool is scrub completed
1762 # is_pool_scrub_stopped - to check if the pool is scrub stopped
1763 # is_pool_scrub_paused - to check if the pool has scrub paused
1764 # is_pool_removing - to check if the pool is removing a vdev
1765 # is_pool_removed - to check if the pool is remove completed
1818 typeset timeout=${2:-30}
1825 if ((SECONDS - t0 > $timeout)); then
1845 typeset pool=${1:-$TESTPOOL}
1854 # in the given disk to avoid slice overlapping.
1884 max_finddisksnum=${MAX_FINDDISKSNUM:-6}
1886 swap -l > $sfi
1893 # -------------------
1895 #!/bin/nawk -f
1913 #---------------------
1916 disks=${@:-$(echo "" | format -e 2>/dev/null | /tmp/find_disks.awk)}
1931 # by a user-set environment variable
1940 # by looking for a device pointing to the first slice in
1944 if [ -b /dev/dsk/${disk}s0 ]; then
1945 if [ $count -lt $max_finddisksnum ]; then
1948 [[ -z $@ ]] && ((count = count + 1))
1968 typeset basedir=${3:-"/var/tmp"}
1974 log_must useradd -g $gname -d $basedir/$uname -m $uname
1975 log_must passwd -N $uname
1989 typeset basedir=${2:-"/var/tmp"}
1999 [[ -d $basedir/$user ]] && rm -fr $basedir/$user
2018 typeset -i gid=100
2020 groupadd -g $gid $group > /dev/null 2>&1
2021 typeset -i ret=$?
2043 groupmod -n $grp $grp > /dev/null 2>&1
2044 typeset -i ret=$?
2071 for pool in $(zpool list -H -o name)
2075 # this is a list of the top-level directories in each of the
2077 FILEPOOL=$(zpool status -v $pool | grep /$1/ | \
2081 ZVOLPOOL=$(zpool status -v $pool | grep "/dev/zvol/dsk/$1$" \
2084 # also want to determine if it's a file-based pool using an
2086 POOL_FILE_DIRS=$(zpool status -v $pool | \
2088 awk -F/ '{print $2}' | grep -v "dev")
2092 OUTPUT=$(zfs list -H -r -o mountpoint $1 | \
2099 if [ ! -z "$ZVOLPOOL" ]
2105 if [ ! -z "$FILEPOOL" ]
2111 if [ ! -z "$ALTMOUNTPOOL" ]
2118 if [ -z "${DONT_DESTROY}" ]
2134 typeset GZIP_OPTS="gzip gzip-1 gzip-2 gzip-3 gzip-4 gzip-5 \
2135 gzip-6 gzip-7 gzip-8 gzip-9"
2144 if [[ $? -eq 0 ]]; then
2151 # Verify zfs operation with -p option work as expected
2174 ops="create -V $VOLSIZE"
2178 if [[ -z $newdataset ]]; then
2186 if [[ -z $newdataset ]]; then
2199 destroy_dataset ${newdataset%/*} "-rRf"
2201 # without -p option, operation will fail
2205 # with -p option, operation should succeed
2206 log_must zfs $ops -p $dataset $newdataset
2208 log_fail "-p option does not work for $ops"
2213 log_must zfs $ops -p $dataset $newdataset
2233 alt_root=$(zpool list -H $pool | awk '{print $NF}')
2234 if [[ $alt_root == "-" ]]; then
2235 value=$(zdb -C $pool | grep "$config:" | awk -F: \
2238 value=$(zdb -e $pool | grep "$config:" | awk -F: \
2241 if [[ -n $value ]] ; then
2254 # $2-n string
2262 typeset -i ind
2265 typeset ret=$(echo "$str" | cut -f $ind -d ' ')
2274 typeset -i cnt=$#
2298 mkdir -p $dir
2301 typeset -i ret=0
2302 if ! zpool create -n $pool $vdev log $sdev > /dev/null 2>&1; then
2305 rm -r $dir
2317 typeset -i len=$1
2319 typeset -i baselen=${#basestr}
2320 typeset -i iter=0
2331 ((iter -= 1))
2351 cksum=$(zdb -vvv $1 | grep "^Dataset $1 \[" | grep "cksum" \
2352 | awk -F= '{print $7}')
2368 # Get the given disk/slice state from the specific field of the pool
2374 typeset field=${3:-$pool}
2376 state=$(zpool status -v "$pool" 2>/dev/null | \
2377 nawk -v device=$disk -v pool=$pool -v field=$field \
2397 if [[ -z $dir ]]; then
2402 # $ df -n /
2405 df -n $dir | awk '{print $3}'
2415 typeset -i iter=120
2416 typeset -i ret_val=1
2418 if [[ -z $disk ]]; then
2422 typeset arch=$(uname -p)
2425 log_must fdisk -B ${disk}p0
2443 # Disk update from fdisk -B may be delayed
2445 if format -e -s -d $disk -f $label_file ; then
2450 ((iter -= 1))
2453 rm -f $label_file
2467 df -n / | grep zfs > /dev/null 2>&1
2480 if [[ -z "$rootfs" ]]; then
2502 if [[ -z "$rootfs" ]]; then
2507 rootpool=`echo $rootfs | awk -F\/ '{print $1}'`
2522 echo $device | egrep "^c[0-F]+([td][0-F]+)+$" > /dev/null 2>&1
2548 typeset dirpath=${1:-$STC_NAME}
2550 echo "SUNWstc-${dirpath}" | /usr/bin/sed -e "s/\//-/g"
2558 echo $1 | wc -w
2566 typeset -i min=${2:-1}
2568 typeset -i count=$(get_word_count "$1")
2602 svcs -H -o state labeld 2>/dev/null | grep "enabled"
2613 (($(psrinfo | wc -l) > 1))
2618 psrinfo -v 0 | awk '/processor operates at/ {print $6}'
2627 eval su \$user -c \"$@\" > /tmp/out 2>/tmp/err
2645 if [[ -z $pool ]]; then
2653 zpool list -Hv "$pool" >$tmpfile
2655 grep -w ${vdev##*/} $tmpfile >/dev/null 2>&1
2656 [[ $? -ne 0 ]] && return 1
2659 rm -f $tmpfile
2666 typeset -l i max=$1
2678 typeset -l i min=$1
2702 typeset nfiles=${3:-1}
2703 typeset bs=${4:-1024k}
2704 typeset fname=${5:-file}
2706 [[ -d $dir ]] || log_fail "No directory: $dir"
2709 --name=job \
2710 --fallocate=0 \
2711 --minimal \
2712 --randrepeat=0 \
2713 --buffer_compress_percentage=66 \
2714 --buffer_compress_chunk=4096 \
2715 --directory=$dir \
2716 --numjobs=$nfiles \
2717 --rw=write \
2718 --bs=$bs \
2719 --filesize=$megs \
2720 --filename_format='$fname.\$jobnum' >/dev/null"
2728 [[ -e $pathname ]] || log_fail "No such file or directory: $pathname"
2729 objnum=$(stat -c %i $pathname)
2741 typeset pool=${1:-$TESTPOOL}
2742 typeset force=${2:-false}
2745 log_must zpool sync -f $pool
2760 typeset force=${1:-false}
2763 log_must zpool sync -f
2778 typeset pool=${1:-$TESTPOOL}
2780 [[ "0" == "$(zpool list -Ho freeing $pool)" ]] && break
2800 typeset pool=${1:-$TESTPOOL}
2803 awk '/replacing-[0-9]+/ {print $1}')" ]] && break
2809 # Set a global system tunable (64-bit value)
2820 # Set a global system tunable (32-bit value)
2835 typeset module="${4:-zfs}"
2837 [[ -z "$tunable" ]] && return 1
2838 [[ -z "$value" ]] && return 1
2839 [[ -z "$mdb_cmd" ]] && return 1
2844 [[ -w "$zfs_tunables/$tunable" ]] || return 1
2849 [[ "$module" -eq "zfs" ]] || return 1
2850 echo "${tunable}/${mdb_cmd}0t${value}" | mdb -kw
2869 typeset module="${2:-zfs}"
2871 [[ -z "$tunable" ]] && return 1
2876 [[ -f "$zfs_tunables/$tunable" ]] || return 1
2881 typeset value=$(mdb -k -e "$tunable::print | ::eval .=E")
2882 if [[ $? -ne 0 ]]; then
2904 echo y | newfs -v "$@"
2910 # Wait for the specified arcstat to reach non-zero quiescence.
2920 if [[ $echo -eq 0 ]]; then
2924 while $do_once || [ $stat1 -ne $stat2 ] || [ $stat2 -eq 0 ]; do
2931 if [[ $echo -eq 1 ]]; then
2956 if [ -x /usr/bin/digest ]; then
2957 /usr/bin/digest -a sha256 $file
2958 elif [ -x /usr/bin/sha256sum ]; then
2959 /usr/bin/sha256sum -b $file | awk '{ print $1 }'