diskModel - ODEX-TOS/tos-installer-backend GitHub Wiki

A disk represents a storage medium. It is used to partition/format/mount filesystems It is the most complex and big model of all thus we split this model into multiple categories

Lets get started It looks like this

models:
  - disks:
      - disk:
          device: "/dev/sda" # can also be /dev/disk/by-uuid or a command in the form $(command here)
          size: "499G"
          gpt: true # is the partitiontable gpt or msdos (by default gpt if not set)
          table: true # by default a new partitiontable is generated. If set to false an exisiting partitiontable will be altered
          partitions:
            - partition:
               # partition model here
            - partition:
               # partition model here

You can have multiple disk that is why it is an array of disks A disk must have a device option. This options defines which disk to use The device option should be a file-path pointing to the disk object. It can be a canonical name, uuid or something else. You can also use command substitution to "search" for the disk eg something like this $(find /dev -type b | tail -n1) optional parameter gpt is a boolean that defines if your disk's partitiontable is EFI or MBR if gpt is True it is a EFI partitiontable otherwise it is MBR If this option is not provided it defaults to EFI size is an optional parameter that tells us the size of a disk. It can be in bytes or in human readable format eg K,M,G,T,P table is a Boolean telling us if we need to generate a new partitiontable or alter an exisiting one. By default we generate a brand new table The last parameter is an array of partitions it should at least contain 2 partitions one for boot and on for the root filesystem.