-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUninstallZfs.sh
executable file
·219 lines (205 loc) · 6.71 KB
/
UninstallZfs.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
#!/bin/bash
set +e
date -j -f "%a %b %d %T %Z %Y" "`date`" "+%s" >> /tmp/o3x.log
echo $0 >> /tmp/o3x.log
pkgutil --pkgs | grep net.lundman.openzfs |\
while read apkg
do
for i in {1..2}
do
pkgutil --lsbom "$apkg" | sed -E 's/^\.//' |\
while read e
do
if [ -f "$e" ] ; then
rm "$e"
elif [ -d "$e" ] ; then
rmdir -p "$e"
elif [ -L "$e" ] ; then
rm "$e"
fi
done
done
pkgutil --forget "$apkg"
done
rm -rfv /Library/OpenZFSonOSX
rm -rfv /Library/Extensions/spl.kext
rm -rfv /System/Library/Extensions/spl.kext
rm -rfv /usr/src/spl-*
rm -rfv /Library/Extensions/zfs.kext
rm -rfv /System/Library/Extensions/zfs.kext
rm -rfv /usr/src/zfs-*
rm -rfv /usr/lib/modules-load.d
rm -rfv /usr/lib/systemd
rm -rfv /usr/local/etc/init.d
rm -rfv /etc/init.d
rm -rfv /usr/local/etc/zfs
rm -rfv /usr/local/include/libspl
rm -rfv /usr/local/include/libzfs
rm -rfv /usr/include/libspl
rm -rfv /usr/include/libzfs
rm -rfv /usr/local/lib/dracut
rm -rfv /usr/lib/dracut
rm -rfv /usr/local/lib/udev
rm -rfv /usr/lib/udev
rm -rfv /usr/local/share/zfs
rm -rfv /usr/share/zfs
rm -rfv /usr/local/libexec/zfs
rm -rfv /usr/libexec/zfs
rm -fv /usr/local/share/man/man1/zhack.1
rm -fv /usr/local/share/man/man1/zpios.1
rm -fv /usr/local/share/man/man1/ztest.1
rm -fv /usr/local/share/man/man5/vdev_id.conf.5
rm -fv /usr/local/share/man/man5/zfs-module-parameters.5
rm -fv /usr/local/share/man/man5/zpool-features.5
rm -fv /usr/local/share/man/man8/fsck.zfs.8
rm -fv /usr/local/share/man/man8/mount.zfs.8
rm -fv /usr/local/share/man/man8/vdev_id.8
rm -fv /usr/local/share/man/man8/zdb.8
rm -fv /usr/local/share/man/man8/zfs.8
rm -fv /usr/local/share/man/man8/zinject.8
rm -fv /usr/local/share/man/man8/zpool.8
rm -fv /usr/local/share/man/man8/zstreamdump.8
rm -fv /usr/share/man/man1/zhack.1
rm -fv /usr/share/man/man1/zpios.1
rm -fv /usr/share/man/man1/ztest.1
rm -fv /usr/share/man/man5/vdev_id.conf.5
rm -fv /usr/share/man/man5/zfs-module-parameters.5
rm -fv /usr/share/man/man5/zpool-features.5
rm -fv /usr/share/man/man8/fsck.zfs.8
rm -fv /usr/share/man/man8/mount.zfs.8
rm -fv /usr/share/man/man8/vdev_id.8
rm -fv /usr/share/man/man8/zdb.8
rm -fv /usr/share/man/man8/zed.8
rm -fv /usr/share/man/man8/zfs.8
rm -fv /usr/share/man/man8/zinject.8
rm -fv /usr/share/man/man8/zpool.8
rm -fv /usr/share/man/man8/zstreamdump.8
rm -fv /usr/local/lib/libnvpair.1.dylib
rm -fv /usr/local/lib/libnvpair.a
rm -fv /usr/local/lib/libnvpair.dylib
rm -fv /usr/local/lib/libnvpair.la
rm -fv /usr/local/lib/libuutil.1.dylib
rm -fv /usr/local/lib/libuutil.a
rm -fv /usr/local/lib/libuutil.dylib
rm -fv /usr/local/lib/libuutil.la
rm -fv /usr/local/lib/libzfs.2.dylib
rm -fv /usr/local/lib/libzfs.a
rm -fv /usr/local/lib/libzfs.dylib
rm -fv /usr/local/lib/libzfs.la
rm -fv /usr/local/lib/libzfs_core.1.dylib
rm -fv /usr/local/lib/libzfs_core.a
rm -fv /usr/local/lib/libzfs_core.dylib
rm -fv /usr/local/lib/libzfs_core.la
rm -fv /usr/local/lib/libzpool.1.dylib
rm -fv /usr/local/lib/libzpool.a
rm -fv /usr/local/lib/libzpool.dylib
rm -fv /usr/local/lib/libzpool.la
rm -fv /usr/lib/libnvpair.1.dylib
rm -fv /usr/lib/libnvpair.a
rm -fv /usr/lib/libnvpair.dylib
rm -fv /usr/lib/libnvpair.la
rm -fv /usr/lib/libuutil.1.dylib
rm -fv /usr/lib/libuutil.a
rm -fv /usr/lib/libuutil.dylib
rm -fv /usr/lib/libuutil.la
rm -fv /usr/lib/libzfs.2.dylib
rm -fv /usr/lib/libzfs.a
rm -fv /usr/lib/libzfs.dylib
rm -fv /usr/lib/libzfs.la
rm -fv /usr/lib/libzfs_core.1.dylib
rm -fv /usr/lib/libzfs_core.a
rm -fv /usr/lib/libzfs_core.dylib
rm -fv /usr/lib/libzfs_core.la
rm -fv /usr/lib/libzpool.1.dylib
rm -fv /usr/lib/libzpool.a
rm -fv /usr/lib/libzpool.dylib
rm -fv /usr/lib/libzpool.la
rm -fv /usr/local/bin/arcstat.pl
rm -fv /usr/local/bin/InvariantDisks
rm -fv /usr/local/bin/zdb
rm -fv /usr/local/bin/zdb_static
rm -fv /usr/local/bin/zed
rm -fv /usr/local/bin/zfs
rm -fv /usr/local/bin/zhack
rm -fv /usr/local/bin/zinject
rm -fv /usr/local/bin/zpios
rm -fv /usr/local/bin/zpool
rm -fv /usr/local/bin/zstreamdump
rm -fv /usr/local/bin/ztest
rm -fv /usr/local/bin/ztest_static
rm -fv /usr/local/sbin/InvariantDisks
rm -fv /usr/local/sbin/zdb
rm -fv /usr/local/sbin/zdb_static
rm -fv /usr/local/sbin/zed
rm -fv /usr/local/sbin/zfs
rm -fv /usr/local/sbin/zhack
rm -fv /usr/local/sbin/zinject
rm -fv /usr/local/sbin/zpios
rm -fv /usr/local/sbin/zpool
rm -fv /usr/local/sbin/zstreamdump
rm -fv /usr/local/sbin/ztest
rm -fv /usr/local/sbin/ztest_static
rm -fv /usr/bin/arcstat.pl
rm -fv /usr/sbin/InvariantDisks
rm -fv /usr/sbin/zdb
rm -fv /usr/sbin/zdb_static
rm -fv /usr/sbin/zed
rm -fv /usr/sbin/zfs
rm -fv /usr/sbin/zhack
rm -fv /usr/sbin/zinject
rm -fv /usr/sbin/zpios
rm -fv /usr/sbin/zpool
rm -fv /usr/sbin/zstreamdump
rm -fv /usr/sbin/ztest
rm -fv /usr/sbin/ztest_static
rm -fv /sbin/mount.zfs
rm -fv /sbin/mount_zfs
rm -fv /sbin/umount_zfs
rm -fv /usr/local/bin/mount.zfs
rm -fv /usr/local/bin/mount_zfs
rm -fv /usr/local/bin/umount_zfs
rm -fv /usr/local/sbin/mount.zfs
rm -fv /usr/local/sbin/mount_zfs
rm -fv /usr/local/sbin/umount_zfs
rm -fv /etc/zfs/zpool.cache
rm -fv /etc/zfs/zpool.cache.tmp
rm -fv /etc/zfs/vdev_id.conf.alias.example
rm -fv /etc/zfs/vdev_id.conf.multipath.example
rm -fv /etc/zfs/vdev_id.conf.sas_direct.example
rm -fv /etc/zfs/vdev_id.conf.sas_switch.example
rm -fv /etc/zfs/zsysctl.conf.example
rm -fv /etc/zfs/zed.d/checksum-email.sh
rm -fv /etc/zfs/zed.d/data-email.sh
rm -fv /etc/zfs/zed.d/generic-email.sh
rm -fv /etc/zfs/zed.d/io-email.sh
rm -fv /etc/zfs/zed.d/resilver.finish-email.sh
rm -fv /etc/zfs/zed.d/scrub.finish-email.sh
rm -fv /etc/zfs/zed.d/all-debug.sh
rm -fv /etc/zfs/zed.d/all-syslog.sh
rm -fv /etc/zfs/zed.d/checksum-notify.sh
rm -fv /etc/zfs/zed.d/checksum-spare.sh
rm -fv /etc/zfs/zed.d/config.remove.sh
rm -fv /etc/zfs/zed.d/config.sync.sh
rm -fv /etc/zfs/zed.d/data-notify.sh
rm -fv /etc/zfs/zed.d/generic-notify.sh
rm -fv /etc/zfs/zed.d/io-notify.sh
rm -fv /etc/zfs/zed.d/io-spare.sh
rm -fv /etc/zfs/zed.d/resilver.finish-notify.sh
rm -fv /etc/zfs/zed.d/scrub.finish-notify.sh
rm -fv /etc/zfs/zed.d/snapshot.mount.sh
rm -fv /etc/zfs/zed.d/zed.rc
rm -fv /etc/zfs/zed.d/zpool.destroy.sh
rm -fv /etc/zfs/zed.d/zpool.import.sh
rm -fv /etc/zfs/zed.d/zvol.create.sh
rm -fv /etc/zfs/zed.d/zvol.remove.sh
rm -fv /Library/LaunchDaemons/org.openzfsonosx.InvariantDisks.plist
rm -fv /Library/LaunchDaemons/org.openzfsonosx.zconfigd.plist
rm -fv /Library/LaunchDaemons/org.openzfsonosx.zed.plist
rm -fv /Library/LaunchDaemons/org.openzfsonosx.zed.service.plist
rm -fv /Library/LaunchDaemons/org.openzfsonosx.zpool-autoimport.plist
rm -fv /Library/LaunchDaemons/org.openzfsonosx.zpool-import-all.plist
rm -rfv /Library/Filesystems/zfs.fs
rm -rfv /System/Library/Filesystems/zfs.fs
[ -d /etc/zfs/zed.d ] && [ $(ls -A /etc/zfs/zed.d | wc -l) -eq 0 ] && rmdir /etc/zfs/zed.d
[ -d /etc/zfs ] && [ $(ls -A /etc/zfs | wc -l) -eq 0 ] && rmdir /etc/zfs
exit 0