New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switch to bcachefs #55

Closed
tycho01 opened this Issue Sep 6, 2018 · 1 comment

Comments

Projects
None yet
1 participant
@tycho01
Owner

tycho01 commented Sep 6, 2018

as per NixOS/nixpkgs#46109:

  • back up all stuff
  • make nixos iso
    • cd /drogon/Coding/nix/nixpkgs/nixos
    • nvim modules/installer/cd-dvd/installation-cd-minimal.nix to add bcachefs support
    • nix-build -A config.system.build.isoImage -I nixos-config=modules/installer/cd-dvd/installation-cd-minimal.nix default.nix
  • make usb for /nix/store/rjqsy5w69sr1lkkxiwf8qdajrrg7babz-nixos-19.03.git.a9e50ec-x86_64-linux.iso/iso/nixos-19.03.git.a9e50ec-x86_64-linux.iso
  • convert disks to bcachefs

@tycho01 tycho01 added blocked important and removed blocked labels Sep 14, 2018

@tycho01

This comment has been minimized.

Show comment
Hide comment
@tycho01

tycho01 Sep 16, 2018

Owner
# gdisk /dev/sda # (or whatever device you want to install on)
-- for UEFI systems only
> n      # (create a new partition for /boot)
> 3      # (make it a partition number 3)
>        # (press enter to accept the default)
> +512M  # (the size of the UEFI boot partition)
> t      # (change the partition type ...)
> 3      # (... of the boot partition ...)
> 1      # (... to 'UEFI System')
-- for BIOS or UEFI systems
> n      # (create a new partition for /swap)
> 2      # (make it a partition number 2)
>        # (press enter to accept the default)
> +8G    # (the size of the swap partition)
>         # (confirm formatting as linux partition)
> n      # (create a new partition for /)
> 1      # (make it a partition number 1)
>        # (press enter to accept the default)
>        # (press enter to accept the default and use the rest of the remaining space)
>         # (confirm formatting as linux partition)
// > a      # (make the partition bootable)
> x      # (enter expert mode)
> f      # (fix up the partition ordering)
> m      # (exit expert mode)
> w      # (write the partition table to disk and exit)
> y      # (confirm creating partitions)

bcachefs format	\
--label=nixos \
--error_action=panic \
--data_replicas=2 \
--metadata_replicas=3 \
--group ssd /dev/sdb1 \
--group hdd /dev/sda1 \
--foreground_target ssd	\
--background_target hdd	\
--promote_target ssd

mount -t bcachefs /dev/sda1:/dev/sdb1 /mnt

mkswap -L swap /dev/sda2
swapon /dev/sda2
mkfs.vfat -F 32 -n boot /dev/sda3        # (for UEFI systems only)
mkdir -p /mnt/boot                      # (for UEFI systems only)
mount /dev/sda3 /mnt/boot # (for UEFI systems only)
nixos-generate-config --root /mnt

mkdir /mnt/boot/efi
nano /mnt/nix/store/*-install-grub.pl  # alter to enable forceInstall for both MBR/EFI to beat blocklists error

nano /mnt/etc/nixos/configuration.nix  # uncomment `boot.loader.grub.efiSupport = true;`, `boot.loader.grub.efiInstallAsRemovable = true;`, `boot.loader.efi.efiSysMountPoint = "/boot/efi";`, `boot.loader.grub.device = "/dev/sda";`, `boot.loader.systemd-boot.enable = true;`
nano /mnt/etc/nixos/hardware-configuration.nix  # set `/boot` device to `/dev/sda3`

nixos-install
reboot

mkdir /etc/nixos/private /run/user/1000
chmod -R 1000 /run/user/0
nano /mnt/etc/nixos/configuration.nix  # add wget
nixos-rebuild switch
git clone https://github.com/tycho01/nix-config.git
cd nix-config
git checkout clean-boot
cp secrets.sample.nix secrets.nix
# cp /etc/nixos/hardware-configuration.nix ./
cp -r ./ /etc/nixos/
# nano /etc/nixos/users/tycho.nix  # set password
# nano /etc/nixos/profiles/os/tychotop.nix  # disable unneeded categories
nixos-rebuild switch
systemctl start display-manager.service
nix-channel --add https://nixos.org/channels/nixos-unstable-small
# readd secrets from gist
# configure defaults:
# firefox -> settings -> preferences -> use smooth scrolling
# konsole -> settings -> edit current profile -> appearance -> solarized
# bottom bar -> right click -> alternatives -> icons-only task manager
# system settings -> input devices -> keyboard -> layouts -> switching policy -> application
# system settings -> input devices -> keyboard -> advanced -> caps lock behavior -> make caps lock an additional Esc
# telegram -> night mode

edit: for bcachefs /dev/sda and /dev/sda1 can both work, depending on whether you wanna split a drive up into multiple partitions.

Owner

tycho01 commented Sep 16, 2018

# gdisk /dev/sda # (or whatever device you want to install on)
-- for UEFI systems only
> n      # (create a new partition for /boot)
> 3      # (make it a partition number 3)
>        # (press enter to accept the default)
> +512M  # (the size of the UEFI boot partition)
> t      # (change the partition type ...)
> 3      # (... of the boot partition ...)
> 1      # (... to 'UEFI System')
-- for BIOS or UEFI systems
> n      # (create a new partition for /swap)
> 2      # (make it a partition number 2)
>        # (press enter to accept the default)
> +8G    # (the size of the swap partition)
>         # (confirm formatting as linux partition)
> n      # (create a new partition for /)
> 1      # (make it a partition number 1)
>        # (press enter to accept the default)
>        # (press enter to accept the default and use the rest of the remaining space)
>         # (confirm formatting as linux partition)
// > a      # (make the partition bootable)
> x      # (enter expert mode)
> f      # (fix up the partition ordering)
> m      # (exit expert mode)
> w      # (write the partition table to disk and exit)
> y      # (confirm creating partitions)

bcachefs format	\
--label=nixos \
--error_action=panic \
--data_replicas=2 \
--metadata_replicas=3 \
--group ssd /dev/sdb1 \
--group hdd /dev/sda1 \
--foreground_target ssd	\
--background_target hdd	\
--promote_target ssd

mount -t bcachefs /dev/sda1:/dev/sdb1 /mnt

mkswap -L swap /dev/sda2
swapon /dev/sda2
mkfs.vfat -F 32 -n boot /dev/sda3        # (for UEFI systems only)
mkdir -p /mnt/boot                      # (for UEFI systems only)
mount /dev/sda3 /mnt/boot # (for UEFI systems only)
nixos-generate-config --root /mnt

mkdir /mnt/boot/efi
nano /mnt/nix/store/*-install-grub.pl  # alter to enable forceInstall for both MBR/EFI to beat blocklists error

nano /mnt/etc/nixos/configuration.nix  # uncomment `boot.loader.grub.efiSupport = true;`, `boot.loader.grub.efiInstallAsRemovable = true;`, `boot.loader.efi.efiSysMountPoint = "/boot/efi";`, `boot.loader.grub.device = "/dev/sda";`, `boot.loader.systemd-boot.enable = true;`
nano /mnt/etc/nixos/hardware-configuration.nix  # set `/boot` device to `/dev/sda3`

nixos-install
reboot

mkdir /etc/nixos/private /run/user/1000
chmod -R 1000 /run/user/0
nano /mnt/etc/nixos/configuration.nix  # add wget
nixos-rebuild switch
git clone https://github.com/tycho01/nix-config.git
cd nix-config
git checkout clean-boot
cp secrets.sample.nix secrets.nix
# cp /etc/nixos/hardware-configuration.nix ./
cp -r ./ /etc/nixos/
# nano /etc/nixos/users/tycho.nix  # set password
# nano /etc/nixos/profiles/os/tychotop.nix  # disable unneeded categories
nixos-rebuild switch
systemctl start display-manager.service
nix-channel --add https://nixos.org/channels/nixos-unstable-small
# readd secrets from gist
# configure defaults:
# firefox -> settings -> preferences -> use smooth scrolling
# konsole -> settings -> edit current profile -> appearance -> solarized
# bottom bar -> right click -> alternatives -> icons-only task manager
# system settings -> input devices -> keyboard -> layouts -> switching policy -> application
# system settings -> input devices -> keyboard -> advanced -> caps lock behavior -> make caps lock an additional Esc
# telegram -> night mode

edit: for bcachefs /dev/sda and /dev/sda1 can both work, depending on whether you wanna split a drive up into multiple partitions.

@tycho01 tycho01 closed this Sep 23, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment