mirror of
https://github.com/tboerger/nixos-config
synced 2024-11-22 18:21:58 +01:00
chore: more changes for the filesystems
This commit is contained in:
parent
8548e2b5bc
commit
fcb7775c04
23
README.md
23
README.md
@ -66,8 +66,27 @@ use the `deploy #name` command, at least if it's executed from a NixOS desktop.
|
||||
### Niflheim
|
||||
|
||||
```console
|
||||
sudo loadkeys de
|
||||
sudo nix-shell --packages nixUnstable
|
||||
apt install -y sudo
|
||||
|
||||
mkdir -p /etc/nix
|
||||
echo "build-users-group =" > /etc/nix/nix.conf
|
||||
|
||||
curl -L https://nixos.org/nix/install | sh
|
||||
. $HOME/.nix-profile/etc/profile.d/nix.sh
|
||||
|
||||
nix-env -f https://github.com/nix-community/nixos-generators/archive/master.tar.gz -i -v
|
||||
|
||||
cat <<EOF > /root/config.nix
|
||||
{
|
||||
services.openssh.enable = true;
|
||||
users.users.root.openssh.authorizedKeys.keys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINaQYR0/Oj6k1H03kshz2J7rlGCaDSuaGPhhOs9FcZfn"
|
||||
];
|
||||
}
|
||||
EOF
|
||||
|
||||
nixos-generate -o /root/result -f kexec-bundle -c /root/config.nix
|
||||
/root/result
|
||||
|
||||
bash -c "$(curl -fsSL https://raw.githubusercontent.com/tboerger/nixos-config/master/scripts/niflheim-partitions)"
|
||||
|
||||
|
@ -23,6 +23,8 @@ while true; do
|
||||
done
|
||||
|
||||
echo "----> Remove previous VGs"
|
||||
vgchange -an
|
||||
|
||||
for VG in $(vgs --noheadings 2>/dev/null | sed -e 's/^[[:space:]]*//' | cut -d" " -f 1); do
|
||||
vgremove -y ${VG} 2>/dev/null
|
||||
done
|
||||
@ -33,18 +35,10 @@ for PV in $(pvs --noheadings 2>/dev/null | sed -e 's/^[[:space:]]*//' | cut -d"
|
||||
done
|
||||
|
||||
echo "----> Remove previous MDs"
|
||||
if [[ -d /dev/md ]]; then
|
||||
for MD in /dev/md/*; do
|
||||
mdadm --stop $MD
|
||||
done
|
||||
fi
|
||||
mdadm --stop --scan || true
|
||||
|
||||
echo "----> Remove previous MDs"
|
||||
if [[ -d /dev/md ]]; then
|
||||
for MD in /dev/md/*; do
|
||||
mdadm --stop $MD
|
||||
done
|
||||
fi
|
||||
echo 'AUTO -all
|
||||
ARRAY <ignore> UUID=00000000:00000000:00000000:00000000' > /etc/mdadm/mdadm.conf
|
||||
|
||||
echo "----> Drop existing partitions"
|
||||
for DISK in pci-0000:00:14.1-ata-1 pci-0000:00:11.0-ata-1.0 pci-0000:00:11.0-ata-2.0 pci-0000:00:11.0-ata-3.0 pci-0000:00:11.0-ata-4.0; do
|
||||
@ -98,7 +92,9 @@ echo "-----> Reload partition table"
|
||||
partprobe
|
||||
|
||||
echo "-----> Create raid0 volume"
|
||||
echo yes | mdadm --create /dev/md0 --level=10 --raid-devices=4 /dev/disk/by-partlabel/tank1 /dev/disk/by-partlabel/tank2 /dev/disk/by-partlabel/tank3 /dev/disk/by-partlabel/tank4
|
||||
echo yes | mdadm --create /dev/md0 --level=10 --raid-devices=4 --homehost=asgard --name=md0 /dev/disk/by-partlabel/tank1 /dev/disk/by-partlabel/tank2 /dev/disk/by-partlabel/tank3 /dev/disk/by-partlabel/tank4
|
||||
wipefs -a /dev/md0
|
||||
echo 0 > /proc/sys/dev/raid/speed_limit_max
|
||||
|
||||
echo "-----> Wait for raids"
|
||||
sleep 3
|
||||
|
@ -23,6 +23,8 @@ while true; do
|
||||
done
|
||||
|
||||
echo "----> Remove previous VGs"
|
||||
vgchange -an
|
||||
|
||||
for VG in $(vgs --noheadings 2>/dev/null | sed -e 's/^[[:space:]]*//' | cut -d" " -f 1); do
|
||||
vgremove -y ${VG} 2>/dev/null
|
||||
done
|
||||
@ -33,18 +35,10 @@ for PV in $(pvs --noheadings 2>/dev/null | sed -e 's/^[[:space:]]*//' | cut -d"
|
||||
done
|
||||
|
||||
echo "----> Remove previous MDs"
|
||||
if [[ -d /dev/md ]]; then
|
||||
for MD in /dev/md/*; do
|
||||
mdadm --stop $MD
|
||||
done
|
||||
fi
|
||||
mdadm --stop --scan || true
|
||||
|
||||
echo "----> Remove previous MDs"
|
||||
if [[ -d /dev/md ]]; then
|
||||
for MD in /dev/md/*; do
|
||||
mdadm --stop $MD
|
||||
done
|
||||
fi
|
||||
echo 'AUTO -all
|
||||
ARRAY <ignore> UUID=00000000:00000000:00000000:00000000' > /etc/mdadm/mdadm.conf
|
||||
|
||||
echo "----> Drop existing partitions"
|
||||
for DISK in pci-0000:00:1f.2-ata-1.0; do
|
||||
|
@ -23,6 +23,8 @@ while true; do
|
||||
done
|
||||
|
||||
echo "----> Remove previous VGs"
|
||||
vgchange -an
|
||||
|
||||
for VG in $(vgs --noheadings 2>/dev/null | sed -e 's/^[[:space:]]*//' | cut -d" " -f 1); do
|
||||
vgremove -y ${VG} 2>/dev/null
|
||||
done
|
||||
@ -33,11 +35,10 @@ for PV in $(pvs --noheadings 2>/dev/null | sed -e 's/^[[:space:]]*//' | cut -d"
|
||||
done
|
||||
|
||||
echo "----> Remove previous MDs"
|
||||
if [[ -d /dev/md ]]; then
|
||||
for MD in /dev/md/*; do
|
||||
mdadm --stop $MD
|
||||
done
|
||||
fi
|
||||
mdadm --stop --scan || true
|
||||
|
||||
echo 'AUTO -all
|
||||
ARRAY <ignore> UUID=00000000:00000000:00000000:00000000' > /etc/mdadm/mdadm.conf
|
||||
|
||||
echo "----> Drop existing partitions"
|
||||
for DISK in pci-0000:00:1f.2-ata-3.0 pci-0000:00:1f.2-ata-4.0 pci-0000:00:1f.2-ata-5.0 pci-0000:00:1f.2-ata-6.0; do
|
||||
@ -93,7 +94,9 @@ echo "-----> Reload partition table"
|
||||
partprobe
|
||||
|
||||
echo "-----> Create raid0 volume"
|
||||
echo yes | mdadm --create /dev/md0 --level=10 --raid-devices=4 /dev/disk/by-partlabel/tank1 /dev/disk/by-partlabel/tank2 /dev/disk/by-partlabel/tank3 /dev/disk/by-partlabel/tank4
|
||||
echo yes | mdadm --create /dev/md0 --level=10 --raid-devices=4 --homehost=niflheim --name=md0 /dev/disk/by-partlabel/tank1 /dev/disk/by-partlabel/tank2 /dev/disk/by-partlabel/tank3 /dev/disk/by-partlabel/tank4
|
||||
wipefs -a /dev/md0
|
||||
echo 0 > /proc/sys/dev/raid/speed_limit_max
|
||||
|
||||
echo "-----> Wait for raids"
|
||||
sleep 3
|
||||
|
@ -23,6 +23,8 @@ while true; do
|
||||
done
|
||||
|
||||
echo "----> Remove previous VGs"
|
||||
vgchange -an
|
||||
|
||||
for VG in $(vgs --noheadings 2>/dev/null | sed -e 's/^[[:space:]]*//' | cut -d" " -f 1); do
|
||||
vgremove -y ${VG} 2>/dev/null
|
||||
done
|
||||
@ -33,18 +35,10 @@ for PV in $(pvs --noheadings 2>/dev/null | sed -e 's/^[[:space:]]*//' | cut -d"
|
||||
done
|
||||
|
||||
echo "----> Remove previous MDs"
|
||||
if [[ -d /dev/md ]]; then
|
||||
for MD in /dev/md/*; do
|
||||
mdadm --stop $MD
|
||||
done
|
||||
fi
|
||||
mdadm --stop --scan || true
|
||||
|
||||
echo "----> Remove previous MDs"
|
||||
if [[ -d /dev/md ]]; then
|
||||
for MD in /dev/md/*; do
|
||||
mdadm --stop $MD
|
||||
done
|
||||
fi
|
||||
echo 'AUTO -all
|
||||
ARRAY <ignore> UUID=00000000:00000000:00000000:00000000' > /etc/mdadm/mdadm.conf
|
||||
|
||||
echo "----> Drop existing partitions"
|
||||
for DISK in pci-0000:00:1f.2-ata-1.0 pci-0000:00:1f.2-ata-2.0; do
|
||||
|
@ -30,7 +30,7 @@
|
||||
};
|
||||
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-label/boot1";
|
||||
device = "/dev/disk/by-label/boot";
|
||||
fsType = "ext4";
|
||||
options = [
|
||||
"noatime"
|
||||
|
@ -30,7 +30,7 @@
|
||||
};
|
||||
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-label/boot1";
|
||||
device = "/dev/disk/by-label/boot";
|
||||
fsType = "ext4";
|
||||
options = [
|
||||
"noatime"
|
||||
|
Loading…
Reference in New Issue
Block a user