-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathunmount.sh
More file actions
53 lines (42 loc) · 686 Bytes
/
unmount.sh
File metadata and controls
53 lines (42 loc) · 686 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
# ./unmount.sh target
# target is the name of a test partition profile in config.sh
# generally this means "clean" or "aged"
DIR="${BASH_SOURCE%/*}"
if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi
profile=$1
. "$DIR/config.sh"
echo "unmounting $profile partition of type $fs_type"
case "$fs_type" in
ext4)
set -x
umount $mntpnt
;;
xfs)
set -x
umount $mntpnt
;;
btrfs)
set -x
umount $mntpnt
;;
zfs)
set -x
zfs unmount $mntpnt
zpool export $datastore
;;
f2fs)
set -x
umount $mntpnt
;;
ftfs)
set -x
umount $mntpnt
rmmod $module
losetup -d /dev/loop0
;;
*)
echo "Unknown filesystem type $fs_type"
exit 1
;;
esac