Bcachefs: Difference between revisions
m Citation needed. Especially regarding stability compared to ZFS |
→NixOS installation on bcachefs: Cleanup instruction |
||
| (7 intermediate revisions by 3 users not shown) | |||
| Line 57: | Line 57: | ||
--label=hdd.hdd3 /dev/sde \ | --label=hdd.hdd3 /dev/sde \ | ||
--label=ssd.ssd1 /dev/sdf \ | --label=ssd.ssd1 /dev/sdf \ | ||
--label=ssd.ssd2 /dev/sdg | --label=ssd.ssd2 /dev/sdg \ | ||
--foreground_target=ssd \ | --foreground_target=ssd \ | ||
--promote_target=ssd \ | --promote_target=ssd \ | ||
| Line 71: | Line 71: | ||
--label=hdd.hdd3 /dev/sde \ | --label=hdd.hdd3 /dev/sde \ | ||
--label=ssd.ssd1 /dev/sdf \ | --label=ssd.ssd1 /dev/sdf \ | ||
--label=ssd.ssd2 /dev/sdg | --label=ssd.ssd2 /dev/sdg \ | ||
--foreground_target=ssd \ | --foreground_target=ssd \ | ||
--promote_target=ssd \ | --promote_target=ssd \ | ||
| Line 114: | Line 114: | ||
== Tips and tricks == | == Tips and tricks == | ||
=== Generate bcachefs enabled installation media === | === Generate bcachefs enabled installation media === | ||
Use following Nix [[Flakes|Flake-expression]] to generate a ISO installation image with a bcachefs enabled kernel | Use following Nix [[Flakes|Flake-expression]] to generate a ISO installation image with a bcachefs enabled kernel | ||
{{file|flake.nix|nix|<nowiki> | {{file|flake.nix|nix|<nowiki> | ||
{ | { | ||
description = "Bcachefs enabled installation media"; | description = "Bcachefs enabled installation media"; | ||
inputs.nixos.url = "nixpkgs/nixos- | inputs.nixos.url = "nixpkgs/nixos-25.11"; | ||
outputs = { self, nixos }: { | outputs = { self, nixos }: { | ||
nixosConfigurations = { | nixosConfigurations = { | ||
| Line 129: | Line 131: | ||
"${nixos}/nixos/modules/installer/cd-dvd/installation-cd-minimal-new-kernel-no-zfs.nix" | "${nixos}/nixos/modules/installer/cd-dvd/installation-cd-minimal-new-kernel-no-zfs.nix" | ||
({ lib, pkgs, ... }: { | ({ lib, pkgs, ... }: { | ||
# | # Required as a workaround for bug | ||
# https://github.com/NixOS/nixpkgs/issues/32279 | # https://github.com/NixOS/nixpkgs/issues/32279 | ||
environment.systemPackages = [ pkgs.keyutils ]; | environment.systemPackages = [ pkgs.keyutils ]; | ||
| Line 142: | Line 144: | ||
The following commands will generate the iso-image which will be available in the directory <code>./result/iso</code> | The following commands will generate the iso-image which will be available in the directory <code>./result/iso</code> | ||
<syntaxhighlight lang="console"> | <syntaxhighlight lang="console"># nix build .#nixosConfigurations.exampleIso.config.system.build.isoImage | ||
# nix build .#nixosConfigurations.exampleIso.config.system.build.isoImage | |||
</syntaxhighlight> | </syntaxhighlight> | ||
| Line 172: | Line 173: | ||
<syntaxhighlight lang="console"> | <syntaxhighlight lang="console"> | ||
# | # keyctl link @u @s | ||
# bcachefs format --encrypted /dev/sda2 | # bcachefs format --label=nixos --encrypted /dev/sda2 | ||
# bcachefs unlock /dev/sda2 | # bcachefs unlock /dev/sda2 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Mount filesystems | Mount filesystems. Use <code>lsblk -o +uuid,fsType | grep bcachefs</code> to get bcachefs partition uuid. | ||
<syntaxhighlight lang="console"> | <syntaxhighlight lang="console"> | ||
# mount /dev/ | # mount /dev/disk/by-uuid/<...> /mnt | ||
# mkdir /mnt/boot | # mkdir /mnt/boot | ||
# mount /dev/disk/by-label/boot /mnt/boot | # mount /dev/disk/by-label/boot /mnt/boot | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Continue installation as recommended by the [https://nixos.org/manual/nixos/stable/index.html#ch-installation NixOS manual]. | Continue installation as recommended by the [https://nixos.org/manual/nixos/stable/index.html#ch-installation NixOS manual]. | ||
=== Remote encrypted disk unlocking === | === Remote encrypted disk unlocking === | ||