mirror of
https://github.com/nix-community/disko
synced 2024-09-20 05:51:54 +00:00
Add EF02 priority=1 flag. Systems won't boot otherwise
This commit is contained in:
parent
b3254b1038
commit
35d4378e74
9 changed files with 39 additions and 22 deletions
|
@ -1,10 +1,12 @@
|
||||||
# disko-install
|
# disko-install
|
||||||
|
|
||||||
**disko-install** enhances the normal `nixos-install` with disko's partitioning feature.
|
**disko-install** enhances the normal `nixos-install` with disko's partitioning
|
||||||
It can be started from the NixOS installer but it can also be used to create bootable USB-Sticks from your normal workstation.
|
feature. It can be started from the NixOS installer but it can also be used to
|
||||||
Furthermore `disko-install` has a mount mode that will only mount but not destroy existing partitions.
|
create bootable USB-Sticks from your normal workstation. Furthermore
|
||||||
The mount mode can be used to mount and repair existing NixOS installations.
|
`disko-install` has a mount mode that will only mount but not destroy existing
|
||||||
This document provides a comprehensive guide on how to use **disko-install**, including examples for typical usage scenarios.
|
partitions. The mount mode can be used to mount and repair existing NixOS
|
||||||
|
installations. This document provides a comprehensive guide on how to use
|
||||||
|
**disko-install**, including examples for typical usage scenarios.
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
|
@ -16,7 +18,8 @@ This document provides a comprehensive guide on how to use **disko-install**, in
|
||||||
|
|
||||||
### Fresh Installation
|
### Fresh Installation
|
||||||
|
|
||||||
For a fresh installation, where **disko-install** will handle partitioning and setting up the disk, use the following syntax:
|
For a fresh installation, where **disko-install** will handle partitioning and
|
||||||
|
setting up the disk, use the following syntax:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
sudo nix run 'github:nix-community/disko#disko-install' -- --flake <flake-url>#<flake-attr> --disk <disk-name> <disk-device>
|
sudo nix run 'github:nix-community/disko#disko-install' -- --flake <flake-url>#<flake-attr> --disk <disk-name> <disk-device>
|
||||||
|
@ -24,11 +27,11 @@ sudo nix run 'github:nix-community/disko#disko-install' -- --flake <flake-url>#<
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
First run `nixos-generate-config --root /tmp/config --no-filesystems` and
|
First run `nixos-generate-config --root /tmp/config --no-filesystems` and edit
|
||||||
edit `configuration.nix` to your liking.
|
`configuration.nix` to your liking.
|
||||||
|
|
||||||
Than add the following `flake.nix` inside `/tmp/config/etc/nixos`.
|
Than add the following `flake.nix` inside `/tmp/config/etc/nixos`. In this
|
||||||
In this example we assume a system that has been booted with EFI:
|
example we assume a system that has been booted with EFI:
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
{
|
{
|
||||||
|
@ -53,6 +56,7 @@ In this example we assume a system that has been booted with EFI:
|
||||||
MBR = {
|
MBR = {
|
||||||
type = "EF02"; # for grub MBR
|
type = "EF02"; # for grub MBR
|
||||||
size = "1M";
|
size = "1M";
|
||||||
|
priority = 1; # Needs to be first partition
|
||||||
};
|
};
|
||||||
ESP = {
|
ESP = {
|
||||||
type = "EF00";
|
type = "EF00";
|
||||||
|
@ -105,8 +109,8 @@ In our example, we want to install to a USB-stick (/dev/sda):
|
||||||
$ sudo nix run 'github:nix-community/disko#disko-install' -- --flake '/tmp/config/etc/nixos#mymachine' --disk main /dev/sda
|
$ sudo nix run 'github:nix-community/disko#disko-install' -- --flake '/tmp/config/etc/nixos#mymachine' --disk main /dev/sda
|
||||||
```
|
```
|
||||||
|
|
||||||
Afterwards you can test your USB-stick by either selecting during the boot
|
Afterwards you can test your USB-stick by either selecting during the boot or
|
||||||
or attaching it to a qemu-vm:
|
attaching it to a qemu-vm:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ sudo qemu-kvm -enable-kvm -hda /dev/sda
|
$ sudo qemu-kvm -enable-kvm -hda /dev/sda
|
||||||
|
@ -114,23 +118,25 @@ $ sudo qemu-kvm -enable-kvm -hda /dev/sda
|
||||||
|
|
||||||
### Persisting boot entries to EFI vars flash
|
### Persisting boot entries to EFI vars flash
|
||||||
|
|
||||||
**disko-install** is designed for NixOS installations on portable storage or disks that may be transferred between computers.
|
**disko-install** is designed for NixOS installations on portable storage or
|
||||||
As such, it does not modify the host's NVRAM by default.
|
disks that may be transferred between computers. As such, it does not modify the
|
||||||
To ensure your NixOS installation boots seamlessly on new hardware or to prioritize it in your current machine's boot order,
|
host's NVRAM by default. To ensure your NixOS installation boots seamlessly on
|
||||||
use the --write-efi-boot-entries option:
|
new hardware or to prioritize it in your current machine's boot order, use the
|
||||||
|
--write-efi-boot-entries option:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ sudo nix run 'github:nix-community/disko#disko-install' -- --write-efi-boot-entries --flake '/tmp/config/etc/nixos#mymachine' --disk main /dev/sda
|
$ sudo nix run 'github:nix-community/disko#disko-install' -- --write-efi-boot-entries --flake '/tmp/config/etc/nixos#mymachine' --disk main /dev/sda
|
||||||
```
|
```
|
||||||
|
|
||||||
This command installs NixOS with **disko-install** and sets the newly installed system as the default boot option,
|
This command installs NixOS with **disko-install** and sets the newly installed
|
||||||
without affecting the flexibility to boot from other devices if needed.
|
system as the default boot option, without affecting the flexibility to boot
|
||||||
|
from other devices if needed.
|
||||||
|
|
||||||
### Using disko-install in an offline installer
|
### Using disko-install in an offline installer
|
||||||
|
|
||||||
If you want to **disko-install** from a customer installer without internet, you need to make sure that
|
If you want to **disko-install** from a customer installer without internet, you
|
||||||
next the toplevel of your NixOS closure that you plan to install, it also needs **diskoScript** and
|
need to make sure that next the toplevel of your NixOS closure that you plan to
|
||||||
all the flake inputs for evaluation.
|
install, it also needs **diskoScript** and all the flake inputs for evaluation.
|
||||||
|
|
||||||
#### Example configuration to install
|
#### Example configuration to install
|
||||||
|
|
||||||
|
@ -212,4 +218,6 @@ in
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Also see the [NixOS test of disko-install](https://github.com/nix-community/disko/blob/master/tests/disko-install/default.nix) that also runs without internet.
|
Also see the
|
||||||
|
[NixOS test of disko-install](https://github.com/nix-community/disko/blob/master/tests/disko-install/default.nix)
|
||||||
|
that also runs without internet.
|
||||||
|
|
|
@ -38,6 +38,7 @@
|
||||||
boot = {
|
boot = {
|
||||||
size = "1M";
|
size = "1M";
|
||||||
type = "EF02"; # for grub MBR
|
type = "EF02"; # for grub MBR
|
||||||
|
priority = 1; # Needs to be first partition
|
||||||
};
|
};
|
||||||
ESP = {
|
ESP = {
|
||||||
size = "500M";
|
size = "500M";
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
boot = {
|
boot = {
|
||||||
size = "1M";
|
size = "1M";
|
||||||
type = "EF02"; # for grub MBR
|
type = "EF02"; # for grub MBR
|
||||||
|
priority = 1; # Needs to be first partition
|
||||||
};
|
};
|
||||||
root = {
|
root = {
|
||||||
size = "100%";
|
size = "100%";
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
boot = {
|
boot = {
|
||||||
size = "1M";
|
size = "1M";
|
||||||
type = "EF02"; # for grub MBR
|
type = "EF02"; # for grub MBR
|
||||||
|
priority = 1; # Needs to be first partition
|
||||||
};
|
};
|
||||||
ESP = {
|
ESP = {
|
||||||
name = "ESP";
|
name = "ESP";
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
boot = {
|
boot = {
|
||||||
size = "1M";
|
size = "1M";
|
||||||
type = "EF02"; # for grub MBR
|
type = "EF02"; # for grub MBR
|
||||||
|
priority = 1; # Needs to be first partition
|
||||||
};
|
};
|
||||||
ESP = {
|
ESP = {
|
||||||
size = "512M";
|
size = "512M";
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
boot = {
|
boot = {
|
||||||
size = "1M";
|
size = "1M";
|
||||||
type = "EF02"; # for grub MBR
|
type = "EF02"; # for grub MBR
|
||||||
|
priority = 1; # Needs to be first partition
|
||||||
};
|
};
|
||||||
ESP = {
|
ESP = {
|
||||||
size = "500M";
|
size = "500M";
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
boot = {
|
boot = {
|
||||||
size = "1M";
|
size = "1M";
|
||||||
type = "EF02"; # for grub MBR
|
type = "EF02"; # for grub MBR
|
||||||
|
priority = 1; # Needs to be first partition
|
||||||
};
|
};
|
||||||
mdadm = {
|
mdadm = {
|
||||||
size = "100%";
|
size = "100%";
|
||||||
|
@ -30,6 +31,7 @@
|
||||||
boot = {
|
boot = {
|
||||||
size = "1M";
|
size = "1M";
|
||||||
type = "EF02"; # for grub MBR
|
type = "EF02"; # for grub MBR
|
||||||
|
priority = 1; # Needs to be first partition
|
||||||
};
|
};
|
||||||
mdadm = {
|
mdadm = {
|
||||||
size = "100%";
|
size = "100%";
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
boot = {
|
boot = {
|
||||||
size = "1M";
|
size = "1M";
|
||||||
type = "EF02"; # for grub MBR
|
type = "EF02"; # for grub MBR
|
||||||
|
priority = 1; # Needs to be first partition
|
||||||
};
|
};
|
||||||
mdadm = {
|
mdadm = {
|
||||||
size = "100%";
|
size = "100%";
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
boot = {
|
boot = {
|
||||||
size = "1M";
|
size = "1M";
|
||||||
type = "EF02";
|
type = "EF02";
|
||||||
|
priority = 1; # Needs to be first partition
|
||||||
};
|
};
|
||||||
root = {
|
root = {
|
||||||
size = "100%";
|
size = "100%";
|
||||||
|
|
Loading…
Reference in a new issue