functions-disk.sh (235452) | functions-disk.sh (240165) |
---|---|
1#!/bin/sh 2#- 3# Copyright (c) 2010 iXsystems, Inc. All rights reserved. 4# 5# Redistribution and use in source and binary forms, with or without 6# modification, are permitted provided that the following conditions 7# are met: 8# 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24# SUCH DAMAGE. 25# | 1#!/bin/sh 2#- 3# Copyright (c) 2010 iXsystems, Inc. All rights reserved. 4# 5# Redistribution and use in source and binary forms, with or without 6# modification, are permitted provided that the following conditions 7# are met: 8# 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24# SUCH DAMAGE. 25# |
26# $FreeBSD: head/usr.sbin/pc-sysinstall/backend/functions-disk.sh 235452 2012-05-14 18:03:59Z jpaetzel $ | 26# $FreeBSD: head/usr.sbin/pc-sysinstall/backend/functions-disk.sh 240165 2012-09-06 14:59:53Z jpaetzel $ |
27 28# Functions related to disk operations using gpart 29 30# See if device is a full disk or partition/slice 31is_disk() 32{ 33 for _dsk in `sysctl -n kern.disks` 34 do --- 184 unchanged lines hidden (view full) --- 219 220# Function which returns a target disks mediasize in sectors 221get_disk_mediasize() 222{ 223 mediasize=`diskinfo -v ${1} | grep "# mediasize in sectors" | tr -s ' ' | cut -f 2` 224 export VAL="${mediasize}" 225}; 226 | 27 28# Functions related to disk operations using gpart 29 30# See if device is a full disk or partition/slice 31is_disk() 32{ 33 for _dsk in `sysctl -n kern.disks` 34 do --- 184 unchanged lines hidden (view full) --- 219 220# Function which returns a target disks mediasize in sectors 221get_disk_mediasize() 222{ 223 mediasize=`diskinfo -v ${1} | grep "# mediasize in sectors" | tr -s ' ' | cut -f 2` 224 export VAL="${mediasize}" 225}; 226 |
227# Function which returns a target disks mediasize in megabytes 228get_disk_mediasize_mb() 229{ 230 mediasize=`diskinfo -v ${1} | grep "# mediasize in bytes" | tr -s ' ' | cut -f 2` 231 mediasize=`expr $mediasize / 1024` 232 mediasize=`expr $mediasize / 1024` 233 export VAL="${mediasize}" 234}; 235 |
|
227# Function to delete all gparts before starting an install 228delete_all_gpart() 229{ 230 echo_log "Deleting all gparts" 231 local DISK="$1" 232 233 # Check for any swaps to stop 234 for i in `swapctl -l | grep "$DISK" | awk '{print $1}'` --- 664 unchanged lines hidden --- | 236# Function to delete all gparts before starting an install 237delete_all_gpart() 238{ 239 echo_log "Deleting all gparts" 240 local DISK="$1" 241 242 # Check for any swaps to stop 243 for i in `swapctl -l | grep "$DISK" | awk '{print $1}'` --- 664 unchanged lines hidden --- |