mirror of
https://github.com/tboerger/nixos-config
synced 2024-11-23 03:32:08 +01:00
chore: another tra to fix gpt partitioning
This commit is contained in:
parent
dd6a2d5bd5
commit
51a077a6d3
@ -40,16 +40,17 @@ if [[ -d /dev/md ]]; then
|
||||
fi
|
||||
|
||||
echo "----> Drop existing partitions"
|
||||
wipefs -a /dev/sda || true
|
||||
sfdisk --delete /dev/sda || true
|
||||
wipefs -a /dev/sdb || true
|
||||
sfdisk --delete /dev/sdb || true
|
||||
wipefs -a /dev/sdc || true
|
||||
sfdisk --delete /dev/sdc || true
|
||||
wipefs -a /dev/sdd || true
|
||||
sfdisk --delete /dev/sdd || true
|
||||
wipefs -a /dev/sde || true
|
||||
sfdisk --delete /dev/sde || true
|
||||
wipefs -a /dev/disk/by-path/pci-0000:00:14.1-ata-1 || true
|
||||
sfdisk --delete /dev/disk/by-path/pci-0000:00:14.1-ata-1 || true
|
||||
|
||||
sgdisk --zap-all /dev/disk/by-path/pci-0000:00:11.0-ata-1.0
|
||||
sgdisk -og /dev/disk/by-path/pci-0000:00:11.0-ata-1.0
|
||||
sgdisk --zap-all /dev/disk/by-path/pci-0000:00:11.0-ata-2.0
|
||||
sgdisk -og /dev/disk/by-path/pci-0000:00:11.0-ata-2.0
|
||||
sgdisk --zap-all /dev/disk/by-path/pci-0000:00:11.0-ata-3.0
|
||||
sgdisk -og /dev/disk/by-path/pci-0000:00:11.0-ata-3.0
|
||||
sgdisk --zap-all /dev/disk/by-path/pci-0000:00:11.0-ata-4.0
|
||||
sgdisk -og /dev/disk/by-path/pci-0000:00:11.0-ata-4.0
|
||||
|
||||
echo "-----> Wait for cleanup"
|
||||
sleep 3
|
||||
@ -58,12 +59,6 @@ sync
|
||||
echo "-----> Mark MBR disks"
|
||||
echo yes | parted /dev/disk/by-path/pci-0000:00:14.1-ata-1 -- mklabel msdos
|
||||
|
||||
echo "-----> Mark GPT disks"
|
||||
echo yes | parted /dev/disk/by-path/pci-0000:00:11.0-ata-1.0 -- mklabel gpt
|
||||
echo yes | parted /dev/disk/by-path/pci-0000:00:11.0-ata-2.0 -- mklabel gpt
|
||||
echo yes | parted /dev/disk/by-path/pci-0000:00:11.0-ata-3.0 -- mklabel gpt
|
||||
echo yes | parted /dev/disk/by-path/pci-0000:00:11.0-ata-4.0 -- mklabel gpt
|
||||
|
||||
echo "-----> Create boot partition"
|
||||
parted /dev/disk/by-path/pci-0000:00:14.1-ata-1 -- mkpart primary ext4 1MB 1GB
|
||||
parted /dev/disk/by-path/pci-0000:00:14.1-ata-1 -- set 1 boot on
|
||||
|
@ -33,16 +33,13 @@ for PV in $(pvs --noheadings 2>/dev/null | sed -e 's/^[[:space:]]*//' | cut -d"
|
||||
done
|
||||
|
||||
echo "----> Drop existing partitions"
|
||||
wipefs -a /dev/sda || true
|
||||
sfdisk --delete /dev/sda || true
|
||||
sgdisk --zap-all /dev/sda
|
||||
sgdisk -og /dev/sda
|
||||
|
||||
echo "-----> Wait for cleanup"
|
||||
sleep 3
|
||||
sync
|
||||
|
||||
echo "-----> Mark GPT disks"
|
||||
echo yes | parted /dev/sda -- mklabel gpt
|
||||
|
||||
echo "-----> Create boot partition"
|
||||
sgdisk -n 0:0:+1G -t 0:ef00 -c 0:boot /dev/sda
|
||||
|
||||
|
@ -33,19 +33,15 @@ for PV in $(pvs --noheadings 2>/dev/null | sed -e 's/^[[:space:]]*//' | cut -d"
|
||||
done
|
||||
|
||||
echo "----> Drop existing partitions"
|
||||
wipefs -a /dev/sda || true
|
||||
sfdisk --delete /dev/sda || true
|
||||
wipefs -a /dev/sdb || true
|
||||
sfdisk --delete /dev/sdb || true
|
||||
sgdisk --zap-all /dev/sda
|
||||
sgdisk -og /dev/sda
|
||||
sgdisk --zap-all /dev/sdb
|
||||
sgdisk -og /dev/sdb
|
||||
|
||||
echo "-----> Wait for cleanup"
|
||||
sleep 3
|
||||
sync
|
||||
|
||||
echo "-----> Mark GPT disks"
|
||||
echo yes | parted /dev/sda -- mklabel gpt
|
||||
echo yes | parted /dev/sdb -- mklabel gpt
|
||||
|
||||
echo "-----> Create boot partition"
|
||||
sgdisk -n 0:0:+1G -t 0:ef00 -c 0:boot /dev/sda
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user