1753537 Members
5414 Online
108795 Solutions
New Discussion юеВ

Re: Remove a file system

 
SOLVED
Go to solution
j773303
Super Advisor

Remove a file system

As title. How to remove a file system?
Assume a logical volume /dev/vg00/lvol2 was
created.
Thanks.
Hero
6 REPLIES 6
Rajeev  Shukla
Honored Contributor
Solution

Re: Remove a file system

unmount the filesystem and use lvremove command to do that.
lvremove /dev/vg00/lvol2

cheers
Rajeev
S.K. Chan
Honored Contributor

Re: Remove a file system

You don't mean /dev/vg00/lvol2 right because that's usually for primary swap ? Assuming you're talking about non-root volume group (non-vg00), all you need to do is ..
==> Assuming /dev/vg01/lvol1 mounted on /opt/apps
# cd /
# umount /opt/apps
# lvremove /dev/vg01/lvol1
# vi /etc/fstab
==> Delete the appropriate entry.
# vgdisplay -v vg01 | more
==> Make sure "lvol1" is gone and previous extents used are now "released".
harry d brown jr
Honored Contributor

Re: Remove a file system


lvremove

if it's unmounted

live free or die
harry
Live Free or Die
Bill Hassell
Honored Contributor

Re: Remove a file system

lvremove /dev/vg00/lvol2 (don't do it!)

will very likely crash your system since removing primary swap is like removing RAM while the system is running. And single user mode will also fail because HP-UX requires primary swap to be available.


Bill Hassell, sysadmin
Juan Manuel L├│pez
Valued Contributor

Re: Remove a file system

Hi all.
First off all, you have to unmount ths file system:

" umount < fisystem name > "

If you have process over the file system, you will get the message " Device Busy ".

In this case, you have to find out witch process are over your file system. Use this command: " fuser < fylesystem name > " or " fuser /dev/vgxx/lvolx ".
( fuser -k < file system name > will kill all the process ).
Once you have kill ( or exit ) the process over you file system, you can unmount it.

Last step is to delete the lv. " lvremove /dev/vgxx/lvolx ".

And that??s all you have to do.

It easy, isn??t it ?

I hope this help you.

Juanma.
I would like to be lie on a beautiful beach spending my life doing nothing, so someboby has to make this job.
Steven E. Protter
Exalted Contributor

Re: Remove a file system

if there is someone on the filesystem

fuser -cuk /filesystem
kills all processes
Won't work on /var because there are teminal files created for every telnetd process, you can't be logged on and remove /var.
then lvremve etc.

Some filesystems like /var can't be removed in multi user mode.

In that case you will need to restart the box, interupt the boot, hpux -is to enter single user mode.

Then nothing will be mounted and you can safely remove the filesystem.

Of course if you actually remove /usr or /var you need to put them back if you plan on actually starting your system after single user mode.
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com