1834814 Members
2581 Online
110070 Solutions
New Discussion

Re: Cant umount a lvol

 
SOLVED
Go to solution
Phillip Popp
Regular Advisor

Cant umount a lvol

Hi I am running 10.2
I made a lvol /home/preprod. this is under the lvol /home. i now want to remove /home/preprod, but it keeps telling me device is busy. i do not see any processes that are accessing /home/preprod when I do ps -ef | grep preprod. I also made preprod a user with /home/preprod as its home. Any suggestions as to why it keeps telling me it is busy? Do I need to get rid of the user preprod first, before I try to unmount the directory, or did I screw it up by putting a lvol under another lvol?

Please help.

Thanks,

Phil
10 REPLIES 10
Pete Randall
Outstanding Contributor

Re: Cant umount a lvol

What do you mean by "put a lvol under another lvol"?

Most likely someone is cd'ed into the /home/preprod directory. You can run fuser to check. A better tool is lsof, which is available from the porting and archive center if you don't have it (though not for 10.20 anymore!).


Pete

Pete
James R. Ferguson
Acclaimed Contributor

Re: Cant umount a lvol

Hi Phil:

Make sure that you have not 'cd'ed into the directory '/home/preprod'. You need to unmount it and 'lvremove' the logical volume.

If the user 'prepord' is logged-in, have it log-out first.

You can also do:

# fuser -kc /dev/vgXX/lvolN

...to kill any processes using the mountpoint

Using 'lsof' is another way to find "who" and "what" might be using the filesystem in question.

There is nothing wrong with having '/home' as a mountpoint and '/home/preprod' as a separate mountpoint.

Regards!

...JRF...
whiteknight
Honored Contributor
Solution

Re: Cant umount a lvol

Phil,

# fuser /
12345c
. Output similar to 12345c indicates that a user is logged in
and has his current working directory (CWD) set to the mounted
directory or to a sub-directory under the mounted directory OR
that the mounted directory is being queried.

2. One "c" indicates that one user is logged under that directory;
multiple "c"s indicate multiple users under that directory.

3. Run the following command to check for users who are logged in:

# ps -ef | grep 12345
4. To verify shell logins/sessions, run:

# ps -ef | grep sh

5. Ask users to logout. Also remember change YOUR current working
directory to somewhere NOT under the file system in question

When no one is accessing the file system, attempt to unmount it.


WK
please assign points

Problem never ends, you must know how to fix it
TwoProc
Honored Contributor

Re: Cant umount a lvol

Phil,

Your question is a bit of a mess. This is because I'm pretty sure that /home/prepod is a mount point in the case that your speaking of, and not an lvol.

Your lvols should be in a volume group, and hence, would have a name like /dev/vg01/lvol1
or if you named everything something like
/dev/vgmyvgname/mylvol.

Then you would have mounted it possibly at /home/prepod, or from your posting, at /home/prepod /prepod.

You wouldn't "remove it" , you'd just unmount it:
umount /home/prepod/
or
umount /home/prepod/somenameyougave it

Check your mounts by looking at the output
of the "bdf" command. You'll see your mount somewhere at or near /home/preprod and the associated lvol, listed as /dev/vgxxx/xxxxx.

After you've unmounted it, you could remove the directory of the mount point.

But, you seem a bit lost ( I don't mean to insult here, so please don't take it that way ) , and I think you should review some manuals or documentation on how to manage lvm file systems before continuuing on.
We are the people our parents warned us about --Jimmy Buffett
Phillip Popp
Regular Advisor

Re: Cant umount a lvol

Thanks guys,
I did not know of the fuser command. I used it and it cleared the instance that keept me from unmounting the lvol

Thanks all

Phil
Dennis Handly
Acclaimed Contributor

Re: Cant umount a lvol

>WK: that the mounted directory is being queried.

My HISTFILE is there, no matter what CWD I have, I'd be hosed.

>3. Run the following command to check for users who are logged in:
# ps -ef | grep 12345

You might want to use "ps -fp 12345" instead.
But it won't give the children like the grep.
skt_skt
Honored Contributor

Re: Cant umount a lvol

Also u may try "mount" whihc will list the mounted fie syste.

Joelmel Roche
Valued Contributor

Re: Cant umount a lvol

Hi,

you must run a single user before you can umount the /home

SUPERUSER:
# shutdown 0

SINGLE USER:
# umount /home
# bdf
Dennis Handly
Acclaimed Contributor

Re: Cant umount a lvol

>Joelmel: you must run a single user before you can umount the /home

Why? If you kick everyone off that is using /home, root can cd to / and then try umount. Of course in practice, this may be just as easy as a reboot.
Marcel Burggraeve
Trusted Contributor

Re: Cant umount a lvol

> you must run a single user before you can > umount the /home
>
> SUPERUSER:
> # shutdown 0

Keep in mind that going back from multiuser to singleuser will not give you a 'real' single user mode.
Several logical volumes still can't be unmounted if you do it like this.
For those volumes you should reboot the system and start it in single user mode from the ISL prompt with hpux -is