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-unmount.sh 232899 2012-03-12 21:32:43Z jpaetzel $ |
27 28# Functions which unmount all mounted disk filesystems 29 30# Unmount all mounted partitions under specified dir 31umount_all_dir() 32{ 33 _udir="$1" 34 _umntdirs=`mount | sort -r | grep "on $_udir" | cut -d ' ' -f 3` --- 32 unchanged lines hidden (view full) --- 67 # Start by unmounting any ZFS partitions 68 zfs_cleanup_unmount 69 70 # Lets read our partition list, and unmount each 71 ################################################################## 72 for PART in `ls ${PARTDIR}` 73 do 74 PARTDEV=`echo $PART | sed 's|-|/|g'` |
75 PARTFS="`cat ${PARTDIR}/${PART} | cut -d '#' -f 1`" 76 PARTMNT="`cat ${PARTDIR}/${PART} | cut -d '#' -f 2`" 77 PARTENC="`cat ${PARTDIR}/${PART} | cut -d '#' -f 3`" 78 PARTLABEL="`cat ${PARTDIR}/${PART} | cut -d '#' -f 4`" |
79 80 if [ "${PARTENC}" = "ON" ] 81 then 82 EXT=".eli" 83 else 84 EXT="" 85 fi 86 --- 76 unchanged lines hidden (view full) --- 163 164 # Lets read our partition list, and unmount each 165 ################################################################## 166 if [ -d "${PARTDIR}" ] 167 then 168 for PART in `ls ${PARTDIR}` 169 do 170 PARTDEV=`echo $PART | sed 's|-|/|g'` |
171 PARTFS="`cat ${PARTDIR}/${PART} | cut -d '#' -f 1`" 172 PARTMNT="`cat ${PARTDIR}/${PART} | cut -d '#' -f 2`" 173 PARTENC="`cat ${PARTDIR}/${PART} | cut -d '#' -f 3`" |
174 175 if [ "${PARTFS}" = "SWAP" ] 176 then 177 if [ "${PARTENC}" = "ON" ] 178 then 179 swapoff ${PARTDEV}.eli >/dev/null 2>/dev/null 180 else 181 swapoff ${PARTDEV} >/dev/null 2>/dev/null --- 29 unchanged lines hidden --- |