7.13 Deleting a Linux POSIX Volume

You can use the nlvm delete linux volume command to delete a Linux POSIX volume. The volume must be unmounted. For command usage information, see Delete Linux Volume in the OES 2023: NLVM Reference.

WARNING:The delete process removes the partition for the volume, and destroys all of the data on the partition.

7.13.1 Deleting a Linux POSIX Volume

  1. Log in to the server as the root user, then open a terminal console.

  2. View a list of Linux volumes by entering the following command, then find the name, mount point, and mount status of the volume that you want to delete.

    nlvm list linux volumes

    For example, the following Linux POSIX volume’s name is /vol1. Its mount point is /mnt/vol1. Its mount status is Mounted.

    nlvm list linux volumes
     Name   Group  Mounted    Size Shared     Type LVM NCP Mountpoint
     /               Yes    15.98GB  No       ext3  No  No /
     /boot           Yes   297.00MB  No       ext2  No  No /boot
     /home           Yes   403.00GB  No       ext3  No  No /home
     /vol1           Yes    25.98GB  No       ext3  No  No /mnt/vol1
     VOL2            Yes    19.98GB  No       ext3  No Yes /mnt/VOL2
  3. Dismount the volume by entering the native Linux umount command:

    umount <full_mount_point_path>

    Replace full_mount_point_path with the volume’s mount point. For example, enter

    umount /mnt/vol1
  4. Delete the Linux POSIX volume by entering

    nlvm [--no-prompt] delete linux volume <volume_name>

    You are automatically prompted to confirm the delete action. Enter yes to continue or enter no to cancel. Use the --no-prompt NLVM option to suppress the confirmation.

    For example, enter

    nlvm delete linux volume /vol1
  5. Verify that the volume no longer appears in the list of Linux volumes by entering

    nlvm list linux volumes

    The volume does not appear in the list.

    nlvm list linux volumes
     Name   Group  Mounted    Size Shared     Type LVM NCP Mountpoint
     /               Yes    15.98GB  No       ext3  No  No /
     /boot           Yes   297.00MB  No       ext2  No  No /boot
     /home           Yes   403.00GB  No       ext3  No  No /home
     VOL2            Yes    19.98GB  No       ext3  No Yes /mnt/VOL2
  6. Verify that the space used by the volume’s partition is now available as free unpartitioned space by entering

    nlvm list devices

    For example, see the Size, Used, and Free values for the device, such as for sdd:

    nlvm list devices
     Name            Size     Used     Free   Format Shared RAID Enabled
     sda           11.00GB   9.29GB   1.70GB   MSDOS   No    No
     sdb          102.00MB 102.00MB      0KB   MSDOS  Yes    No
     sdc          102.00MB 102.00MB      0KB   MSDOS  Yes    No
     sdd          512.00MB     16KB 511.98MB   MSDOS   No    No

7.13.2 Deleting an LVM Volume Group and Logical Volume

Use the procedure in this section to delete an LVM volume group and logical volume. If the LVM volume group and logical volume are clustered with Novell Cluster Services, use the instructions in Deleting a Clustered LVM Volume Group and Logical Volume.

  1. Log in to the server as the root user, then open a terminal console.

  2. View a list of Linux volumes by entering the following command, then find the name, mount point, and mount status of the volume that you want to delete.

    nlvm list linux volumes

    For example, the following LVM logical volume’s name is lvvol1. Its mount point is /mnt/lvvol1. Its mount status is Mounted.

    nlvm list linux volumes
     Name   Group  Mounted    Size Shared     Type LVM NCP Mountpoint
     /               Yes    15.98GB  No       ext3  No  No /
     /boot           Yes   297.00MB  No       ext2  No  No /boot
     /home           Yes   403.00GB  No       ext3  No  No /home
     lvvol1          Yes    25.98GB  No       ext3  No  No /mnt/lvvol1
     VOL2            Yes    19.98GB  No       ext3  No Yes /mnt/VOL2
  3. Dismount the volume by entering the native Linux umount command:

    umount <full_mount_point_path>

    Replace full_mount_point_path with the volume’s mount point. For example, enter

    umount /mnt/lvvol1
  4. Delete the LVM logical volume and its volume group by entering

    nlvm delete linux volume <lv_name>

    You are automatically prompted to confirm the delete action. Enter yes to continue or enter no to cancel. Use the --no-prompt NLVM option to suppress the confirmation.

    For example, enter

    nlvm delete linux volume lvvol1
  5. Verify that the volume no longer appears in the list of Linux volumes by entering

    nlvm list linux volumes

    The volume does not appear in the list.

    nlvm list linux volumes
     Name   Group  Mounted    Size Shared     Type LVM NCP Mountpoint
     /               Yes    15.98GB  No       ext3  No  No /
     /boot           Yes   297.00MB  No       ext2  No  No /boot
     /home           Yes   403.00GB  No       ext3  No  No /home
     VOL2            Yes    19.98GB  No       ext3  No Yes /mnt/VOL2
  6. Verify that the LVM volume group is deleted by entering the native LVM vgdisplay command:

    vgdisplay
  7. Verify that the space used by the volume group’s partition is now available as free unpartitioned space by entering

    nlvm list devices

    For example, see the Size, Used, and Free values for the device, such as for sdd:

    nlvm list devices
     Name            Size     Used     Free   Format Shared RAID Enabled
     sda           11.00GB   9.29GB   1.70GB   MSDOS   No    No
     sdb          102.00MB 102.00MB      0KB   MSDOS  Yes    No
     sdc          102.00MB 102.00MB      0KB   MSDOS  Yes    No
     sdd          512.00MB     16KB 511.98MB   MSDOS   No    No