-
Notifications
You must be signed in to change notification settings - Fork 1
/
remount.sh
63 lines (52 loc) · 1.01 KB
/
remount.sh
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
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
# ./remount.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 "remounting $profile partition of type $fs_type"
case "$fs_type" in
ext4)
set -x
umount $mntpnt
mount -t ext4 $partition $mntpnt
;;
xfs)
set -x
umount $mntpnt
mount -t xfs $partition $mntpnt
;;
btrfs)
set -x
umount $mntpnt
mount -t btrfs $partition $mntpnt
;;
zfs)
set -x
zfs unmount $mntpnt
zpool export $datastore
zpool import $datastore
zfs mount -a
;;
f2fs)
set -x
umount $mntpnt
mount -t f2fs $partition $mntpnt
;;
ftfs)
set -x
umount $mntpnt
rmmod $module
losetup -d /dev/loop0
losetup $dummy_dev $DIR/$dummy_file
modprobe zlib
insmod $module sb_dev=$partition sb_fstype=ext4
mount -t ftfs $dummy_dev $mntpnt -o max=$circle_size
;;
*)
echo "Unknown filesystem type $fs_type"
exit 1
;;
esac