<commit_before># Example Configs #

Each of these examples is written in version 1 of the config. Always double
check to make sure that your config matches the version that Ignition is
expecting.

## Starting Services ##

This config will write a single service unit (shown below) with the contents of
an example service. This unit will be enabled as a dependency of
multi-user.target and therefore start on boot.

```json
{
	"ignitionVersion": 1,
	"systemd": {
		"units": [
			{
				"name": "example.service",
				"enable": true,
				"contents": "[Service]\nType=oneshot\nExecStart=/usr/bin/echo Hello World\n\n[Install]\nWantedBy=multi-user.target"
			}
		]
	}
}
```

### example.service ###

```
[Service]
Type=oneshot
ExecStart=/usr/bin/echo Hello World

[Install]
WantedBy=multi-user.target
```

## Reformat the Root Filesystem ##

In many scenarios, it may be preferable to use btrfs for the root filesystem.
This config will find the device with the filesystem label "ROOT" (the root
filesystem) and reformat it to btrfs, maintaining the filesystem label. The
force flag is needed here because CoreOS currently ships with an ext4 root
filesystem. Without this flag, Ignition would recognize that there is existing
data and refuse to overwrite it.

```json
{
	"ignitionVersion": 1,
	"storage": {
		"filesystems": [
			{
				"device": "/dev/disk/by-label/ROOT",
				"format": "btrfs",
				"create": {
					"force": true,
					"options": [
						"--label=ROOT"
					]
				}
			}
		]
	}
}
```

## Create a RAID-enabled Data Volume ##

In many scenarios, it may be useful to have an external data volume. This
config will set up a RAID0 ext4 volume, data, between two seperate disks. It
also writes a mount unit (shown below) which will automatically mount the
volume to /var/lib/data on boot.

```json
{
	"ignitionVersion": 1,
	"storage": {
		"disks": [
			{
				"device": "/dev/sdb",
				"wipe-table": true,<commit_msg>ignition: add XFS example and related clarifications<commit_after># Example Configs #

Each of these examples is written in version 1 of the config. Always double
check to make sure that your config matches the version that Ignition is
expecting.

## Starting Services ##

This config will write a single service unit (shown below) with the contents of
an example service. This unit will be enabled as a dependency of
multi-user.target and therefore start on boot.

```json
{
	"ignitionVersion": 1,
	"systemd": {
		"units": [
			{
				"name": "example.service",
				"enable": true,
				"contents": "[Service]\nType=oneshot\nExecStart=/usr/bin/echo Hello World\n\n[Install]\nWantedBy=multi-user.target"
			}
		]
	}
}
```

### example.service ###

```
[Service]
Type=oneshot
ExecStart=/usr/bin/echo Hello World

[Install]
WantedBy=multi-user.target
```

## Reformat the Root Filesystem ##

Although CoreOS uses ext4 by default, the btrfs filesystem may be an
appropriate choice for the system root partition in some scenarios.
This example Ignition configuration will locate the device with the "ROOT"
filesystem label (the root filesystem) and reformat it to btrfs, recreating
the filesystem label. The force flag is needed here because CoreOS
currently ships with an ext4 root filesystem. Without this flag, mkfs.btrfs
would recognize that there is existing data and refuse to overwrite it.

### Btrfs ###

```json
{
	"ignitionVersion": 1,
	"storage": {
		"filesystems": [
			{
				"device": "/dev/disk/by-label/ROOT",
				"format": "btrfs",
				"create": {
					"force": true,
					"options": [
						"--label=ROOT"
					]
				}
			}
		]
	}
}
```

### XFS ###

```json
{
	"ignitionVersion": 1,
	"storage": {
		"filesystems": [
			{
				"device": "/dev/disk/by-label/ROOT",
				"format": "xfs",
				"create": {
					"force": true,
					"options": [
						"-L", "ROOT"
					]
				}
			}
		]
	}
}
```

The create options are forwarded as-is to the underlying mkfs.$format
utility, their respective man pages document what's appropriate here.

## Create a RAID-enabled Data Volume ##

In many scenarios, it may be useful to have an external data volume. This
config will set up a RAID0 ext4 volume, data, between two seperate disks. It
also writes a mount unit (shown below) which will automatically mount the
volume to /var/lib/data on boot.

```json
{
	"ignitionVersion": 1,
	"storage": {
		"disks": [
			{
				"device": "/dev/sdb",
				"wipe-table": true,
{'fraction_non_alphanumeric': 0.11900411146642302, 'fraction_numerical': 0.003654636820465966, 'mean_word_length': 3.551975051975052, 'pattern_counts': {'":': 46, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4185841', 'n_tokens_mistral': 1562, 'n_tokens_neox': 1357, 'n_words': 513}