★ UiS disk partition cleanup operation method (including LVM partition)

2025-02-28 19:08:32 Published
  • 0 Followed
  • 0Collected ,20Browsed

Network Topology

Not involved

Problem Description

This case applies to scenarios where UIS scans disks during initialization. If a disk already has partitions, it will be considered in use and thus filtered out, making it undetectable on the interface. In some cases, lsblk may show no partitions on the disk, but the disk can still be detected during scanning. However, adding it to the storage cluster for formatting fails due to residual partitions on the disk. This document provides manual resolution methods for situations where disk addition is prevented by residual partition information during UIS cluster initialization or drive pool expansion.

In the UIS scenario, disk partitions are mainly divided into two types: physical disk partition scenarios and LVM scenarios.

 

Precautions: 1. During environment initialization, do not clean up the system disk when clearing partitions.

2. In disk expansion scenarios, avoid accidentally cleaning up disks already added to the cluster or the system disk. Refer to Chapter 1 for the acknowledge method.

Process Analysis

1. Acknowledge disks to be cleaned

If scanning the disk fails or formatting the disk fails, first check in the background whether it is caused by residual partitions on the disk joined to the cluster. If there are residual partitions, clean the disk partition and try again. If not, call 400.

1、Initialization scenario

1)Acknowledge disks to be cleaned

In the initialization scenario of UIS deployment, except for the system disk, all other disks will be required to join the cluster and may have uncleaned disks

2)Residual partition confirmation

Use lsblk to check whether the corresponding disk has partitions, as shown below

Check if LVM exists

 

Execute lvdisplay, vgdisplay, and pvdisplay respectively. If any command displays existing information, it indicates residual LVM that needs cleanup, as shown below

2. Disk expansion scenario

For expansion scenarios, acknowledge the disk to be expanded to avoid cleaning disks currently in use.

 

1) First, acknowledge the current storage status is normal. Execute the ceph –s command to confirm all OSDs are up

2) Check the [Storage] -> [Host Management] interface of UIS to confirm the disk to be cleaned is unused and not a system disk

3) Check if LVM exists

2. Physical disk partition scenario

 

This scenario refers to disk partitions being divided on a physical disk. On the UIS initialization disk selection interface, there is a Clean Disk Partition button, which can be directly operated using the clean function. If there are residual partition tables, they can be cleaned using the following command. Note: Some residual disk partitions cannot be queried via lsblk, but if there are residual partition tables, this command can also be used for cleanup

After cleanup, use the fdisk command to view disk information. The following display indicates compliance with requirements.

Solution

LVM partition cleanup

There are two scenarios for LVM partition cleanup: 1) The LVM remains intact, and the corresponding volumes can be viewed using lvdisplay or dmsetup ls; 2) The LVM is partially damaged, and no information can be queried via lvdisplay or dmsetup ls

1、Complete LVM cleanup

1) Use dmsetup ls to view existing LVM volumes

2) Execute dmsetup remove XXXX //XXXX represents the name of the mapped device. For example, to delete centos-root, execute dmsetup remove centos-root. After deletion, query and acknowledge centos-root

3) After deletion, use the command sgdisk -o /dev/sdX //where X represents the physical disk or partition where LVM resides

2、Residual LVM cleanup solution

 

In residual cases, commands like lsblk or dmsetup ls cannot detect it, and even the lvdisplay command shows nothing. However, this may cause the disk to fail during formatting when added to a storage cluster.

Brief description of LVM logical structure: Physical partitions are used as PVs, multiple PVs form a VG, and the VG is treated as a complete disk for creating LVs. Thus, PV, VG, and LVResidues may remain in all cases. Cleaning must be performed from top to bottom, i.e., first clean upLV, then VG, and finally PV. Below are the respective cleanup methods

 

1) LV cleanup: lvdisplay to query current LV, lvremove to delete

2) VG cleanup: vgdisplay to query, vgremove to delete

3) PV cleanup: pvdisplay to query, pvremove to delete

4) After deletion, execute sgdisk –o /dev/nvme1n1 to clean the disk, where nvme1n1 is the disk containing the PV

 

Please rate this case:   
0 Comments

No Comments

Add Comments: