I’m very sorry that I haven’t written anything for a long time, but I have a lot of work on my head and other obligations. I hope that this article will make up for the wait and the next ones will be soon.
In the world of cloud computing, managing disk partitions and formatting can be a cumbersome task, especially when dealing with multiple instances or machines. Automating this process not only saves time but also ensures consistency and reduces the risk of human error. This article explores a comprehensive solution for automating disk partitioning and formatting on both Windows and Linux systems using cloud-init scripts.
Introduction
Cloud-init is a powerful tool used to initialize cloud instances. It can automate various configuration tasks, including disk management. This article will delve into cloud-init scripts tailored for both Windows and Linux systems to handle disk partitioning and formatting.
Sample add disk into VM
diskConfig:
type: array
title: Add Additional Disks
minItems: 0
maxItems: 14
items:
type: object
properties:
controller:
type: string
title: SCSI Controller
enum:
- SCSI_Controller_0
- SCSI_Controller_1
- SCSI_Controller_2
- SCSI_Controller_3
default: SCSI_Controller_0
unit:
type: integer
title: Unit Number
enum:
- 1
- 2
- 3
- 4
- 5
- 6
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
size:
type: number
title: Size GB
default: 5
maximum: 200
formatDisk:
type: boolean
title: Format disk?
default: false
drive:
type: string
title: Mountpoint/Drive Letter
label:
type: string
title: Disk Label
resources:
disks:
type: Cloud.vSphere.Disk
allocatePerInstance: true
properties:
capacityGb: ${input.diskConfig[count.index].size}
name: ${input.diskConfig[count.index].label}
SCSIController: ${input.diskConfig[count.index].controller}
unitNumber: ${to_string(input.diskConfig[count.index].unit)}
drive: ${to_string(input.diskConfig[count.index].drive)}
label: ${to_string(input.diskConfig[count.index].label)}
count: ${length(input.diskConfig)}
Cloud_vSphere_Machine_1:
type: Cloud.vSphere.Machine
properties:
attachedDisks: ${map_to_object(resource.disks[*].id, "source")}
Cloud-Init for Windows
Overview
The Windows cloud-init script leverages PowerShell and a JSON configuration file to specify disk details, making the process flexible and easy to manage. Here’s a breakdown of the script’s components and functionality.
Writing Configuration Files
The script begins by writing the necessary configuration files to the system
#cloud-config
write_files:
- content: |
${input.diskConfig}
path: C:\Scripts\diskConfig.json
permissions: '0644'
- content: |
$diskConfigJson = Get-Content -Path C:\Scripts\diskConfig.json -Raw
$logFile = "C:\Scripts\PartitionDisks.log"
...
path: C:\Scripts\PartitionDisks.ps1
permissions: '0644'
Explanation:
1. **diskConfig.json**: This file contains the JSON configuration that defines the disks to be partitioned and formatted.
– **Path**: The file is saved at `C:\Scripts\diskConfig.json`.
– **Permissions**: `0644` ensures the file is readable by everyone but writable only by the owner.
2. **PartitionDisks.ps1**: This PowerShell script processes the JSON configuration and performs the partitioning and formatting tasks.
– **Path**: The script is saved at `C:\Scripts\PartitionDisks.ps1`.
– **Permissions**: `0644` ensures the file is readable by everyone but writable only by the owner.
PowerShell Script Breakdown
The PowerShell script is responsible for reading the JSON configuration, matching disks, and performing the necessary operations.
Reading Configuration and Logging
$diskConfigJson = Get-Content -Path C:\Scripts\diskConfig.json -Raw
$logFile = "C:\Scripts\PartitionDisks.log"
function Log {
param (
[string]$message
)
$timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
$entry = "$timestamp $message"
Add-Content -Path $logFile -Value $entry
}
Explanation:
– **Reading Configuration**: The script reads the content of `diskConfig.json` into a variable `$diskConfigJson`.
– **Logging**: A `Log` function is defined to write log messages with timestamps to `PartitionDisks.log`. This function helps track the script’s execution and troubleshoot issues.
Matching Disks
function Match-Disk {
param (
[int]$Size,
[int]$Unit
)
$disks = Get-Disk | Where-Object { $_.OperationalStatus -eq 'Offline' }
foreach ($disk in $disks) {
Log "Checking disk - Number: $($disk.Number) Size: $($disk.Size) Location: $($disk.Location)"
$unitMatch = $disk.Location -like "*Target $($Unit)*"
Log "Unit Match: $unitMatch"
}
$matchedDisks = $disks | Where-Object { $_.Size -eq ($Size * 1GB) -and $_.Location -like "*Target $($Unit)*" }
return $matchedDisks
}
Explanation:
– **Function Definition**: `Match-Disk` is defined to find disks based on size and unit.
– **Parameters**:
– `$Size`: Size of the disk to match (in GB).
– `$Unit`: Unit identifier to match within the disk location.
– **Finding Disks**: The script retrieves all offline disks and logs their details.
– **Matching Criteria**: The script checks each disk to see if its size and unit match the specified criteria. Matched disks are returned for further processing.
Main Process
foreach ($disk in $diskConfig) {
try {
if (-not $disk.formatDisk) {
Log "Skipping disk: Controller: $($disk.controller) Unit: $($disk.unit) Size: $($disk.size) Drive: $($disk.drive) Label: $($disk.label) as formatDisk is set to false"
continue
}
Log "Input values for disk: Controller: $($disk.controller) Unit: $($disk.unit) Size: $($disk.size) Format: $($disk.formatDisk) Drive: $($disk.drive) Label: $($disk.label)"
Log "Matching criteria - Size: $($disk.size * 1GB) Unit: $($disk.unit)"
$matchingDisks = Match-Disk -Size $disk.size -Unit $disk.unit
if ($matchingDisks.Count -eq 0) {
Log "No matching disk found for $($disk.label). Skipping."
continue
}
$diskObj = $matchingDisks | Select-Object -First 1
$diskNumber = $diskObj.Number
Log "Found matching disk: $diskNumber Details: Size: $($diskObj.Size) Location: $($diskObj.Location)"
$diskObj | Set-Disk -IsOffline $false
$diskObj | Set-Disk -IsReadOnly $false
if ($diskObj.PartitionStyle -eq 'RAW') {
Initialize-Disk -Number $diskNumber -PartitionStyle GPT -PassThru | Out-Null
Log "Initialized disk: $diskNumber"
} else {
Log "Disk $diskNumber already initialized."
}
$partition = New-Partition -DiskNumber $diskNumber -UseMaximumSize -AssignDriveLetter | Out-Null
$driveLetter = (Get-Partition -DiskNumber $diskNumber | Get-Volume).DriveLetter
Log "Created partition on disk: $diskNumber with DriveLetter $driveLetter"
if ($null -ne $disk.drive -and $driveLetter -ne $disk.drive) {
$partitionNumber = (Get-Partition -DiskNumber $diskNumber).PartitionNumber
try {
Remove-PartitionAccessPath -DiskNumber $diskNumber -PartitionNumber $partitionNumber -AccessPath "$driveLetter`:"
} catch {
Log "Failed to remove partition access path for drive letter $driveLetter. Error: $_"
}
try {
Add-PartitionAccessPath -DiskNumber $diskNumber -PartitionNumber $partitionNumber -AccessPath "$($disk.drive):"
$driveLetter = $disk.drive
Log "Assigned drive letter $driveLetter to disk: $diskNumber"
} catch {
Log "Failed to add partition access path for drive letter $($disk.drive). Error: $_"
}
}
if ($disk.formatDisk -and $null -ne $driveLetter) {
try {
Format-Volume -DriveLetter $driveLetter -FileSystem NTFS -NewFileSystemLabel $disk.label | Out-Null
Log "Formatted partition on disk: $diskNumber with label $($disk.label)"
} catch {
Log "Failed to format volume. Error: $_"
}
$volume = Get-Volume -DriveLetter $driveLetter
if ($volume.FileSystemLabel -ne $disk.label) {
Log "Failed to label the volume correctly. Attempting to set label again."
try {
Set-Volume -DriveLetter $driveLetter -NewFileSystemLabel $disk.label | Out-Null
} catch {
Log "Failed to set volume label. Error: $_"
}
$volume = Get-Volume -DriveLetter $driveLetter
if ($volume.FileSystemLabel -ne $disk.label) {
Log "Failed to label the volume correctly after retry. Trying to remove and reassign drive letter."
try {
Remove-PartitionAccessPath -DiskNumber $diskNumber -PartitionNumber $partitionNumber -AccessPath "$driveLetter`:"
} catch {
Log "Failed to remove partition access path during relabeling. Error: $_"
}
try {
Add-PartitionAccessPath -DiskNumber $diskNumber -PartitionNumber $partitionNumber -AccessPath "$($disk.drive):"
} catch {
Log "Failed to add partition access path during relabeling. Error: $_"
}
try {
Format-Volume -DriveLetter $driveLetter -FileSystem NTFS -NewFileSystemLabel $disk.label | Out-Null
$volume = Get-Volume -DriveLetter $driveLetter
if ($volume.FileSystemLabel -ne $disk.label) {
Log "Failed to label the volume correctly after all retries."
} else {
Log "Successfully labeled the volume after retry."
}
} catch {
Log "Failed to format volume during relabeling. Error: $_"
}
}
}
}
} catch {
Log "Error processing disk $($disk.label): $_"
}
}
Log "Disk partitioning and formatting process completed."
Explanation:
– **Iteration**: The script iterates over each disk configuration in the JSON file.
– **Skipping Disks**: If `formatDisk
` is `false`, the disk is skipped.
– **Logging Input Values**: Logs the input values and matching criteria for each disk.
– **Matching Disks**: Calls `Match-Disk` to find matching disks based on size and unit.
– **Processing Matched Disks**: For each matched disk:
– **Online and Writable**: Sets the disk online and writable.
– **Initialization**: Initializes the disk if it’s in RAW state.
– **Partitioning**: Creates a partition and assigns a drive letter.
– **Drive Letter Assignment**: Changes the drive letter if specified.
– **Formatting**: Formats the volume with NTFS and sets the filesystem label.
– **Retry Mechanism**: Attempts to set the label correctly even if initial attempts fail.
Running the Script
runcmd:
- powershell.exe -ExecutionPolicy Bypass -File C:\Scripts\PartitionDisks.ps1
Explanation:
– **Execution**: The `runcmd` section executes the PowerShell script with an execution policy bypass to avoid script execution restrictions.
Cloud-Init for Linux
Overview
The Linux cloud-init script uses a shell script along with a JSON configuration file to automate disk management.
Writing Configuration Files
Similar to the Windows setup, the Linux script writes the configuration files to the system:
cloudConfig: |
#cloud-config
write_files:
- content: |
${input.diskConfig}
path: /scripts/diskConfig.json
permissions: '0644'
- content: |
#!/bin/bash
...
path: /scripts/PartitionDisks.sh
permissions: '0755'
Explanation:
1. **diskConfig.json**: Contains the JSON configuration that defines the disks to be partitioned and formatted.
– **Path**: The file is saved at `/scripts/diskConfig.json`.
– **Permissions**: `0644` ensures the file is readable by everyone but writable only by the owner.
2. **PartitionDisks.sh**: This shell script processes the JSON configuration and performs the partitioning and formatting tasks.
– **Path**: The script is saved at `/scripts/PartitionDisks.sh`.
– **Permissions**: `0755` ensures the file is executable by everyone but writable only by the owner.
Shell Script Breakdown
The shell script handles reading the configuration, matching disks, and performing the necessary operations.
Logging Function
#!/bin/bash
CONFIG_FILE="/scripts/diskConfig.json"
LOG_FILE="/scripts/PartitionDisks.log"
function log {
local message=$1
local timestamp=$(date +"%Y-%m-%d %H:%M:%S")
echo "$timestamp $message" >> $LOG_FILE
}
log "Starting disk partitioning and formatting process."
log "Reading diskConfig JSON from $CONFIG_FILE"
if [[ ! -f $CONFIG_FILE ]]; then
log "Configuration file not found: $CONFIG_FILE"
exit 1
fi
disk_config=$(cat $CONFIG_FILE)
log "Raw diskConfig JSON: $disk_config"
Explanation:
– **Log Function**: Defines a function to log messages with timestamps to `PartitionDisks.log`.
– **Initial Logs**: Logs the start of the process and checks for the existence of the configuration file.
– **Reading Configuration**: Reads the content of `diskConfig.json` into a variable `disk_config`.
Matching Disks
function match_disk {
local size=$1
local unit=$2
local matched_disk=""
for disk in $(lsblk -dn -o NAME,SIZE); do
disk_name=$(echo $disk | awk '{print $1}')
disk_size=$(echo $disk | awk '{print $2}')
disk_size_gb=$(echo $disk_size | grep -oE '[0-9]+')
disk_size_unit=$(echo $disk_size | grep -oE '[A-Z]+')
if [[ $disk_size_unit == "G" ]]; then
log "Checking disk: $disk_name Size: $disk_size_gb GB"
if [[ $disk_size_gb -eq $size ]]; then
log "Found size match for disk: $disk_name"
disk_unit=$(udevadm info --query=property --name=$disk_name | grep "ID_PATH=" | sed 's/.*-scsi-[0-9]:[0-9]:\([0-9]\):.*/\1/')
log "Disk: $disk_name Unit: $disk_unit"
if [[ $disk_unit -eq $unit ]]; then
matched_disk=$disk_name
log "Matching disk found: $disk_name Size: $disk_size_gb GB Unit: $unit"
break
fi
fi
fi
done
echo $matched_disk
}
Explanation:
– **Function Definition**: `match_disk` is defined to find disks based on size and unit.
– **Parameters**:
– `size`: Size of the disk to match (in GB).
– `unit`: Unit identifier to match within the disk location.
– **Finding Disks**: The script retrieves all disk names and sizes.
– **Matching Criteria**: The script checks each disk to see if its size and unit match the specified criteria. The first matched disk is returned for further processing.
Processing Disk Configuration
IFS=$'\n'
for disk in $(echo $disk_config | jq -c '.[]'); do
controller=$(echo $disk | jq -r '.controller')
unit=$(echo $disk | jq -r '.unit')
size=$(echo $disk | jq -r '.size')
format_disk=$(echo $disk | jq -r '.formatDisk')
drive=$(echo $disk | jq -r '.drive')
label=$(echo $disk | jq -r '.label')
if [[ $format_disk == "false" ]]; then
log "Skipping disk: Controller: $controller Unit: $unit Size: $size Drive: $drive Label: $label as formatDisk is set to false"
continue
fi
log "Input values for disk: Controller: $controller Unit: $unit Size: $size Format: $format_disk Drive: $drive Label: $label"
log "Matching criteria - Size: ${size}GB Unit: $unit"
matching_disk=$(match_disk $size $unit)
if [[ -z $matching_disk ]]; then
log "No matching disk found for $label. Skipping."
continue
fi
log "Found matching disk: $matching_disk"
pv_name="/dev/${matching_disk}"
vg_name="vg_${drive//\//_}"
lv_name="lv_${drive//\//_}"
log "Creating physical volume on $pv_name"
pvcreate $pv_name
log "Creating volume group $vg_name"
vgcreate $vg_name $pv_name
log "Creating logical volume $lv_name"
lvcreate -l 100%FREE -n $lv_name $vg_name
log "Formatting logical volume $lv_name with label $label"
mkfs.ext4 -L $label /dev/$vg_name/$lv_name
mount_point="$drive"
log "Creating mount point $mount_point"
mkdir -p $mount_point
mount /dev/$vg_name/$lv_name $mount_point
echo "/dev/$vg_name/$lv_name $mount_point ext4 defaults 0 0" >> /etc/fstab
log "Formatted and mounted /dev/$vg_name/$lv_name on $mount_point with label $label"
done
log "Disk partitioning and formatting process completed."
Explanation:
– **Iteration**: The script iterates over each disk configuration in the JSON file.
– **Skipping Disks**: If `format_disk` is `false`, the disk is skipped.
– **Logging Input Values**: Logs the input values and matching criteria for each disk.
– **Matching Disks**: Calls `match_disk` to find matching disks based on size and unit.
– **Processing Matched Disks**: For each matched disk:
– **Physical Volume**: Creates a physical volume on the matched disk.
– **Volume Group**: Creates a volume group for the disk.
– **Logical Volume**: Creates a logical volume within the volume group.
– **Formatting**: Formats the logical volume with ext4 and sets the filesystem label.
– **Mounting**: Creates a mount point, mounts the volume, and updates `/etc/fstab` for persistent mounting.
Running the Script
runcmd:
- bash /scripts/PartitionDisks.sh
Explanation:
– **Execution**: The `runcmd` section executes the shell script to start the disk partitioning and formatting process.
Conclusion
Automating disk partitioning and formatting using cloud-init scripts simplifies the management of cloud instances. By leveraging the power of cloud-init, administrators can ensure consistent and error-free disk setup across multiple instances, whether on Windows or Linux systems. This approach not only saves time but also enhances reliability and scalability in cloud environments.
Sample Logs
Windows
2024-07-24 14:48:37 Starting disk partitioning and formatting process.
2024-07-24 14:48:38 Raw diskConfig JSON: [{"controller":"SCSI_Controller_0","unit":1,"size":5,"formatDisk":false},{"controller":"SCSI_Controller_0","unit":2,"size":6,"formatDisk":true,"drive":"K","label":"Kilo"},{"controller":"SCSI_Controller_0","unit":3,"size":7,"formatDisk":false},{"controller":"SCSI_Controller_0","unit":4,"size":8,"formatDisk":true,"drive":"Q","label":"Qwerty"}]
2024-07-24 14:48:38 Skipping disk: Controller: SCSI_Controller_0, Unit: 1, Size: 5, Drive: , Label: as formatDisk is set to false
2024-07-24 14:48:39 Input values for disk: Controller: SCSI_Controller_0, Unit: 2, Size: 6, Format: True, Drive: K, Label: Kilo
2024-07-24 14:48:39 Matching criteria - Size: 6442450944, Unit: 2
2024-07-24 14:48:24 Checking disk - Number: 1, Size: 5368709120, Location: PCI Slot 160 : Bus 3 : Device 0 : Function 0 : Adapter 0 : Port 0 : Target 1 : LUN 0
2024-07-24 14:48:24 Unit Match: False
2024-07-24 14:48:24 Checking disk - Number: 2, Size: 6442450944, Location: PCI Slot 160 : Bus 3 : Device 0 : Function 0 : Adapter 0 : Port 0 : Target 2 : LUN 0
2024-07-24 14:48:24 Unit Match: True
2024-07-24 14:48:24 Checking disk - Number: 3, Size: 7516192768, Location: PCI Slot 160 : Bus 3 : Device 0 : Function 0 : Adapter 0 : Port 0 : Target 3 : LUN 0
2024-07-24 14:48:24 Unit Match: False
2024-07-24 14:48:24 Checking disk - Number: 4, Size: 8589934592, Location: PCI Slot 160 : Bus 3 : Device 0 : Function 0 : Adapter 0 : Port 0 : Target 4 : LUN 0
2024-07-24 14:48:24 Unit Match: False
2024-07-24 14:48:24 Found matching disk: 2, Details: Size: 6442450944, Location: PCI Slot 160 : Bus 3 : Device 0 : Function 0 : Adapter 0 : Port 0 : Target 2 : LUN 0
2024-07-24 14:48:25 Initialized disk: 2
2024-07-24 14:48:26 Created partition on disk: 2 with DriveLetter E
2024-07-24 14:48:27 Assigned drive letter K to disk: 2
2024-07-24 14:48:27 Formatted partition on disk: 2 with label Kilo
2024-07-24 14:48:27 Failed to label the volume correctly. Attempting to set label again.
2024-07-24 14:48:28 Failed to label the volume correctly after retry. Trying to remove and reassign drive letter.
2024-07-24 14:48:31 Successfully labeled the volume after retry.
2024-07-24 14:48:31 Skipping disk: Controller: SCSI_Controller_0, Unit: 3, Size: 7, Drive: , Label: as formatDisk is set to false
2024-07-24 14:48:31 Input values for disk: Controller: SCSI_Controller_0, Unit: 4, Size: 8, Format: True, Drive: Q, Label: Qwerty
2024-07-24 14:48:31 Matching criteria - Size: 8589934592, Unit: 4
2024-07-24 14:48:31 Checking disk - Number: 1, Size: 5368709120, Location: PCI Slot 160 : Bus 3 : Device 0 : Function 0 : Adapter 0 : Port 0 : Target 1 : LUN 0
2024-07-24 14:48:31 Unit Match: False
2024-07-24 14:48:31 Checking disk - Number: 3, Size: 7516192768, Location: PCI Slot 160 : Bus 3 : Device 0 : Function 0 : Adapter 0 : Port 0 : Target 3 : LUN 0
2024-07-24 14:48:31 Unit Match: False
2024-07-24 14:48:31 Checking disk - Number: 4, Size: 8589934592, Location: PCI Slot 160 : Bus 3 : Device 0 : Function 0 : Adapter 0 : Port 0 : Target 4 : LUN 0
2024-07-24 14:48:31 Unit Match: True
2024-07-24 14:48:31 Found matching disk: 4, Details: Size: 8589934592, Location: PCI Slot 160 : Bus 3 : Device 0 : Function 0 : Adapter 0 : Port 0 : Target 4 : LUN 0
2024-07-24 14:48:32 Initialized disk: 4
2024-07-24 14:48:33 Created partition on disk: 4 with DriveLetter E
2024-07-24 14:48:33 Assigned drive letter Q to disk: 4
2024-07-24 14:48:36 Formatted partition on disk: 4 with label Qwerty
2024-07-24 14:48:36 Disk partitioning and formatting process completed.
Linux
[root@localhost scripts]# cat PartitionDisks.log
2024-07-25 12:07:58 Starting disk partitioning and formatting process.
2024-07-25 12:07:58 Reading diskConfig JSON from /scripts/diskConfig.json
2024-07-25 12:07:58 Raw diskConfig JSON: [{"controller":"SCSI_Controller_0","unit":1,"size":5,"formatDisk":false},{"controller":"SCSI_Controller_0","unit":2,"size":5,"formatDisk":true,"drive":"/kilo","label":"kilo"},{"controller":"SCSI_Controller_0","unit":3,"size":6,"formatDisk":false},{"controller":"SCSI_Controller_0","unit":4,"size":6,"formatDisk":true,"drive":"/juliet","label":"julia"}]
2024-07-25 12:07:59 Skipping disk: Controller: SCSI_Controller_0, Unit: 1, Size: 5, Drive: null, Label: null as formatDisk is set to false
2024-07-25 12:07:59 Input values for disk: Controller: SCSI_Controller_0, Unit: 2, Size: 5, Format: true, Drive: /kilo, Label: kilo
2024-07-25 12:07:59 Matching criteria - Size: 5GB, Unit: 2
2024-07-25 12:07:59 Checking disk: sda, Size: 40 GB
2024-07-25 12:07:59 Checking disk: sdb, Size: 5 GB
2024-07-25 12:07:59 Found size match for disk: sdb
2024-07-25 12:08:00 Disk: sdb, Unit: 1
2024-07-25 12:08:00 Checking disk: sdc, Size: 5 GB
2024-07-25 12:08:00 Found size match for disk: sdc
2024-07-25 12:08:00 Disk: sdc, Unit: 2
2024-07-25 12:08:00 Matching disk found: sdc, Size: 5 GB, Unit: 2
2024-07-25 12:08:00 Found matching disk: sdc
2024-07-25 12:08:00 Creating physical volume on /dev/sdc
2024-07-25 12:08:00 Creating volume group vg__kilo
2024-07-25 12:08:00 Creating logical volume lv__kilo
2024-07-25 12:08:01 Formatting logical volume lv__kilo with label kilo
2024-07-25 12:08:02 Creating mount point /kilo
2024-07-25 12:08:02 Formatted and mounted /dev/vg__kilo/lv__kilo on /kilo with label kilo
2024-07-25 12:08:03 Skipping disk: Controller: SCSI_Controller_0, Unit: 3, Size: 6, Drive: null, Label: null as formatDisk is set to false
2024-07-25 12:08:03 Input values for disk: Controller: SCSI_Controller_0, Unit: 4, Size: 6, Format: true, Drive: /juliet, Label: julia
2024-07-25 12:08:03 Matching criteria - Size: 6GB, Unit: 4
2024-07-25 12:08:03 Checking disk: sda, Size: 40 GB
2024-07-25 12:08:03 Checking disk: sdb, Size: 5 GB
2024-07-25 12:08:03 Checking disk: sdc, Size: 5 GB
2024-07-25 12:08:03 Checking disk: sdd, Size: 6 GB
2024-07-25 12:08:03 Found size match for disk: sdd
2024-07-25 12:08:03 Disk: sdd, Unit: 3
2024-07-25 12:08:03 Checking disk: sde, Size: 6 GB
2024-07-25 12:08:03 Found size match for disk: sde
2024-07-25 12:08:03 Disk: sde, Unit: 4
2024-07-25 12:08:03 Matching disk found: sde, Size: 6 GB, Unit: 4
2024-07-25 12:08:03 Found matching disk: sde
2024-07-25 12:08:03 Creating physical volume on /dev/sde
2024-07-25 12:08:03 Creating volume group vg__juliet
2024-07-25 12:08:04 Creating logical volume lv__juliet
2024-07-25 12:08:04 Formatting logical volume lv__juliet with label julia
2024-07-25 12:08:04 Creating mount point /juliet
2024-07-25 12:08:04 Formatted and mounted /dev/vg__juliet/lv__juliet on /juliet with label julia
2024-07-25 12:08:04 Disk partitioning and formatting process completed.