Skip to content

Latest commit

 

History

History
168 lines (133 loc) · 4.48 KB

README.adoc

File metadata and controls

168 lines (133 loc) · 4.48 KB

disks(1)

Name

disks - NAHO’s disks

Description

NAHO's disks managed with disko.

Packages

Package Description

disko

Wraps and locks the disko input in an environment providing the disks and lib directories to the underlying disko command.

default

Defaults to the disko package.

format

Wraps the disko package for formatting disks by setting disko's --mode disko flag and prompting for the password file.

mount

Wraps the disko package for mounting disks by setting disko's --mode mount flag and prompting for the password file.

shred

Wraps the shred command for securely wiping disks by setting the --verbose flag and defaulting the number of iterations and the random source to 1 and /dev/urandom respectively.

Usage

The following table explains the possible variables used to mount and format disks:

Variable Description Example

<BACKUP_MOUNTPOINT>

Mountpoint for the /backup subvolume.

/mnt/backup

<DEVICE>

Path to the disk device.

/dev/sda

<ROOT_MOUNTPOINT>

Mountpoint for the /root subvolume.

/mnt/root

The following table demonstrates how to mount and format disks:

Disk Mount Format
nix \
  --experimental-features "flakes nix-command" \
  run \
  github:trueNAHO/disks#mount \
  -- \
  --argstr backupMountpoint <BACKUP_MOUNTPOINT> \
  --argstr device <DEVICE> \
  --argstr rootMountpoint <ROOT_MOUNTPOINT> \
  --root-mountpoint / \
  disks/SanDisk_Extreme_55AE_323230354C37343031383735.nix
nix \
  --experimental-features "flakes nix-command" \
  run \
  github:trueNAHO/disks#format \
  -- \
  --argstr backupMountpoint <BACKUP_MOUNTPOINT> \
  --argstr device <DEVICE> \
  --argstr rootMountpoint <ROOT_MOUNTPOINT> \
  --root-mountpoint / \
  disks/SanDisk_Extreme_55AE_323230354C37343031383735.nix

Add Disk

To add a new disk, add the new disko configuration to the disks/<DISKO>.nix file, where <DISKO> is the output of the following command and <FILE> corresponds to the path of the disk device:

udevadm info --name <FILE> --property ID_SERIAL --query property --value |
  sed 's/-[[:digit:]]*:[[:digit:]]*$//'