Infini-STICK: reconfigure for new USB stick
This commit is contained in:
parent
075a4a7797
commit
eaabe3e315
8 changed files with 112 additions and 112 deletions
|
@ -1,34 +1,35 @@
|
|||
#!/usr/bin/env bash
|
||||
# [[file:readme.org::mount][mount]]
|
||||
# [[[[file:/etc/nixos/hosts/Infini-STICK/readme.org::boilerplate][boilerplate]]][boilerplate]]
|
||||
# [[file:readme.org::mount][boilerplate]]
|
||||
DISK=$1
|
||||
|
||||
sudo mkdir -p /mnt
|
||||
# boilerplate ends here
|
||||
|
||||
# [[[[file:/etc/nixos/hosts/Infini-STICK/readme.org::mount_check][mount_check]]][mount_check]]
|
||||
# [[file:readme.org::mount][mount_check]]
|
||||
if mountpoint -q -- "/mnt"; then
|
||||
echo "ERROR: /mnt is a mounted filesystem, aborting"
|
||||
exit 1
|
||||
fi
|
||||
# mount_check ends here
|
||||
|
||||
# [[[[file:/etc/nixos/hosts/Infini-STICK/readme.org::mounting][mounting]]][mounting]]
|
||||
# [[file:readme.org::mount][mounting]]
|
||||
echo "LOG: Mounting tmpfs"
|
||||
sudo mount -t tmpfs root /mnt
|
||||
|
||||
echo "LOG: - Mounting persistent directories"
|
||||
sudo mkdir -p /mnt/persist /mnt/nix /mnt/boot
|
||||
sudo mount -o subvol=root,autodefrag,noatime "${DISK}1" /mnt/persist
|
||||
sudo mount -o subvol=nix,autodefrag,noatime "${DISK}1" /mnt/nix
|
||||
sudo mount -o subvol=boot,autodefrag,noatime "${DISK}1" /mnt/boot
|
||||
sudo mount -o subvol=root,autodefrag,noatime "${DISK}3" /mnt/persist
|
||||
sudo mount -o subvol=nix,autodefrag,noatime "${DISK}3" /mnt/nix
|
||||
sudo mount -o subvol=boot,autodefrag,noatime "${DISK}3" /mnt/boot
|
||||
|
||||
echo "LOG: - - Mounting persistent subdirectories"
|
||||
sudo mkdir -p /mnt/home
|
||||
sudo mkdir -p /mnt/home /mnt/etc/ssh
|
||||
sudo mount --bind /mnt/persist/home /mnt/home
|
||||
sudo mount --bind /mnt/persist/etc/ssh /mnt/etc/ssh
|
||||
|
||||
echo "LOG: - Mounting EFI System Partition"
|
||||
sudo mkdir -p /mnt/boot/efi
|
||||
sudo mount "${DISK}2" /mnt/boot/efi
|
||||
sudo mount "${DISK}4" /mnt/boot/efi
|
||||
# mounting ends here
|
||||
# mount ends here
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue