Skip to main content

Plaivid Enterprise Storage Architecture and Configuration Document

Tip

Quick Guide for Professionals: If you only require executable commands, please refer to the Quick Reference section at the end of the document.

This document has been compiled based on Enterprise standards for the Plaivid virtualization environment and PVM infrastructure. The objective is the provisioning and management of storage space for use in the virtualization environment, including creating RAID, configuring LVM, and presenting the storage to PVM.

In PVM architecture, after creating a Volume Group (VG), there is no need to create filesystems such as ext4 or perform Mount operations to utilize it as Storage. In this architecture, the Volume Group is introduced directly to PVM in the Storage Manager section as Storage of type volume group, and storage space management is handled by PVM itself.

Subsequently, virtual machine disks on this Storage are created and managed as Logical Volume (LV); such that each virtual machine disk will have a corresponding LV in the Volume Group.

In case the storage space requires a File System, the method for creating and preparing the ext4 filesystem is also provided in this document so that the storage space can be used as a regular filesystem.

Warning

Important Note: This guide is written for storages that are already RAIDed (whether hardware or software) but have not yet been partitioned, formatted, or mounted at the operating system level. The objective is to connect these spaces to the server in a standard and secure manner for storing Plaivid virtual machine data as well as Backups.

Why is this document important?

Before anything else, we must understand why we cannot simply give a raw disk to the server and use it.

When a new disk (whether physical or RAIDed) is connected to the server, the operating system only sees a "piece of hardware"; something like an empty warehouse with no doors or windows. To be able to store anything inside this warehouse, we need a chain of tasks.

Info

Simple Problem Analysis:
Imagine you have bought a vacant lot (Raw RAIDed Disk). To prepare it in the Plaivid / PVM environment, you must:

  1. Prepare the basic structure of the disk if needed (Partitioning)
  2. Convert the storage space into a flexible and manageable structure (LVM)
  3. Introduce the created space as a Volume Group (VG) directly to PVM; in this state, there is no need to create a File System or Mount it.
  4. PVM creates and manages virtual machine disks on this Storage as Logical Volume (LV).
  5. If the storage space is needed as a filesystem, you can create ext4 on the desired space and Mount it.

Without each of these stages, the disk is unusable for the operating system and for Plaivid.

Mental Map: Architectural Overview

Before entering the details, we must have a complete mental map. This map tells you "where you are on the path" at each stage.

Creating RAID Logical DrivePhysical Disks + RAIDCreating RAID Logical DrivePreparing Disk for LVMPartitioningPreparing Disk for LVMPV -> VG -> LVLVM StackPV -> VG -> LVDirect Introduction of VG as StoragePVM StorageDirect Introduction of VG as StorageManagement as LV by PVMVirtual Machine DiskManagement as LV by PVM

Key Point: Each layer only communicates with the layer above and below it. If a problem occurs in one layer, the upper layers will not work. This principle is the basis of troubleshooting.

Basic Concepts

In this section, we explain each concept with three levels: Simple → Example → Technical.

What is Storage?

Note

In Simple Terms: Storage means "any place where we keep data". Like a warehouse for files.

Tangible Example: Your laptop hard drive, USB flash drive, camera memory card; all are storage. In an Enterprise server, storage is usually several disks combined as one larger and safer unit (RAID).

From a Technical View: In Linux, every storage device appears as a Block Device in the path /dev/; for example, /dev/sda, /dev/sdb, /dev/nvme0n1.

What is RAID and why is it important?

Note

In Simple Terms: RAID means "combining multiple disks so that speed increases, or if one disk fails, data is not lost".

RAID LevelRoleRedundancyApplication
RAID 0Speed onlyNoneTest / Non-sensitive environment
RAID 1MirrorYesOS Disk
RAID 5Stripe + ParityTolerates 1 diskGeneral Storage
RAID 6Stripe + Double ParityTolerates 2 disksLarge Storage
RAID 10Mirror + StripeHighSensitive DataStore / DB

From a Technical View: In HPE servers, RAID is managed by the Smart Array Controller and the management tool is ssacli. RAID is performed at the hardware level, and the operating system only sees an integrated Logical Drive (like /dev/sdb).

Warning

Important: This document assumes RAID has already been built. We only verify the RAID, not build it.

What is a Partition?

Note

In Simple Terms: Partition means "dividing a large disk into smaller parts". Like dividing a large apartment into several rooms.

Tangible Example: A 10TB disk can be divided into one 10TB partition (the whole disk) or several partitions like 2TB + 3TB + 5TB.

From a Technical View: There are two main types of partition tables:

  • MBR (Old): Max 2TB, max 4 Primary partitions.
  • GPT (Modern): Supports disks larger than 2TB, up to 128 partitions, Enterprise standard.
Danger

In an Enterprise environment, we always choose GPT. Because RAID disks are almost always larger than 2TB.

What is LVM and why is it critical?

Note

In Simple Terms: LVM means a layer of "flexibility" between the disk and the filesystem. With its help, you can increase or decrease storage space without losing data.

Tangible Example: Assume you have a room that is full. Without LVM, you have to move everything to make the room bigger. With LVM, you just push a wall forward and the room gets bigger — without touching the items inside.

Three Levels of LVM:

Disk Partition (/dev/sdb1)PV (Physical Volume)Disk Partition (/dev/sdb1)Centralized Storage PoolVG (Volume Group)Centralized Storage PoolVirtual Partition for Format/PVMLV (Logical Volume)Virtual Partition for Format/PVM

What is a Filesystem (ext4)?

Note

In Simple Terms: A Filesystem is a set of structures and rules that manage how files and folders are stored, organized, and accessed on storage space.

Why ext4?

  • A stable, mature, and widely used filesystem in Linux and Enterprise environments.
  • Supports large files and storage spaces.
  • Has Journaling capability which reduces the probability of filesystem inconsistency and corruption after sudden power loss or shutdown by logging filesystem changes.
  • For scenarios such as DataStore and BackupStore, if a filesystem is required, it is considered a suitable and common option.
Info

Note on PVM Architecture: For Volume Group based Storage in PVM, creating ext4 and performing Mount operations are not mandatory; the VG is managed directly by PVM as Storage. Using ext4 is relevant when the storage space is intended to be used as a regular File System.

What is Mounting?

Note

In Simple Terms: Mount means "connecting a storage space to a folder in the operating system". After mounting, whatever you write in that folder is actually stored on that disk.

Example: If we mount the LV on /plaivid/datastore, any file that Plaivid creates in this path is actually stored on the RAID disk.

Critical Note: Temporary mounting disappears after reboot. For permanent mounting, it must be registered in the /etc/fstab file.

Concepts Section Checkpoint

At this stage, you should be able to explain:

  • What is the difference between Partition and LVM?
  • Why is partitioning alone not enough?
  • Why does permanent mounting require fstab?

Prerequisites (Before Action)

Before starting, check these items:

#PrerequisiteWhy is it important?
1root or sudo accessAll commands require high privileges
2Install tools: parted, lvm2, e2fsprogs, ssacliMain tools of this document
3Verify healthy RAIDInstalling on broken RAID = disaster
4Target disk must be emptyNo important data on the disk
5Backup of fstabPreventing boot failure in case of error

Identifying Disks and Checking RAID

Important Principle: Before any action, we must ensure we are working on the "correct disk".

Displaying all connected disks

lsblk
lsblk -f
fdisk -l

Sample output of lsblk:

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 480G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 479G 0 part /
sdb 8:16 0 10T 0 disk ← Raw RAID disk without partition

Output Interpretation:

  • sda is the operating system disk (has partition, is mounted).
  • sdb is our target RAID disk: Has no partitions, is not mounted. This is what we must prepare.
Danger

Critical Warning: Before any operation, precisely note the name of the target disk. Executing a command on the wrong disk = Total data loss.

Checking RAID with ssacli

Objective: Ensure that the disk /dev/sdb is actually a healthy RAID Logical Drive.

# 1. List controllers
ssacli controller all show status

# 2. Display Logical Drives
ssacli controller slot=0 ld all show

# 3. Full details
ssacli controller slot=0 ld all show detail

# 4. Check physical disks
ssacli controller slot=0 pd all show status

Sample output:

Smart Array P408i-a in Slot 0
Controller Status: OK
Cache Status: OK
Battery/Capacitor Status: OK

Array A
logicaldrive 1 (10.0 TB, RAID 5, OK) ← Array status is healthy

Interpretation: If all statuses are OK, the RAID is healthy and we can continue. If you see Failed, Rebuilding, or Degraded, stop and fix the RAID problem first.

StatusMeaningAction
OKHealthyContinue
RebuildingRebuildingWait until finished
DegradedOne disk failed, RAID still worksReplace disk
FailedRAID is brokenRecover before any work
Disk Identification Checkpoint
  • Do you know the exact name of the target disk? (e.g., /dev/sdb)
  • Have you confirmed the RAID is healthy?
  • Have you confirmed the disk is empty?
    If the answer to all three is "Yes", proceed.

Partitioning (Two Methods)

In this section, we review two methods: parted and fdisk. Choose only one of these two — both yield the same result.

Why two methods?

ToolProsConsSuitable for
partedModern, Script-friendly, fastSyntax differs from old toolsAutomation, Enterprise environment
fdiskInteractive, familiar, default in all distrosRequires more skill for scriptingIndividuals familiar with traditional tools

Recommendation: In Plaivid, we prefer parted because it performs better in Automation. However, fdisk is also excellent for better understanding.

Method 1 — Partitioning with parted

# 1. Create GPT partition table
parted /dev/sdb mklabel gpt

# 2. Create partition (100% of whole disk)
parted /dev/sdb mkpart primary 0% 100%

# 3. Activate LVM flag
parted /dev/sdb set 1 lvm on

# 4. Verify structure
parted /dev/sdb print

Command Explanation:

  • mklabel gpt : Creates a GPT type partition table.
  • mkpart primary 0% 100% : Creates a Primary partition that takes the whole disk. Using 0% and 100% ensures the partition is aligned (best performance).
  • set 1 lvm on : Activates the LVM flag on partition 1 so LVM detects it.

Method 2 — Partitioning with fdisk

fdisk is interactive. Run the following command:

fdisk /dev/sdb

Inside the fdisk environment, enter these letters in order:

  • g : Create GPT partition table
  • n : New partition
  • 1 : Partition number
  • Enter : Start sector (default)
  • Enter : End sector (whole disk)
  • t : Change partition type
  • 31 : Select Linux LVM code in GPT
  • p : Display for confirmation
  • w : Write and exit
Note

In modern fdisk (util-linux), the Linux LVM type number in GPT is 31. If you don't know the number, type L in the t prompt to see the full list.

Verifying Partition

lsblk /dev/sdb
partprobe /dev/sdb # Notify kernel

Sample output:

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sdb 8:16 0 10T 0 disk
└─sdb1 8:17 0 10T 0 part ← Partition ready for LVM
``>

<Callout type="success" title="Partitioning Checkpoint">
Partition `/dev/sdb1` should be visible in the output of `lsblk`.
</Callout>

## Building LVM Architecture

It has three stages: **PV → VG → LV**. Each stage depends on the previous one.

### Creating Physical Volume (PV)

```bash
pvcreate /dev/sdb1
pvs # Display summary
pvdisplay /dev/sdb1 # Display details

Creating Volume Group (VG)

Naming Convention: We use vg_datastore for DataStore and vg_backupstore for BackupStore.

vgcreate vg_datastore /dev/sdb1
vgs
vgdisplay vg_datastore

After creating the Volume Group (VG), in the scenario of using LVM-based Storage in PVM, the main Storage structure is ready and the VG can be introduced directly in Storage Manager as Storage of type volume group. Therefore, to prepare Storage for use in PVM, continuing LVM stages such as manual LV creation is not mandatory; PVM manages virtual machine disks as LV.

If your goal is to become more familiar with the LVM structure and manual management of Logical Volume (LV), or if the storage space is intended to be used as a File System, you can read the subsequent sections of the document.

If File System Creation is Required

From this point onwards, you can continue if you need to create a file system.

Creating Logical Volume (LV)

lvcreate -l 100%FREE -n lv_datastore vg_datastore
lvs
lvdisplay /dev/vg_datastore/lv_datastore

Parameter Explanation:

  • -l 100%FREE : Use all free space of the VG.
  • -n lv_datastore : Name of the Logical Volume.
  • Final output path: /dev/vg_datastore/lv_datastore
Tip

Why 100%FREE? In the Plaivid environment, usually one VG is used for a specific purpose (DataStore or BackupStore), so it makes sense for all space to be in one LV. If you want to create multiple LVs, use -L 500G (e.g., 500 Gigabytes).

LVM Construction Checkpoint

The output of lvs should display your LV with the correct size.

Formatting with ext4

Now the LV is ready, but it is not yet "writable" because it lacks a filesystem.

mkfs.ext4 -L datastore /dev/vg_datastore/lv_datastore

Explanation:

  • -L datastore : We give a Label to the filesystem (useful for identification).
  • Formatting on LVs is fast (a few seconds to minutes depending on size).

Getting UUID (for fstab):

blkid /dev/vg_datastore/lv_datastore

Sample output:

/dev/vg_datastore/lv_datastore: LABEL="datastore" UUID="a1b2c3d4-5678-90ab-cdef-1234567890ab" TYPE="ext4"
``>

Copy this UUID — you will need it in the next section.

<Callout type="info">
**From a Technical View:** UUID is a unique identifier for the filesystem that never changes. Using UUID instead of `/dev/sdX` ensures that even if the order of disks changes in the system (e.g., after hardware replacement), Mounting will still work correctly.
</Callout>

## Mounting (Temporary and Permanent)

### Creating Mount Point

```bash
mkdir -p /plaivid/datastore

Temporary Mount (Test)

mount /dev/vg_datastore/lv_datastore /plaivid/datastore
df -hT | grep datastore

If the corresponding line is seen with type ext4 and correct size, the test was successful. For temporary removal:

umount /plaivid/datastore

Permanent Mount via fstab

Before any change to fstab, definitely take a backup.

cp /etc/fstab /etc/fstab.bak.$(date +%F)

Adding entry to fstab:

Edit the file /etc/fstab and add the following line to the end of it:

/etc/fstab
UUID=a1b2c3d4-5678-90ab-cdef-1234567890ab /plaivid/datastore ext4 defaults,nofail 0 2

Column Explanation:

ColumnValueDescription
1 — DeviceUUID=...Unique identifier of the filesystem
2 — Mount Point/plaivid/datastoreMount path
3 — Typeext4Filesystem type
4 — Optionsdefaults,nofailMount options
5 — Dump0Backup by dump (disabled)
6 — fsck2Order of fsck check during boot
Warning

Why nofail? If someday this disk is unavailable, the operating system will still boot (prevents boot loop). Very important for DataStore and BackupStore.

Testing fstab before reboot (Critical):

findmnt --verify --verbose
mount -a
df -hT | grep datastore
Danger

Critical Warning: If you reboot the server without testing and the fstab entry is incorrect, the system might come up in emergency mode. Always test with mount -a and findmnt --verify.

Final Testing

Before handing over to Plaivid, perform these tests:

# 1. Check free space
df -hT /plaivid/datastore

# 2. Write test (100MB)
dd if=/dev/zero of=/plaivid/datastore/testfile bs=1M count=100

# 3. Clean up test file
rm -f /plaivid/datastore/testfile

# 4. Reboot test (recommended)
reboot

# After server comes up:
df -hT | grep datastore

BackupStore Scenario

Difference from DataStore: BackupStore is the location for keeping backup copies. The steps are exactly the same as DataStore, just with different names.

Standard Naming Table:

ItemDataStoreBackupStore
VG Namevg_datastorevg_backupstore
LV Namelv_datastorelv_backupstore
Mount Point/plaivid/datastore/plaivid/backupstore
Labeldatastorebackupstore
Speed PriorityHigh (VM Live)Medium
Recommended RAIDRAID 10RAID 5 or 6

BackupStore Commands Summary (Assumption: disk /dev/sdc):

parted /dev/sdc mklabel gpt
parted /dev/sdc mkpart primary 0% 100%
parted /dev/sdc set 1 lvm on
pvcreate /dev/sdc1
vgcreate vg_backupstore /dev/sdc1
lvcreate -l 100%FREE -n lv_backupstore vg_backupstore
mkfs.ext4 -L backupstore /dev/vg_backupstore/lv_backupstore
mkdir -p /plaivid/backupstore
blkid /dev/vg_backupstore/lv_backupstore

# Add UUID in /etc/fstab, then:
mount -a
df -hT | grep backupstore

Troubleshooting (Diagnostic Thinking)

Golden Rule of Troubleshooting: Move from bottom to top. If there is a problem with Mounting, the root might be in LVM, Partition, or even RAID.

ssacli / lsblkCheck RAID / Diskssacli / lsblkparted printCheck Partitionparted printpvs / vgs / lvsCheck LVM Layerpvs / vgs / lvse2fsck -fCheck Filesysteme2fsck -fblkid / findmntCheck fstab and UUIDblkid / findmnt

Common Scenarios

SymptomProbable CauseSolution
Disk not in lsblkBroken RAID / Empty Slotssacli controller slot=0 pd all show
Partition not createdOld partition tablewipefs -a /dev/sdX then try again
pvcreate says device busyOld LVM mappingdmsetup remove_all then try again
No Mount after rebootError in fstabjournalctl -xe + findmnt --verify
Emergency mode after rebootWrong fstabEnter with mount -o remount,rw / and fix fstab
mount says "wrong fs type"Filesystem corrupted or not formattedCheck blkid, run e2fsck

Key Troubleshooting Commands

journalctl -xe # System logs
dmesg | grep -i -E 'sd|error' # Kernel logs
e2fsck -f /dev/vg_datastore/lv_datastore # Check filesystem
vgchange -ay # Activate VG
findmnt --verify --verbose # Test fstab
ssacli controller slot=0 ld all show detail # Check RAID details

Emergency Mode: How to rescue wrong fstab?

If the server entered emergency mode due to a fstab error, execute the following commands:

# 1. Remount root partition as writable
mount -o remount,rw /

# 2. Restore fstab backup file
cp /etc/fstab.bak.YYYY-MM-DD /etc/fstab

# 3. Reboot system
systemctl reboot

Best Practices

  • Always UUID, not /dev/sdX: Disk order may change. UUID is unique and stable.
  • Use nofail in fstab: Prevents boot failure if disk is inaccessible.
  • Semantic Naming: vg_datastore is better than vg_data. Names should indicate the purpose.
  • Backup fstab: Before any change: cp /etc/fstab /etc/fstab.bak.$(date +%F)
  • Test before reboot: Always run mount -a and findmnt --verify before rebooting.
  • RAID Monitoring: Weekly check with ssacli ctrl all show status to gauge disk health.

Common Mistakes

Danger

Mistake: Formatting disk directly without Partition and LVM.
Why it's wrong: In the future, expansion (Extend) will not be possible. Everything must be rebuilt.
Correct Way: Always use the chain Partition → PV → VG → LV → FS.

Danger

Mistake: Entering /dev/sdb1 in fstab.
Why it's wrong: With changing disk order, Mount will break.
Correct Way: Use UUID.

Future Storage Expansion (Bonus)

One of the biggest advantages of LVM: Expansion without Downtime. If a new disk is added in the future, it can easily be added to the VG.

# 1. Prepare new disk (e.g., /dev/sdd)
parted -s /dev/sdd mklabel gpt
parted -s /dev/sdd mkpart primary 0% 100%
parted -s /dev/sdd set 1 lvm on
pvcreate /dev/sdd1

# 2. Add to existing VG
vgextend vg_datastore /dev/sdd1

# 3. Expand LV to all new space
lvextend -l +100%FREE /dev/vg_datastore/lv_datastore

# 4. Expand filesystem (without unmount!)
resize2fs /dev/vg_datastore/lv_datastore

# 5. Verify
df -hT /plaivid/datastore
Tip

Magic of LVM: This entire operation is performed without interrupting the Plaivid service. VMs are still running, and in the end, the new space becomes available to Plaivid.

Teach-Back Questions (Comprehension Assessment)

If you can answer these questions, you have truly learned the concept:

Comprehension and Mastery Assessment
  1. Why do we always use LVM in Enterprise instead of simple partitioning?
  2. If after a server reboot, Mounting doesn't work and the disk is not in lsblk, where do you start?
  3. Explain the difference between PV, VG, and LV with a daily life example.
  4. Why do we use UUID in fstab and not /dev/sdb1?
  5. If a RAID disk is in Degraded mode, are you allowed to partition it? Why?
  6. If you want to double the DataStore space without shutting down the server, what steps do you take?
  7. Why is the nofail option critical for DataStore in fstab but not for /?

Challenging Scenario

Real Operational Scenario

Scenario:
A colleague tells you:

"The Plaivid server did not come up after Reboot and entered Emergency Mode. To mount a disk, I had added an entry for /dev/sdb1 in /etc/fstab because the UUID was too long."

Questions:

  • What is the root cause of the problem?
  • How do you rescue the server?
  • What recommendation do you make to prevent recurrence of this problem?

Configuration Analysis:

Using /dev/sdb1 in the /etc/fstab file, without using UUID and the nofail option, can cause two serious problems during the Boot process:

  1. Dependency on Device Naming: The disk detection order may change, and consequently, the path /dev/sdb1 may no longer point to the desired disk or may not exist at all.

  2. Boot Disruption: In case of disk unavailability, systemd may detect the Mount as failed and enter Emergency Mode.

Recovery Path:

In the event of this situation, one can enter the system via Emergency Mode, re-mount the Root filesystem as rw, restore the fstab backup, and then Reboot the system.

Operational Recommendation:

To prevent dependency on device name and reduce the risk of Boot disruption, using UUID for disk identification and the nofail option for non-critical Mounts is recommended.

Quick Reference — Quick Reference for Professionals

If you are familiar with LVM, partitioning, and fstab concepts and are only looking for quick execution, this section is for you. All commands in execution order at a glance.

Changeable Variables

VariableDefault ValueDescription
<DISK>/dev/sdbTarget RAID disk
<VG>vg_datastoreVolume Group Name
<LV>lv_datastoreLogical Volume Name
<MOUNT>/plaivid/datastoreMount Path
<LABEL>datastoreFilesystem Label

Full Execution Checklist

# ── 0. Pre-flight ──────────────────────────────
ssacli controller slot=0 ld all show # RAID health
lsblk # confirm target disk
cp /etc/fstab /etc/fstab.bak.$(date +%F) # backup fstab

# ── 1. Partition (GPT + LVM flag) ──────────────
parted -s /dev/sdb mklabel gpt
parted -s /dev/sdb mkpart primary 0% 100%
parted -s /dev/sdb set 1 lvm on
partprobe /dev/sdb

# ── 2. LVM stack ───────────────────────────────
pvcreate /dev/sdb1
vgcreate vg_datastore /dev/sdb1
lvcreate -l 100%FREE -n lv_datastore vg_datastore

# ── 3. Filesystem ──────────────────────────────
mkfs.ext4 -L datastore /dev/vg_datastore/lv_datastore

# ── 4. Mount point + fstab (UUID-based) ────────
mkdir -p /plaivid/datastore
UUID=$(blkid -s UUID -o value /dev/vg_datastore/lv_datastore)
echo "UUID=$UUID /plaivid/datastore ext4 defaults,nofail 0 2" >> /etc/fstab

# ── 5. Verify BEFORE reboot ────────────────────
findmnt --verify --verbose
mount -a
df -hT | grep datastore

Quick Validation Checklist

After execution, confirm these four items:

  • Output of lsblk shows partition sdb1.
  • Output of vgs and lvs shows VG and LV with correct size.
  • Output of df -hT displays the Mount path with type ext4 and correct size.
  • Output of findmnt --verify is error-free.

Summary

  • Storage Layer Structure: Strictly observing the chain order (RAID → Partition → LVM → FS → Mount) is mandatory to guarantee the stability of the operating system and Plaivid.
  • Difference in PVM Architecture: To introduce Storage to PVM, creating a Volume Group (VG) is sufficient, and there is no need for ext4 format or Mount on that same layer manually.
  • Configuration Security: Always use UUID and the nofail expression in the /etc/fstab file, and accept its validity before rebooting with findmnt --verify and mount -a.
  • Online Flexibility: Thanks to the LVM layer, you can expand virtual machine storage space in the future without service downtime (Downtime).