OCI Rescue
無法開機 發現OCI機器連不上,登入Cloud Shell後,只看到 這台機器是用了netboot.xyz重新安裝為Debian 12 上次收到通知 Oracle Cloud Infrastructure Compute - Reboot Scheduled for Virtual Machine Instance 告知會移機 這次重開機之後就連不上線了 解決方法 進入Cloud Shell後,會停在上面的畫面 在Shell> 下輸入 FS0: EFI\debian\shimaa64.efi 即可順利開機 修正EFI 進系統後,看一下目前的設定 sudo efibootmgr -v BootOrder: 0002,0000,0001,0004 Boot0000* UiApp FvVol Boot0001* UEFI Misc Device Boot0002* UEFI ORACLE BlockVolume Boot0004* EFI Internal Shell Debian 開機選項不見了 再次安裝回去 sudo grub-install --target=arm64-efi --efi-directory=/boot/efi --bootloader-id=debian --recheck sudo update-grub 確認正確 $ sudo efibootmgr -v BootCurrent: 0003 Timeout: 0 seconds BootOrder: 0003,0002,0000,0001,0004 Boot0000* UiApp FvVol Boot0001* UEFI Misc Device Boot0002* UEFI ORACLE BlockVolume Boot0003* debian HD(1,GPT)/File(\EFI\debian\shimaa64.efi) Boot0004* EFI Internal Shell 收工。 ...
Metro by T-Mobile
APN設定 名稱 T-Mobile APN APN fast.t-mobile.com 代理伺服器 未設定 連接埠 未設定 使用者名稱 未設定 密碼 未設定 伺服器 未設定 MMSC http://metropcs.mmsmvno.com/mms/wapenc MMS Proxy 未設定 MMS Port 未設定 MCC 310 MNC 260 驗證類型 PAP APN 類型 default,supl,mms,xcap,dun APN 協定 IPv4 APN 漫遊協定 IPv4 承載者 未指定 MVNO type GID MVNO value 6D38
WireGuard on Oracle Cloud Free Tier
申請 原本上網都是利用Cloudflare提供的Warp+/Zero Trust稍微保護一下, 但是由於某些網站限制地區內容觀看,Warp只是隱藏IP,地區還是無解。 試著用了幾個VPN服務,影音播放還是被擋,只好自己弄一個。 Oracle很早以前就提供了Cloud Free Tier,有AMD跟ARM機器。 AMD的是VM.Standard.E2.1.Micro: 免費兩臺各1CPU & 1GB Ram; ARM的是VM.Standard.A1.Flex: 最多 4CPU & 24GB Ram。 弄好AMD機器後,發現速度感人 只好選擇ARM機器。 ARM 創建ARM,選VM.Standard.A1.Flex 最多可選到4核&24GB Ram Wireguard 機器跑起來後,登入系統,我選的是ubuntu 22.04。 安裝 sudo apt update sudo apt install wireguard 產生密鑰 sudo -i cd /etc/wireguard/ wg genkey | tee server.key | wg pubkey > server.pub # 產生server密鑰 wg genkey | tee client1.key | wg pubkey > client1.pub # 產生client1密鑰 wg genkey | tee client2.key | wg pubkey > client2.pub # 產生client2密鑰 設定伺服器 編輯/etc/wireguard/wg0.conf ...
FreeBSD Bhyve
準備工作 vm-bhyve $ pkg install vm-bhyve-devel uefi-edk2-bhyve-csm bhyve-firmware vm pool $ zfs create -o mountpoint=/vm zroot/vm /etc/rc.conf vm_enable="YES" vm_dir="zfs:zroot/vm" vm_list="" #開機自動啟動的VM vm_delay=3 /boot/loader.conf #PCI Passtrough vmm_load="YES" #pptdevs="3/0/0 3/0/1" #GPU Passthrough init $ vm init 網路 $ vm switch create public $ vm switch add public 網卡代號 安裝VM ISO位置 $ vm iso ISO位置 $ vm iso DATASTORE FILENAME default Win11_23H2_English_x64v2.iso default windows.iso 設定檔 範例在 /usr/local/share/examples/vm-bhyve 裡,選擇要安裝的系統, 複製一份到 /vm/.templates/ 下 修改設定檔 以Windows為例 # If you want to pull a graphical console, you'll need the UEFI loader, # no matter what OS you're installing on the guest. loader="uefi" graphics="yes" xhci_mouse="yes" # If not specified, cpu=n will give the guest n discrete CPU sockets. # This is generally OK for Linux or BSD guests, but Windows throws a fit # due to licensing issues, so we specify CPU topology manually here. cpu=8 cpu_sockets=2 cpu_cores=4 cpu_threads=1 # Remember, a guest doesn’t need extra RAM for filesystem caching-- # the host handles that for it. 4G is ludicrously low for Windows on hardware, # but it’s generally more than sufficient for a guest. memory=8G # put up to 8 disks on a single ahci controller. This avoids the creation of # a new “controller” on a new “PCIe slot” for each drive added to the guest. ahci_device_limit="8" # e1000 works out-of-the-box, but virtio-net performs better. Virtio support # is built in on FreeBSD and Linux guests, but Windows guests will need # to have virtio drivers manually installed. #network0_type="e1000" network0_type="virtio-net" network0_switch="public" # bhyve/nvme storage is considerably faster than bhyve/virtio-blk # storage in my testing, on Windows, Linux, and FreeBSD guests alike. disk0_type="nvme" disk0_name="disk0.img" # This gives the guest a virtual "optical" drive. Specifying disk1_dev=”custom” # allows us to provide a full path to the ISO. disk1_type="ahci-cd" disk1_dev="custom" disk1_name="/vm/virtio-win.iso" # windows expects the host to expose localtime by default, not UTC utctime="no" graphics_port="5900" graphics_listen="本機地址 x.x.x.x" graphics_res="1024x768" graphics_wait="yes" vnc_password="123456" 其中網路卡設定為virtio-net,這樣安裝Windows過程中就不會要求登入M$帳戶, ...
Freebsd Graphics
支援顯卡 參考FreeBSD官網支援列表 https://wiki.freebsd.org/Graphics/AMD-GPU-Matrix 如果FreeBSD 13+ 安裝 drm-510-kmod,FreeBSD 14+ 安裝 drm-515-kmod 在rc.conf 加上 kld_list="radeonkms" ##amd舊顯卡,參考官網列表 Firmware 手動載入後,發現錯誤 [drm] radeon kernel modesetting enabled. drmn0: <drmn> on vgapci0 vgapci0: child drmn0 requested pci_enable_io vgapci0: child drmn0 requested pci_enable_io sysctl_warn_reuse: can't re-use a leaf (hw.dri.debug)! [drm] initializing kernel modesetting (CAICOS 0x1002:0x6779 0x1642:0x3A75 0x00). [drm ERROR :radeon_atombios_init] Unable to find PCI I/O BAR; using MMIO for ATOM IIO ATOM BIOS: C26402 drmn0: VRAM: 1024M 0x0000000000000000 - 0x000000003FFFFFFF (1024M used) drmn0: GTT: 1024M 0x0000000040000000 - 0x000000007FFFFFFF [drm] Detected VRAM RAM=1024M, BAR=256M [drm] RAM width 64bits DDR [drm] radeon: 1024M of VRAM memory ready [drm] radeon: 1024M of GTT memory ready. [drm] Loading CAICOS Microcode drmn0: could not load firmware image 'radeon/CAICOS_pfp.bin' ni_cp: Failed to load firmware "radeon/CAICOS_pfp.bin" [drm ERROR :evergreen_init] Failed to load firmware! drmn0: Fatal error during GPU init [drm] radeon: finishing device. [drm] radeon: ttm finalized Warning: can't remove non-dynamic nodes (dri)! device_attach: drmn0 attach returned 2 安裝firmware ...
FreeBSD Make World
Update src tree git clone https://git.freebsd.org/src.git /usr/src git checkout releng/x.x 查看可用Branch git branch -r 更新 git pull git status 記錄一下更新所需時間 FreeBSD 13.2-RELEASE releng/13.2-525ecfdad Welcome to FreeBSD! ``` ` ` `.....---.......--.``` -/ ------- +o .--` /y:` +. OS: FreeBSD 13.2-RELEASE amd64 yo`:. :o `+- Uptime: 1 day, 29 mins y/ -/` -o/ Packages: 187 (pkg) .- ::/sy+:. Terminal: /dev/pts/0 / `-- / CPU: Intel Xeon E5-2690 v4 (28) @ 2.594GHz [32.0°C] `: :` GPU: Caicos [Radeon HD 6450/7450/8450 / R5 230 OEM] `: :` Memory: 35.44GiB / 63.88GiB / / CPU Usage: 99% .- -. Disk (/): 12G / 880G (1%) -- -. Disk (/tank/share): 13T / 21T (63%) `:` `:` .-- `--. .---.....----. Build World make -j28 buildworld --- buildworld_epilogue --- -------------------------------------------------------------- >>> World build completed on Sat Dec 23 13:20:12 EST 2023 >>> World built in 1405 seconds, ncpu: 28, make -j28 -------------------------------------------------------------- Build Kernel KERNCONF=GENERIC Z440 in make.conf ...
ZFS Resilver
記錄一下 ZFS RAIDZ1 Resilvering 時間 RAIDZ1: 4x8TB,使用量約70% ╭─────────────┬────────┬────────┬────────┬───────────────────────────────┬──────╮ │ MOUNTED ON │ SIZE │ USED │ AVAIL │ USE% │ TYPE │ ├─────────────┼────────┼────────┼────────┼───────────────────────────────┼──────┤ │ /tank │ 6.3T │ 139.5K │ 6.3T │ [....................] 0.0% │ zfs │ │ /tank/share │ 21.0T │ 14.7T │ 6.3T │ [#############.......] 69.9% │ zfs │ ╰─────────────┴────────┴────────┴────────┴───────────────────────────────┴──────╯ 換上新硬碟,直接裝上原位置 zpool replace tank 硬碟代號 最後總共跑了一週 $ zpool status pool: tank state: ONLINE scan: resilvered 4.82T in 6 days 06:16:12 with 0 errors on Wed Jun 21 15:14:42 2023 config: NAME STATE READ WRITE CKSUM tank ONLINE 0 0 0 raidz1-0 ONLINE 0 0 0 ada0 ONLINE 0 0 0 ada1 ONLINE 0 0 0 ada2 ONLINE 0 0 0 ada3 ONLINE 0 0 0 Zpool Scrub 時間 $ zpool status tank pool: tank state: ONLINE scan: scrub repaired 0B in 09:25:12 with 0 errors on Fri Jun 23 18:44:21 2023 config: NAME STATE READ WRITE CKSUM tank ONLINE 0 0 0 raidz1-0 ONLINE 0 0 0 ada0 ONLINE 0 0 0 ada1 ONLINE 0 0 0 ada2 ONLINE 0 0 0 ada3 ONLINE 0 0 0 結論 如果不是對容量有特別需求 ...
FreeBSD Migrate to New Disk
安裝新系統 利用FreeBSD安裝程式安裝系統到新硬碟,安裝時命名zroot為zroot2(或其他名字) zfs export 新系統開機後 zpool export zroot2 關機 zfs import 接上舊硬碟,選擇用舊硬碟開機 zpool import -f zroot2 zfs snapshot -r zroot@123456隨便你 zfs send -R zroot@123 | zfs recv -F zroot2 關機 reboot 用新硬碟開機 swap 記得去改/etc/fstab中的swap disk # Device Mountpoint FStype Options Dump Pass# /dev/gpt/efiboot0 /boot/efi msdosfs rw 2 2 /dev/新硬碟代號p3 none swap sw 0 0