Change NVME LBA Size (Optional)
Since we are about to deploy AnduinOS on a machine, and you may have a NVME SSD with 512 bytes Logical Block Addressing (LBA) size, we recommend changing it to 4K (4096 bytes) LBA size for better performance.
💡 This is fully optional
If you are not sure about the LBA size of your NVME SSD, you can skip this step. AnduinOS will work fine with both 4K and 512 bytes LBA size. This step is only for performance improvement.
This guide will walk you through changing your NVMe drive to use a 4K (4096 bytes) Logical Block Addressing (LBA) format. Please note that this procedure will erase all data on the drive. Make sure to back up any important information beforehand.
It is suggested to execute this step before installing AnduinOS and In the live environment (e.g., using a live USB). This way, you can ensure the drive is formatted correctly before proceeding with the installation.
1. Install Required Tools
First install nvme-cli (and update your package list if needed):
sudo apt update
sudo apt install nvme-cli
2. Identify Your NVMe Device
List all drives to identify your NVMe device:
sudo fdisk -l
Confirm your NVMe device (often named /dev/nvme0n1, but could differ). You can also run:
nvme list
This should display details about your NVMe devices.
Check current LBA formats:
nvme id-ns /dev/nvme0n1 --human-readable
Look for lines like:
LBA Format 0 : Metadata Size: 0 bytes - Data Size: 512 bytes - Relative Performance: 0x2 Good (in use)
LBA Format 1 : Metadata Size: 0 bytes - Data Size: 4096 bytes - Relative Performance: 0x1 Better
For some disks, it may show that no better format is available. It's only suggested to continue if you see a better format available.
In the example above, the drive has two LBA formats available. We want the 4K format, usually shown as lbaf=1.
3. Perform the Format Operation
Warning: The following command destroys all data on the NVMe device. Double-check the device name and ensure you have a full backup.
- Execute the format command:
⚠️ Backup your data before running this command!
Formatting the drive will erase all data. Make sure to back up any important information beforehand.
And do NOT use dd to backup the drive because changing the LBA size will make the backup unusable.
sudo nvme format /dev/nvme0n1 --lbaf=1 --ses=0
--lbaf=1selects the 4K LBA format.--ses=0performs a format without secure erase (faster). You can use--ses=1for a more thorough erase if desired.
- Wait for the format to complete. The device should now be in 4K mode internally.
4. Verify the Result
Before proceeding with the installation, verify that your NVMe now uses a 4K LBA format:
nvme id-ns /dev/nvme0n1 --human-readable
Look for the active LBA Format:
LBA Format 1 : Metadata Size: 0 bytes - Data Size: 4096 bytes ...
If you see 4096 bytes as the data size, then the drive is using 4K blocks successfully.
5. Proceed with AnduinOS Installation
Since you are running this in the Live environment before installing AnduinOS, you do not need to manually partition or format the drive.
- Close the terminal.
- Launch the AnduinOS Installer from the desktop.
- Proceed through the setup steps. When you reach the disk partitioning screen, select Erase Disk and choose your NVMe drive.
The installer will automatically create a new GPT partition table, set up the EFI partition, and format the system partitions perfectly utilizing your newly configured 4K block size.
6. Summary
- Backup all important data beforehand.
- Use
nvme formatwith the correct--lbafoption to switch to a 4K LBA format. - Confirm with
nvme id-nsthat the LBA format is set to 4096 bytes. - Launch the AnduinOS installer and select Erase Disk to let it handle partitioning automatically.
You now have your NVMe device configured to 4K LBA, which will provide optimal performance and longevity for your AnduinOS system.
Comments (0)
No comments yet. Be the first to leave one!