From 5677d4df0b46d9f70a49052439a869deb3af104d Mon Sep 17 00:00:00 2001 From: kneutron <50146127+kneutron@users.noreply.github.com> Date: Wed, 27 Nov 2024 13:12:41 -0700 Subject: [PATCH] Add files via upload --- OSX/freshinstall-mac.sh | 14 +++++ OSX/freshinstall-macports.sh | 23 +++++++ OSX/macos-download-monterey-installer.sh | 17 ++++++ OSX/mk-monterey-install-media.sh | 20 +++++++ OSX/osx-delete-apfs-snapshots.sh | 15 +++++ OSX/zpool-copy-2-nclisten.sh | 47 +++++++++++++++ OSX/zpool-copy.sh | 43 +++++++++++++ OSX/zpool-create-dual-boot-compatible-v207.sh | 60 +++++++++++++++++++ 8 files changed, 239 insertions(+) create mode 100644 OSX/freshinstall-mac.sh create mode 100644 OSX/freshinstall-macports.sh create mode 100644 OSX/macos-download-monterey-installer.sh create mode 100644 OSX/mk-monterey-install-media.sh create mode 100644 OSX/osx-delete-apfs-snapshots.sh create mode 100644 OSX/zpool-copy-2-nclisten.sh create mode 100644 OSX/zpool-copy.sh create mode 100644 OSX/zpool-create-dual-boot-compatible-v207.sh diff --git a/OSX/freshinstall-mac.sh b/OSX/freshinstall-mac.sh new file mode 100644 index 0000000..faece20 --- /dev/null +++ b/OSX/freshinstall-mac.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# /opt/local/bin/bash + +port-install.sh -N bash bwm-ng sysstat joe +#port-install.sh -N mc +sftp + +port-install.sh -N grsync xaos md5sha1sum openjdk11 mutt mediainfo geeqie \ + putty shellcheck gawk jc jq sxiv unison lf inetutils nomacs kitty \ + tmux byobu html2text flock gptfdisk gsed pv watch parallel findutils \ + nmap imagemagick buffer lame veracrypt git rclone mediainfo + +# TODO ntp +# ristretto build fail 2023.0321 +# atom no longer avail diff --git a/OSX/freshinstall-macports.sh b/OSX/freshinstall-macports.sh new file mode 100644 index 0000000..df2d2a5 --- /dev/null +++ b/OSX/freshinstall-macports.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +# no usrlocalbin - that 4 brew +PATH=/var/root/bin:/var/root/bin/boojum:/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:/opt/local/bin: + +# avoid conflicts/errs with brewstuff +mv -v /usr/local/include /usr/local/notinclude + +# no lsof; hfstar build failed +port -N install autossh bash bwm-ng bzip2 cmatrix coreutils curl detox ffmpeg flock gnutar gptfdisk grsync \ + gsmartcontrol gstreamer1 htop iftop imagemagick iperf3 joe lame lftp lz4 lzma lzo2 lzop nmap p7zip \ + parallel pidof pigz pstree pv smartmontools ssh-copy-id sshfs util-linux watch youtube-dl yt-dlp \ + wget zstd + +#port uninstall mc +#port clean mc +#port install mc +sftp + +[ -e /usr/local/notinclude ] && mv -v /usr/local/notinclude /usr/local/include + +date + +exit; diff --git a/OSX/macos-download-monterey-installer.sh b/OSX/macos-download-monterey-installer.sh new file mode 100644 index 0000000..433b011 --- /dev/null +++ b/OSX/macos-download-monterey-installer.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# REF: https://discussions.apple.com/thread/255859460?sortBy=rank +# https://www.macworld.com/article/673697/what-version-of-macos-can-my-mac-run.html + +cd ~/Downloads + +softwareupdate --list-full-installers + +echo "Enter version" +read instversion + +[ "$instversion" = "" ] && exit 99; + +# As of Nov 25, 2024 - Monterey +time softwareupdate -d --fetch-full-installer --full-installer-version $instversion # 12.7.6 +date diff --git a/OSX/mk-monterey-install-media.sh b/OSX/mk-monterey-install-media.sh new file mode 100644 index 0000000..476dd03 --- /dev/null +++ b/OSX/mk-monterey-install-media.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +# Make bootable MacOS / OSX 12.7 install media +# REF: https://krypted.com/mac-os-x/create-bootable-installation-media-high-sierra-installations/ +# REF: https://osxdaily.com/2022/02/23/make-macos-monterey-boot-install-drive/ + +# NOTE usb media must be pre-erased and mounted at /Volumes/macosinstall +# Use Disk Utility, Erase, Mac OS Extended Journaled, GUID partition +# NOTE monterey needs 16GB + +source ~/bin/failexit.mrg + +[ $(df |grep -c /Volumes/macosinstall) -gt 0 ] || failexit 40 "/Volumes/macosinstall not mounted/found - need to have pre-formatted USB mounted" + +#cd ~/Downloads && \ +set -x +cd /Volumes/Monterey-Latest-App && \ +cd "Install macOS Monterey.app" && \ +Contents/Resources/createinstallmedia \ + --volume /Volumes/macosinstall --nointeraction diff --git a/OSX/osx-delete-apfs-snapshots.sh b/OSX/osx-delete-apfs-snapshots.sh new file mode 100644 index 0000000..62498f6 --- /dev/null +++ b/OSX/osx-delete-apfs-snapshots.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +tmutil listlocalsnapshots /Volumes/iscsi-macosmont12-davemacpro\ -\ Data + +echo "SEE SOURCE" +exit; + +# REF: https://www.google.com/search?q=monterey+delete+apfs+snapshot+commandline&num=10&sca_esv=fb0328165e44674a&rlz=1C5CHFA_enUS1050US1082&sxsrf=ADLYWIInlgRBKpZsnFqWtPdDbIPHgIviyw%3A1732216760856&ei=uIc_Z_z2M-Tfp84P5I6d0As&ved=0ahUKEwj8stGlku6JAxXk78kDHWRHB7oQ4dUDCBA&uact=5&oq=monterey+delete+apfs+snapshot+commandline&gs_lp=Egxnd3Mtd2l6LXNlcnAiKW1vbnRlcmV5IGRlbGV0ZSBhcGZzIHNuYXBzaG90IGNvbW1hbmRsaW5lMgcQIRigARgKMgcQIRigARgKMgcQIRigARgKMgcQIRigARgKMgcQIRigARgKSNcSULADWK8RcAF4AZABAZgBzAKgAfANqgEIMC4xMS4wLjG4AQPIAQD4AQGYAgygAugMwgIKEAAYsAMY1gQYR8ICBRAhGKABwgIFECEYqwLCAgUQIRifBcICBxAjGLACGCfCAggQABiABBiiBMICCBAAGKIEGIkFmAMAiAYBkAYIkgcIMS4xMC4wLjGgB4JC&sclient=gws-wiz-serp + + tmutil listlocalsnapshots +tmutil deletelocalsnapshots /Volumes/iscsi-macosmont12-davemacpro\ -\ Data 2024-10-08-181025 + tmutil deletelocalsnapshots /Volumes/iscsi-macosmont12-davemacpro\ -\ Data + tmutil deletelocalsnapshots /Volumes/iscsi-macosmont12-davemacpro + tmutil listlocalsnapshots /Volumes/iscsi-macosmont12-davemacpro\ -\ Data + tmutil deletelocalsnapshots 2024-10-08-181025 diff --git a/OSX/zpool-copy-2-nclisten.sh b/OSX/zpool-copy-2-nclisten.sh new file mode 100644 index 0000000..c481b17 --- /dev/null +++ b/OSX/zpool-copy-2-nclisten.sh @@ -0,0 +1,47 @@ +#!/bin/bash + +# copy 1 zpool/datasets to another destination pool+dataset + +# TODO editme if you have an @NOW snap +zsnap=zintmacpro2@Sat +dest=zsgtera6bkp +destip=10.9.12.12 + +#(HOST) + time zfs send -L -R -e $zsnap \ + |pv -t -r -b -W -i 2 -B 250M \ + |nc -w 10 $destip 32100 + +date +# |zfs recv -Fev $dest; date +# |zfs recv -Fevn $dest; date +#(VM/dest) +# TODO Remove the "n" for live xmit! Otherwise test run - can ^C after ~10 sec! + +# |zfs recv -evn $dest; date +# time nc -l -p 32100 |zfs recv -Fev zhome/home; date + +exit; + +NOTE the below results in: + +zhgstsas4 zfs 2.9T 128K 2.9T 1% /zhgstsas4 +zhgstsas4/shrcompr zfs 3.0T 101G 2.9T 4% /zhgstsas4/shrcompr +zhgstsas4/notshrnotcompr zfs 2.9T 128K 2.9T 1% /zhgstsas4/notshrnotcompr +zhgstsas4/notshrcompr zfs 2.9T 128K 2.9T 1% /zhgstsas4/notshrcompr +zhgstsas4/NEVERLOSE-notshrcompr zfs 2.9T 291M 2.9T 1% /zhgstsas4/NEVERLOSE-notshrcompr +zhgstsas4/BURNME-shrcompr zfs 3.5T 622G 2.9T 18% /zhgstsas4/BURNME-shrcompr +zwd6t/zhgstsas4 zfs 4.4T 128K 4.4T 1% /zwd6t/zhgstsas4 +zwd6t/zhgstsas4/BURNME-shrcompr zfs 5.0T 622G 4.4T 13% /zwd6t/zhgstsas4/BURNME-shrcompr +zwd6t/zhgstsas4/NEVERLOSE-notshrcompr zfs 4.4T 291M 4.4T 1% /zwd6t/zhgstsas4/NEVERLOSE-notshrcompr +zwd6t/zhgstsas4/notshrcompr zfs 4.4T 128K 4.4T 1% /zwd6t/zhgstsas4/notshrcompr +zwd6t/zhgstsas4/notshrnotcompr zfs 4.4T 128K 4.4T 1% /zwd6t/zhgstsas4/notshrnotcompr +zwd6t/zhgstsas4/shrcompr zfs 4.5T 101G 4.4T 3% /zwd6t/zhgstsas4/shrcompr + +zsnap=zhgstsas4@Sat +dest=zwd6t + +#(HOST) + time zfs send -L -R -e $zsnap \ + |zfs recv -Fev $dest; date + \ No newline at end of file diff --git a/OSX/zpool-copy.sh b/OSX/zpool-copy.sh new file mode 100644 index 0000000..e042725 --- /dev/null +++ b/OSX/zpool-copy.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +# copy 1 zpool/datasets to another destination pool+dataset + +# TODO editme if you have an @NOW snap +zsnap=zhgstsas4@Sat +dest=zwd6t + +#(HOST) + time zfs send -L -R -e $zsnap \ + |pv -t -r -b -W -i 2 -B 250M \ + |zfs recv -Fev $dest; date +# |zfs recv -Fevn $dest; date +#(VM/dest) +# TODO Remove the "n" for live xmit! Otherwise test run - can ^C after ~10 sec! + +# |zfs recv -evn $dest; date +# time nc -l -p 32100 |zfs recv -Fev zhome/home; date + +exit; + +NOTE the below results in: + +zhgstsas4 zfs 2.9T 128K 2.9T 1% /zhgstsas4 +zhgstsas4/shrcompr zfs 3.0T 101G 2.9T 4% /zhgstsas4/shrcompr +zhgstsas4/notshrnotcompr zfs 2.9T 128K 2.9T 1% /zhgstsas4/notshrnotcompr +zhgstsas4/notshrcompr zfs 2.9T 128K 2.9T 1% /zhgstsas4/notshrcompr +zhgstsas4/NEVERLOSE-notshrcompr zfs 2.9T 291M 2.9T 1% /zhgstsas4/NEVERLOSE-notshrcompr +zhgstsas4/BURNME-shrcompr zfs 3.5T 622G 2.9T 18% /zhgstsas4/BURNME-shrcompr +zwd6t/zhgstsas4 zfs 4.4T 128K 4.4T 1% /zwd6t/zhgstsas4 +zwd6t/zhgstsas4/BURNME-shrcompr zfs 5.0T 622G 4.4T 13% /zwd6t/zhgstsas4/BURNME-shrcompr +zwd6t/zhgstsas4/NEVERLOSE-notshrcompr zfs 4.4T 291M 4.4T 1% /zwd6t/zhgstsas4/NEVERLOSE-notshrcompr +zwd6t/zhgstsas4/notshrcompr zfs 4.4T 128K 4.4T 1% /zwd6t/zhgstsas4/notshrcompr +zwd6t/zhgstsas4/notshrnotcompr zfs 4.4T 128K 4.4T 1% /zwd6t/zhgstsas4/notshrnotcompr +zwd6t/zhgstsas4/shrcompr zfs 4.5T 101G 4.4T 3% /zwd6t/zhgstsas4/shrcompr + +zsnap=zhgstsas4@Sat +dest=zwd6t + +#(HOST) + time zfs send -L -R -e $zsnap \ + |zfs recv -Fev $dest; date + \ No newline at end of file diff --git a/OSX/zpool-create-dual-boot-compatible-v207.sh b/OSX/zpool-create-dual-boot-compatible-v207.sh new file mode 100644 index 0000000..a634c77 --- /dev/null +++ b/OSX/zpool-create-dual-boot-compatible-v207.sh @@ -0,0 +1,60 @@ +#!/bin/bash + +# create ZFS pool that should be cross-boot compatible with v.207 and import OK +# REF: https://openzfs.github.io/openzfs-docs/Basic%20Concepts/Feature%20Flags.html + +# EDITME! +# REF: https://www.reddit.com/r/zfs/comments/b092at/cant_import_pool_from_zol_to_bsd/ +# REF: https://zgrep.org/zfs.html # OLD zfs by-OS compat. chart +# REF ' man zpool-features ' - large_blocks needed for recordsize=1024k + +zp=zsamt72mp2 +diskk=/dev/disk2s6 # sdc # Linux - use dev/disk/by-id + +zpool create -f -d \ + -o feature@allocation_classes=enabled \ + -o feature@async_destroy=enabled \ + -o feature@bookmark_v2=enabled \ + -o feature@bookmark_written=enabled \ + -o feature@bookmarks=enabled \ + -o feature@device_rebuild=enabled \ + -o feature@device_removal=enabled \ + -o feature@edonr=enabled \ + -o feature@embedded_data=enabled \ + -o feature@empty_bpobj=enabled \ + -o feature@enabled_txg=enabled \ + -o feature@encryption=enabled \ + -o feature@extensible_dataset=enabled \ + -o feature@filesystem_limits=enabled \ + -o feature@hole_birth=enabled \ + -o feature@large_blocks=enabled \ + -o feature@large_dnode=enabled \ + -o feature@livelist=enabled \ + -o feature@log_spacemap=enabled \ + -o feature@lz4_compress=enabled \ + -o feature@multi_vdev_crash_dump=enabled \ + -o feature@obsolete_counts=enabled \ + -o feature@project_quota=enabled \ + -o feature@redacted_datasets=enabled \ + -o feature@redaction_bookmarks=enabled \ + -o feature@resilver_defer=enabled \ + -o feature@sha512=enabled \ + -o feature@skein=enabled \ + -o feature@spacemap_histogram=enabled \ + -o feature@spacemap_v2=enabled \ + -o feature@userobj_accounting=enabled \ + -o feature@zpool_checkpoint=enabled \ + -o feature@zstd_compress=enabled \ + -o ashift=12 -o autoexpand=on -o autoreplace=off \ + -O atime=off -O compression=zstd-3 $zp "$diskk" + + zfs-newds-zstd.sh 11 $zp shrcompr-$zp + zfs-newds-zstd.sh 10 $zp notshrcompr-$zp + +gdf -hT + + exit; + + +# Created by pasting into spreadsheet, grabbing 2.0.7=yes and deleting the NOs +# TODO alt.method https://vermaden.wordpress.com/2022/03/25/zfs-compatibility/