LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-03-2012, 09:54 AM   #1
tahaz
LQ Newbie
 
Registered: May 2012
Posts: 14

Rep: Reputation: Disabled
need help with lvremove :(


need help with lvremove, im using fedora 17
/dev/vg_bindas/lv4 is mounted on /usr/local
also lvremove with -f option didnt work either


Code:
[root@bindas vg_bindas]# ps -ef | grep usr/local
root     28145 24284  0 08:50 pts/1    00:00:00 grep --color=auto usr/local
[root@bindas vg_bindas]# ps auxxx  | grep usr/local
root     28152  0.0  0.0 109400   828 pts/1    S+   08:50   0:00 grep --color=auto usr/local
[root@bindas vg_bindas]# umount /usr/local
umount: /usr/local: not mounted
[root@bindas vg_bindas]# lvremove /dev/vg_bindas/lv4
  Logical volume vg_bindas/lv4 contains a filesystem in use.
[root@bindas vg_bindas]# lsof | grep usr/local
[root@bindas vg_bindas]#

Last edited by tahaz; 08-03-2012 at 09:59 AM. Reason: more info
 
Old 08-03-2012, 10:33 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,075
Blog Entries: 14

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
ps won't show you mounted filesystems.

Use "df -h" to see what is mounted and where it is mounted. Run your umount against the filesystem mount name associated with lv4.

Be sure that whatever is in the filesystem is something you no longer need before you do the lvremove.

If you need further help post your df -h output here.
 
Old 08-03-2012, 04:43 PM   #3
tahaz
LQ Newbie
 
Registered: May 2012
Posts: 14

Original Poster
Rep: Reputation: Disabled
thanks for reply but it didnt work

i posted ps to show that /usr/local is not being used in any process preventing lvremove
I need to do this because i need more space in root (/) as most installs go to /usr not /usr/local
i am new to linux so didnt know which filesystem to provide extra space there, i gave / only 5 gb and /usr/local 15 gb
some softwares tend to go /opt but not all
i even tried shrinking the filesystem by resize2fs but still got errors

Code:
[root@bindas opt]# df -h
Filesystem                 Size  Used Avail Use% Mounted on
rootfs                     4.9G  3.2G  1.7G  66% /
devtmpfs                   3.9G     0  3.9G   0% /dev
tmpfs                      3.9G  104K  3.9G   1% /dev/shm
tmpfs                      3.9G  2.1M  3.9G   1% /run
/dev/mapper/vg_bindas-lv1  4.9G  3.2G  1.7G  66% /
tmpfs                      3.9G     0  3.9G   0% /sys/fs/cgroup
tmpfs                      3.9G     0  3.9G   0% /media
/dev/mapper/vg_bindas-lv2  4.8G  517M  4.1G  12% /home
/dev/mapper/vg_bindas-lv5   18G 1013M   16G   7% /opt
/dev/mapper/vg_bindas-lv3  4.8G  590M  4.0G  13% /var
/dev/sda7                  482M   94M  364M  21% /boot
/dev/sda3                  404G  187G  218G  47% /winC
/dev/mapper/vg_bindas-lv4   15G  129M   14G   1% /usr/local
[root@bindas opt]# umount /usr/local
[root@bindas opt]# df -h
Filesystem                 Size  Used Avail Use% Mounted on
rootfs                     4.9G  3.2G  1.7G  66% /
devtmpfs                   3.9G     0  3.9G   0% /dev
tmpfs                      3.9G  104K  3.9G   1% /dev/shm
tmpfs                      3.9G  2.1M  3.9G   1% /run
/dev/mapper/vg_bindas-lv1  4.9G  3.2G  1.7G  66% /
tmpfs                      3.9G     0  3.9G   0% /sys/fs/cgroup
tmpfs                      3.9G     0  3.9G   0% /media
/dev/mapper/vg_bindas-lv2  4.8G  517M  4.1G  12% /home
/dev/mapper/vg_bindas-lv5   18G 1013M   16G   7% /opt
/dev/mapper/vg_bindas-lv3  4.8G  590M  4.0G  13% /var
/dev/sda7                  482M   94M  364M  21% /boot
/dev/sda3                  404G  187G  218G  47% /winC
[root@bindas opt]# lvremove /dev/vg_bindas/lv4
  Logical volume vg_bindas/lv4 contains a filesystem in use.
[root@bindas opt]# lvremove -f /dev/vg_bindas/lv4
  Logical volume vg_bindas/lv4 contains a filesystem in use.
[root@bindas opt]#
 
Old 08-03-2012, 05:15 PM   #4
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,075
Blog Entries: 14

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
Run "lsof /usr/local". It will show you any process that is using the directory, /usr/local.

The ps command would only show you process NAMES that include /usr/local. Just because a process is running in /usr/local it isn't necessary part of the process name.

You can however run "ps -ef |grep <PID>" for any process ID shown by the lsof of /usr/local.

You didn't get any errors when you tried the umount? That seems odd if it is actually busy as the lvremove says. However sometimes a filesystem is busy for simple reasons. (e.g. if you happen to have done a "cd /usr/local" then ran "su -" to become root - the user you switched from is still busying out /usr/local even though the user you switched to isn't there - this is because the su is starting a subshell.)

Also you should do "ls -l /dev/mapper/vg_bindas-lv4" and "/dev/vg_bindas/lv4" so you can see what (if any symbolic links are shown). One should be a symbolic link to the other but there's always a chance things aren't as expected so it is always best to verify assumptions even if they are "usually" the correct ones.
 
1 members found this post helpful.
Old 08-03-2012, 05:30 PM   #5
tahaz
LQ Newbie
 
Registered: May 2012
Posts: 14

Original Poster
Rep: Reputation: Disabled
thanks for the info on lsof
no i didnt get any errors when doing a umount, this time i made sure i was not in /usr/local when doing su -
either any process are using /usr/local because then i would have gotten errors

here ls -l on those paths

Code:
[root@bindas ~]# lsof /usr/local
lsof: WARNING: can't stat() fuse.gvfs-fuse-daemon file system /run/user/taha/gvfs
      Output information may be incomplete.
[root@bindas ~]# ls -l /dev/mapper/vg_bindas-lv4
lrwxrwxrwx. 1 root root 7 Aug  3 08:19 /dev/mapper/vg_bindas-lv4 -> ../dm-3
[root@bindas ~]# ls -l /dev/vg_bindas/lv4
lrwxrwxrwx. 1 root root 7 Aug  3 08:19 /dev/vg_bindas/lv4 -> ../dm-3
[root@bindas ~]# df -h
Filesystem                 Size  Used Avail Use% Mounted on
rootfs                     4.9G  3.2G  1.7G  66% /
devtmpfs                   3.9G     0  3.9G   0% /dev
tmpfs                      3.9G  296K  3.9G   1% /dev/shm
tmpfs                      3.9G  2.3M  3.9G   1% /run
/dev/mapper/vg_bindas-lv1  4.9G  3.2G  1.7G  66% /
tmpfs                      3.9G     0  3.9G   0% /sys/fs/cgroup
tmpfs                      3.9G     0  3.9G   0% /media
/dev/mapper/vg_bindas-lv2  4.8G  529M  4.1G  12% /home
/dev/mapper/vg_bindas-lv5   18G  1.1G   16G   7% /opt
/dev/mapper/vg_bindas-lv3  4.8G  600M  4.0G  13% /var
/dev/sda7                  482M   94M  364M  21% /boot
/dev/sda3                  404G  187G  218G  47% /winC
[root@bindas ~]# lvremove /dev/mapper/vg_bindas-lv4
  Logical volume vg_bindas/lv4 contains a filesystem in use.
[root@bindas ~]#
 
Old 08-04-2012, 05:42 PM   #6
deadeyes
Member
 
Registered: Aug 2006
Posts: 609

Rep: Reputation: 79
Note that it is possible you dont see any in use files however it might still be in use.
NFS shows such behavior so make sure this filesystem is not exported or stop nfs service.

Also if /usr/local is not mounted, how did you unmount it? Umount /usr/local? Or umount -l /usr/local?
Note that the latter can result in such behavior that it is still in use/seems to be still in use to the kernel.

What is in /proc/mounts?
I have seen issues with /etc/mtab being incorrect while /proc/mounts shows the correct mounts.

What is your final goal?
You might have to reboot to solve this issue.
 
Old 08-06-2012, 10:06 AM   #7
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,075
Blog Entries: 14

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
The message from lsof is informative:
Quote:
WARNING: can't stat() fuse.gvfs-fuse-daemon file system /run/user/taha/gvfs
gvfs is a Gnome Virtual Filesystem used for sharing (as NFS mentioned in previous post is a shared filesystem). Is this filesystem local to the system on which you're doing the umount? Is it shared out from this system to another one? You may need to unmount it from another system.

Also it begs the question whether your other filesystems are gvfs and if so what is the proper method for expanding them if they're also shared out?

Unfortunately I don't use gvfs here so can't give you much guidance. You should do a web search for "unmount gvfs" or "umount gvfs".
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Using lvremove without partitioning? RageD Linux - Server 8 06-20-2008 02:39 PM
lvremove issue avijitp Linux - Software 1 07-12-2007 09:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration