DbAppWeb.com

Menu
  • Home
  • Linux
  • HP-UX
  • macOS
  • Windows
  • Web Servers
  • App Servers
  • Storage

How to remove File System, LV and VG in HP-UX and Linux

December 24, 2016 DbAppWeb Admin

If you are not using a mount point and you need to remove that file system to gain some more space which can be used for other systems. To reclaim the disk space you need to do the following activities if you have created that volume using the Logical Volume (LV) and Volume Group (VG).

Unmount file system (FS)
Remove Logical Volume (LV)
Reduce/Remove Volume Group (VG)
Remove Physical Volume (PV) from LVM.

I have done this activity on an HP-UX machine, you can perform the same on a Linux machine also.

First list down the exported volumes on the machine using the below command:
# ioscan -fnNC disk
Class I H/W Path Driver S/W State H/W Type Description
===================================================================

disk 8 64000/0xfa00/0xe esdisk CLAIMED DEVICE 3PARdataVV
/dev/disk/disk8 /dev/rdisk/disk8

List the mount point using the below command:

# bdf
Filesystem kbytes used avail %used Mounted on
/dev/vgupload/lvupload
2147450880 471341672 1571352501 23% /upload

Umount file system (FS)

  • To make sure nobody is using the file system, use the fuser command.

# fuser -cu /upload
/upload: 20310c(root)

u: Display the login user name in parentheses following each process ID.
c: Display the use of a mount point and any file beneath that mount point. Each file must be a file system mount point.
If u receive the above result then it means user1 is using this mount point, so check with user1, when he is going to finish his job once done you can process with the procedure.
To free up busy mount point you can use fuser command with k option:
k :- Send the SIGKILL signal to each process using each file.

  • To free up busy mount point you can use fuser command with k option:
    k :- Send the SIGKILL signal to each process using each file.

# fuser -kcu /upload
/upload: 20310c(root)

  • Confirm that nobody is using the file system

# fuser -cu /upload
/upload:

  • unmount file system

# umount /upload

  • Cross-check with the bdf command.
    Remove entry form /etc/fstab file for /upload file system for Linux system
    Remove entry form /etc/dfs/dfstab file for /upload file system for HP-UX system

Remove Logical Volume (LV)

  • To remove LV use lvremove command, when prompted, press y to remove the volume.

# lvremove /dev/vgupload/lvupload
The logical volume “/dev/vgupload/lvupload” is not empty;
do you really want to delete the logical volume (y/n) : y
Logical volume “/dev/vgupload/lvupload” has been successfully removed.
Volume Group configuration for /dev/vgupload has been saved in /etc/lvmconf/vgupload.conf

  • If the logical volume contains data, LVM prompts you for confirmation. You can use the -f flag to remove the logical volume without a confirmation request.

# lvremove -f /dev/vgupload/lvupload

Removing volume group

  • # pvdisplay /dev/disk/disk8
    — Physical volumes —
    PV Name /dev/disk/disk8
    VG Name /dev/vgupload
    PV Status available
    Allocatable yes
    VGDA 2
    Cur LV 0
    PE Size (Mbytes) 32
    Total PE 65535
    Free PE 65535
    Allocated PE 0
    Stale PE 0
    IO Timeout (Seconds) default
    Autoswitch On
    Proactive Polling On
  • # vgdisplay /dev/vgupload
    — Volume groups —
    VG Name /dev/vgupload
    VG Write Access read/write
    VG Status available
    Max LV 255
    Cur LV 0
    Open LV 0
    Max PV 16
    Cur PV 1
    Act PV 1
    Max PE per PV 65535
    VGDA 2
    PE Size (Mbytes) 32
    Total PE 65535
    Alloc PE 0
    Free PE 65535
    Total PVG 0
    Total Spare PVs 0
    Total Spare PVs in use 0
    VG Version 1.0
    VG Max Size 33553920m
    VG Max Extents 1048560
  • Verify if there is only one disk remaining in the volume group. We cannot remove the volume group if there is more than one physical disk in the volume group.

# vgdisplay -v vgupload|grep “PV Name”
PV Name /dev/disk/disk8

  • Remove the volume group using the below command:

# vgremove vgupload
Volume group “vgupload” has been successfully removed.

  • Remove the directory and group DSFs for the volume group. Press y when prompted.

# rm -ir /dev/vgupload
directory /dev/vgupload: ? (y/n) y
/dev/vgupload/group: ? (y/n) y
/dev/vgupload: ? (y/n) y

Remove Physical Volume (PV) From LVM

  • Remove the Physical Volume using below command:

# pvremove /dev/rdisk/disk8
The physical volume associated with “/dev/rdisk/disk8” has been removed.

 

Related Posts

  • How to Find NIC (Network Interface Card) Details in HP-UX
  • How to Install a .depot Package Using swinstall on HP-UX
  • HP-UX: How to restrict NFS share access to a particular server?
  • crontab: you are not authorized to use cron. Sorry. in HP-UX
  • HP-UX: SSH taking too much time after adding the DNS Servers
  • How to add DNS servers on an HP-UX server
  • How to login to vPar console in HP-UX
  • How to extend the size of Logical Volume (LV) in HP-UX
  • How to determine file system type in HP-UX using command
  • How to check vPar machines status in HP-UX
  • How to find HBA cards/ports and WWN Number details in HP-UX (nPar)
  • How to find HBA cards/ports and WWN Number details in HP-UX (vPar)
  • HP-UX command to get Physical Memory Information
  • HP-UX command to get Processor Information
  • HP-UX command to get Hardware Serial Number
  • su: Sorry in HP-UX while switching from normal user to root user
  • SSH login taking too much time on HP-UX 11.31
  • How to Disable Root SHH Login in HP-UX?
  • hpvmstatus: HPVM currently not running.
  • How to view/print routing table in HP-UX?
  • Create a Logical Volume larger than 2TB and format it in HP-UX
  • Protect SSH Logins with SSH and MOTD Banner Messages in HP-UX
  • Remove welcome message after login in HP-UX 11.31
  • Create a Logical Volume and format it in HP-UX
  • How to rescan new LUNs added in HP-UX 11.31
  • How to reboot a HP-UX machine?
  • How to remove File System, LV and VG in HP-UX and Linux?
  • How to remove NO_HW devices from ioscan in HP-UX without a reboot?
  • Change root user password of vpar machine in HP-UX

Share this:

  • Click to share on Twitter (Opens in new window)
  • Click to share on Facebook (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)
  • Click to share on Telegram (Opens in new window)
  • Click to share on WhatsApp (Opens in new window)
Prev Article
Next Article
Tags:HP-UX Linux Sys Admin

One Response

  1. http://mobdroapk.online/

    Wow, awesome blog layout! How long have you
    been blogging for? you made blogging look easy.

    The overall look of your site is magnificent, as well as the content!

Leave a Reply Cancel Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  • Popular
  • Recent

Categories

  • Android (2)
  • Blogger (16)
  • Domain and Hosting (1)
  • Hardware Issues (7)
  • HP-UX (55)
  • HPE Data Protector (9)
  • IBM Lotus Notes (2)
  • IBM WebSphere Application Server (16)
  • Internet Tips & Tricks (15)
  • iOS (8)
  • JBoss/WildFly Application Server (2)
  • Linux (76)
  • macOS (15)
  • Microsoft Windows (31)
  • News and Updates (11)
  • Oracle Database (5)
  • SSL/TLS (1)
  • Storage Servers (23)
  • Tools/Softwares (1)
  • VMware ESXi (17)
  • Web Servers (14)
  • WordPress (5)

Archives

DbAppWeb.com

Solution of Database, Application and Web Server Problems

About DbAppWeb.com

One Stop Solution for Database Server, Application Server and Web Server Problems.

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

DbAppWeb on Social Media

Copyright © 2025 DbAppWeb.com
Terms and Conditions   Theme by MyThemeShop.com