Hello ,
My issue manifested with nixos-rebuild switch
erroring out with the following log:
$ sudo nixos-rebuild switch --flake .# --install-bootloader
building the system configuration...
updating GRUB 2 menu...
installing the GRUB 2 boot loader on /dev/sda...
Installing for i386-pc platform.
/nix/store/k16fsfwnccjmknzrrqhcmwm3l8g2p61d-grub-2.06/sbin/grub-install: warning: this GPT partition label contains no BIOS Boot Partition; embedding won't be possible.
/nix/store/k16fsfwnccjmknzrrqhcmwm3l8g2p61d-grub-2.06/sbin/grub-install: error: embedding is not possible, but this is required for RAID and LVM install.
/nix/store/lr12rz9yj3rkfbgkdlcj7d87wrsi972a-install-grub.pl: installation of GRUB on /dev/sda failed: Inappropriate ioctl for device
warning: error(s) occurred while switching to the new configuration
Looking around on the system, I noticed that my /boot
partition disappeared(!).
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
fd0 2:0 1 4K 0 disk
sda 8:0 0 1.8T 0 disk
└─sda1 8:1 0 1.8T 0 part
└─lvm-media 254:0 0 3.6T 0 lvm /nix/store
/
sdb 8:16 0 1.8T 0 disk
├─sdb1 8:17 0 1.8T 0 part
│ └─lvm-media 254:0 0 3.6T 0 lvm /nix/store
│ /
└─sdb2 8:18 0 16G 0 part [SWAP]
$ sudo ls /boot
background.png converted-font.pf2 grub
$ df -h /boot
Filesystem Size Used Avail Use% Mounted on
/dev/disk/by-label/nixos 3.6T 3.3T 113G 97% /
This is surprising to me as I should instead have the following setup (according to both my memories and the install script for that server):
- Two disks of 2TB
- One has three partitions
- Boot partition
- Media/root partition
- Swap partition
- The second disk has a single partition, to be used through LVM as a media/root partition with the other disk’s.
- One has three partitions
I have a few questions:
- How did I lose my
/boot
partition? - Is that why
nixos-rebuild switch
fails? - How do I recreate it, since this is a server I would like to try and avoid shutting it down in case I can never reboot it…
- Can I avoid this happening again in the future?
Refs: