#!/bin/bash # Verify Internal NVMe Boot Configuration # This script checks if the internal drive (nvme0n1) is properly configured to boot set -e echo "=== Internal Drive Boot Verification ===" echo "" echo "1. Checking EFI partition mount..." df -h /boot/efi | grep -E "Filesystem|nvme0n1p1" && echo "✓ EFI mounted from internal drive" || echo "✗ EFI not on internal drive" echo "" echo "2. Checking boot partition mount..." df -h /boot | grep -E "Filesystem|internal--vg-boot" && echo "✓ Boot mounted from internal-vg" || echo "✗ Boot not on internal-vg" echo "" echo "3. Checking GRUB installation..." if [ -f /boot/efi/EFI/ubuntu/shimx64.efi ]; then echo "✓ GRUB bootloader found in EFI" else echo "✗ GRUB bootloader missing" fi echo "" echo "4. Checking EFI boot entries..." efibootmgr | grep -i ubuntu && echo "✓ Ubuntu boot entry exists" || echo "✗ No Ubuntu boot entry" echo "" echo "5. Checking GRUB environment..." sudo grub-editenv list if [ -z "$(sudo grub-editenv list)" ]; then echo "✓ GRUB environment clean (no boot failure flags)" else echo "⚠ GRUB environment has settings" fi echo "" echo "6. Checking current boot device..." echo "Currently booted from: $(findmnt -n -o SOURCE /)" echo "" echo "7. Internal drive UUIDs..." echo "Root: $(sudo blkid /dev/internal-vg/root -s UUID -o value)" echo "Boot: $(sudo blkid /dev/internal-vg/boot -s UUID -o value)" echo "" echo "8. Checking /etc/fstab for internal drive..." grep -E "internal-vg|757B-A377" /etc/fstab && echo "✓ Internal volumes in fstab" || echo "⚠ Check fstab configuration" echo "" echo "=== Verification Complete ===" echo "" echo "To test boot from internal drive:" echo "1. Remove/disconnect the external USB M.2 drive" echo "2. Reboot the system" echo "3. System should boot from internal nvme0n1"