ansitest/proxmox/proxmox-create-zfs-boot-disk-partitions.sh
2024-06-11 13:48:19 -06:00

38 lines
956 B
Bash

#!/bin/bash
# NOTE I TAKE NO RESPONSIBILITY FOR DATA LOSS, EDIT THIS SCRIPT BEFORE RUNNING
# AND MAKE SURE YOU DESIGNATE THE RIGHT DISKS!
# REF: https://www.reddit.com/r/Proxmox/comments/1cr6wn7/tutorial_howto_migrate_a_pve_zfs_bootroot_mirror/
# TODO EDITME
for disk in vdc vdd; do
echo $disk
sgdisk -g \
-n 1:0:+1M \
-n 2:0:+1G \
-n 3:0:0 \
-t 1:8300 \
-t 2:EF00 \
-t 3:BF01 \
-p /dev/$disk
gdisk -l /dev/$disk
done
exit;
Device Start End Sectors Size Type
/dev/nvme0n1p1 34 2047 2014 1007K BIOS boot
/dev/nvme0n1p2 2048 2099199 2097152 1G EFI System
/dev/nvme0n1p3 2099200 167772160 165672961 119G ZFS
# REFs:
https://forum.proxmox.com/threads/replace-512gb-ssds-with-500gb-ssds.143077/
https://pve.proxmox.com/wiki/ZFS_on_Linux#sysadmin_zfs_change_failed_dev
https://pve.proxmox.com/wiki/Host_Bootloader#sysboot_proxmox_boot_tool
https://forum.proxmox.com/threads/fixing-uefi-boot.87719/