-
Notifications
You must be signed in to change notification settings - Fork 261
feat(em): add custom partitioning #3779
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
223 changes: 223 additions & 0 deletions
223
bare-metal/elastic-metal/how-to/configure-disk-partitions.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,223 @@ | ||
| --- | ||
| meta: | ||
| title: How to configure custom disk partitioning on Scaleway Elastic Metal servers | ||
| description: Learn how to configure custom disk partitions on Scaleway Elastic Metal servers | ||
| content: | ||
| h1: How to configure custom disk partitioning on Scaleway Elastic Metal servers | ||
| paragraph: This guide explains how to configure custom disk partitions on Scaleway Elastic Metal servers. | ||
| tags: attach, detach, flexible-ip, elastic-metal | ||
| dates: | ||
| validation: 2024-10-01 | ||
| posted: 2024-10-01 | ||
| categories: | ||
| - bare-metal | ||
| --- | ||
|
|
||
| Scaleway Bare Metal server come with a default partition layout, suited for most users to speed up and simplify the installation process of the server. | ||
| However, if you have specific requirements, you can define a custom partitioning of your machine using a JSON configuration during installation of the server. | ||
bene2k1 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| <Message type="tip"> | ||
| You can change the partitioning of your server during installation or re-installation only. | ||
| Be aware that all your data will be deleted if you reinstall your server. | ||
| </Message> | ||
|
|
||
| <Macro id="requirements" /> | ||
| - A Scaleway account logged into the [console](https://console.scaleway.com) | ||
| - [Owner](/identity-and-access-management/iam/concepts/#owner) status or [IAM permissions](/identity-and-access-management/iam/concepts/#permission) allowing you to perform actions in the intended Organization | ||
| - An [SSH key](/identity-and-access-management/organizations-and-projects/how-to/create-ssh-key/) | ||
| - An [Elastic Metal server](/bare-metal/elastic-metal/quickstart/#how-to-create-an-elastic-metal-server) | ||
|
|
||
| ## Example configuration | ||
|
|
||
| During [server installation](/bare-metal/elastic-metal/) click **Advanced JSON** configuration in step 5 of the server creation wizard. | ||
| You can then edit the partiton configuration directly in the editor within your browser. The configuration is done using a JSON description of the partitioning. | ||
bene2k1 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Below is an example of how to define a partitioning schema with RAID and NVMe disks. | ||
|
|
||
| <Message type="important"> | ||
| - Disk Type Naming: Device names differ based on the disk type. For example, HDD/SSD will use `/dev/sdXXX`, while NVMe devices use `/dev/nvmeXXX`. | ||
| - UEFI Partition: The EFI partition should only exist if the server uses UEFI. If UEFI is not in use, this partition should be omitted. | ||
| - ZFS and LVM: ZFS is optional and can be configured if needed, while LVM should not be used for now due to functionality issues. | ||
| </Message> | ||
|
|
||
| ```json | ||
| { | ||
| "partitioning_schema": { | ||
| "disks": [ | ||
| { | ||
| "device": "/dev/nvme0n1", | ||
| "partitions": [ | ||
| { | ||
| "label": "uefi", | ||
| "number": 1, | ||
| "size": 536870912 | ||
| }, | ||
| { | ||
| "label": "swap", | ||
| "number": 2, | ||
| "size": 4294967296 | ||
| }, | ||
| { | ||
| "label": "boot", | ||
| "number": 3, | ||
| "size": 536870912 | ||
| }, | ||
| { | ||
| "label": "root", | ||
| "number": 4, | ||
| "size": 64424509440 | ||
| }, | ||
| { | ||
| "label": "data", | ||
| "number": 5, | ||
| "size": 1850588790784 | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "device": "/dev/nvme1n1", | ||
| "partitions": [ | ||
| { | ||
| "label": "swap", | ||
| "number": 1, | ||
| "size": 4294967296 | ||
| }, | ||
| { | ||
| "label": "boot", | ||
| "number": 2, | ||
| "size": 536870912 | ||
| }, | ||
| { | ||
| "label": "root", | ||
| "number": 3, | ||
| "size": 64424509440 | ||
| }, | ||
| { | ||
| "label": "data", | ||
| "number": 4, | ||
| "size": 1850588790784 | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "raids": [ | ||
| { | ||
| "name": "/dev/md0", | ||
| "level": "raid_level_1", | ||
| "devices": [ | ||
| "/dev/nvme0n1p3", | ||
| "/dev/nvme1n1p2" | ||
| ] | ||
| }, | ||
| { | ||
| "name": "/dev/md1", | ||
| "level": "raid_level_1", | ||
| "devices": [ | ||
| "/dev/nvme0n1p4", | ||
| "/dev/nvme1n1p3" | ||
| ] | ||
| } | ||
| ], | ||
| "filesystems": [ | ||
| { | ||
| "device": "/dev/nvme0n1p1", | ||
| "format": "fat32", | ||
| "mountpoint": "/boot/efi" | ||
| }, | ||
| { | ||
| "device": "/dev/md0", | ||
| "format": "ext4", | ||
| "mountpoint": "/boot" | ||
| }, | ||
| { | ||
| "device": "/dev/md1", | ||
| "format": "ext4", | ||
| "mountpoint": "/" | ||
| } | ||
| ], | ||
| "lvm": null, | ||
| "zfs": { | ||
| "pools": [ | ||
| { | ||
| "name": "zpve", | ||
| "type": "mirror", | ||
| "devices": [ | ||
| "/dev/nvme0n1p5", | ||
| "/dev/nvme1n1p4" | ||
| ], | ||
| "options": [ | ||
| "ashift=12" | ||
| ], | ||
| "filesystem_options": [] | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ## Explanation of key sections: | ||
|
|
||
| - Disks: | ||
| - Each disk is specified with its device path (e.g., `/dev/nvme0n1` or `/dev/nvme1n1`). | ||
| - Partitions are defined with labels like `swap`, `boot`, `root`, `data`, and an optional `uefi` partition for systems using UEFI. | ||
| - Each partition has a `number` and `size` in bytes. | ||
|
|
||
| - RAID: | ||
| - If RAID is required, declare the disks and the desired RAID level. In this example, we are configuring two RAID-1 arrays, one for the boot partition and one for the root partition. | ||
| - Devices participating in each RAID array are specified by their partition paths (e.g., `/dev/nvme0n1p3` for partition 3 of the first NVMe disk). | ||
|
|
||
| - Filesystems: | ||
| - Each partition is assigned a filesystem type and a mount point. | ||
| - For example, the `/boot/efi` partition is formatted with `fat32`, while `/boot` and `/` are formatted with `ext4`. | ||
|
|
||
| - ZFS (Optional): | ||
| - ZFS can be configured if wished. In this example, a ZFS mirror is created using partitions from two NVMe devices. | ||
| - ZFS options such as `ashift=12` can be included for performance tuning, but they are optional. | ||
|
|
||
| ### Simple configuration (No RAID or ZFS) | ||
|
|
||
| If you prefer a simpler configuration without RAID or ZFS, you can remove the `raids` and `zfs` sections. For example, if you only need a single disk setup with no RAID, declare just one disk with the partitions and filesystems as shown below: | ||
|
|
||
| ```json | ||
| { | ||
| "partitioning_schema": { | ||
| "disks": [ | ||
| { | ||
| "device": "/dev/nvme0n1", | ||
| "partitions": [ | ||
| { | ||
| "label": "swap", | ||
| "number": 1, | ||
| "size": 4294967296 | ||
| }, | ||
| { | ||
| "label": "boot", | ||
| "number": 2, | ||
| "size": 536870912 | ||
| }, | ||
| { | ||
| "label": "root", | ||
| "number": 3, | ||
| "size": 64424509440 | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "filesystems": [ | ||
| { | ||
| "device": "/dev/nvme0n1p2", | ||
| "format": "ext4", | ||
| "mountpoint": "/boot" | ||
| }, | ||
| { | ||
| "device": "/dev/nvme0n1p3", | ||
| "format": "ext4", | ||
| "mountpoint": "/" | ||
| } | ||
| ], | ||
| "raids": [], | ||
| "zfs": null, | ||
| "lvm": null | ||
| } | ||
| } | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.