LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-02-2008, 05:31 PM   #1
rob07mxa
LQ Newbie
 
Registered: Nov 2007
Posts: 19

Rep: Reputation: 0
lvm stop functioning after unmounting /usr


hi,

i am trying to shrink /usr (which is a logical volume). i managed to unmounted /usr but when i tried to use lvreduce, it did not work because the location of lvm is in /usr/sbin/lvm. therefore, when the system was in single mode and I started lvm, there was no response. what should i do to keep lvm working even after unmounting /usr?
(OS Fedora 8) thanks in anticipation.
 
Old 08-02-2008, 06:27 PM   #2
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Try moving lvm and its dependants to /sbin. In fact, if I were you, I'd consider moving all of /usr/sbin (and its dependants) to /sbin.

You should be aware that /usr (the "unix system resources" directory) is, normally, considered an essential part of the system, and many applications will expect to find their needed resources in that directory, so removing it may break many of your applications.

<edit>
Also, your use of the phrase "shrink /usr which is a logical volume" is somewhat strange. Normally a logical volume is an abstraction layer between your physical hardware and your file system. It is primarily used so that physical changes can be made without much impact on the structure of the file systems.

To say that "/usr is a logical volume" implies that:
1) /usr is in it's own partition.
2) That partition is a separate entry in it's own logical volume.
3) The partition is not full
4) The lvm tools, for some reason you don't address, are not adequate to shrink that logical partition.

Also, to say that you "unmounted /usr" implies that /usr was, in fact, on a separate partition and mounted by, presumably, an entry in /etc/fstab like this:
Code:
/dev/VG_name/LV_name /usb ext3 defaults 1 3
Both usages seem fairly sophisticated and quite unusual.

Are you sure that /usr is, in fact, on a separate (logical) partition on your system?
</edit>

Last edited by PTrenholme; 08-03-2008 at 08:41 AM.
 
Old 08-02-2008, 06:37 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,152

Rep: Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125
Don't do the work on the active system - use a LVM aware rescue or liveCD. The first Fedora disk or Knoppix should do.
 
Old 08-10-2008, 03:47 PM   #4
rob07mxa
LQ Newbie
 
Registered: Nov 2007
Posts: 19

Original Poster
Rep: Reputation: 0
Thanks a lot PTrenholme

Quote:
Try moving lvm and its dependants to /sbin. In fact, if I were you, I'd consider moving all of /usr/sbin (and its dependents) to /sbin.
But how I can do that without messing up lvm's dependencies?
I already copied and pasted very carefully every single file connected with lvm from /usr/sbin to /sbin. Then, I unmount /usr, started the system in a single mode. when I tried to start lvm, the utility response was that lvm could not locate its dependancies.

Quote:
To say that "/usr is a logical volume" implies that:
1) /usr is in it's own partition.
2) That partition is a separate entry in it's own logical volume.
3) The partition is not full
4) The lvm tools, for some reason you don't address, are not adequate to shrink that logical partition.
Yes you are right about the above points
/usr is not full and there is plenty of space in it. Therefore, I need to shrink it to expand /home.
The lvm tool that I am trying to use is lvreduce. the main problem is that if lvm did not start, lvreduce would never work.

Quote:
Are you sure that /usr is, in fact, on a separate (logical) partition on your system?
Yes /usr is on a separate logical volume in order to have the flexibility of change its size if the system requires that.


Thanks again.
 
Old 08-10-2008, 03:49 PM   #5
rob07mxa
LQ Newbie
 
Registered: Nov 2007
Posts: 19

Original Poster
Rep: Reputation: 0
Thanks syg00

Quote:
Don't do the work on the active system
I will keep your advise in mind and I have verified B-A-C-K-U-P, thanks to tar.

thanks again
 
Old 08-10-2008, 08:45 PM   #6
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
O.K., that sounds like you know what you're doing.

The simplest solution to your problem is to use a LV-aware LiveCD, boot from it, and use the LV tools to do the shrinking.

If, for some reason you don't want to do that, try:

1) Copy /usr to, say /Usr on another drive or partition.
2) Unmount /usr and the /Usr copy
3) Mount the /Usr copy as /usr
4) Shrink the (now unmounted) /usr
5) Unmount the /usr copy
6) Remount the "real," now shrunk, /usr
7) Test
8) Remove the temporary /Usr

and (I hope) you're golden again.

Good luck -- and keep that backup handy!
 
Old 08-11-2008, 11:39 AM   #7
rob07mxa
LQ Newbie
 
Registered: Nov 2007
Posts: 19

Original Poster
Rep: Reputation: 0
I couldn't implement the second solution because I do have enough free space to accommodate the
/usr.
the first solution solved the problem.
many thanks
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
FreeBSD 6.2, no /usr/src/tools and /usr/src/usr.bin, failed to build world. Mr_Shameless *BSD 4 05-16-2008 08:43 AM
start-stop-daemon: stat /usr/bin/xdm Sessel Linux - General 7 12-26-2007 11:24 AM
Unmounting remote filesystems, is there a way to stop that? M$ISBS Slackware 13 05-11-2007 12:05 PM
LXer: Back Up (And Restore) LVM Partitions With LVM Snapshots LXer Syndicated Linux News 0 04-17-2007 11:16 AM
unmounting-removing LVM partition jazzyjazz Linux - Software 2 11-12-2004 02:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:23 AM.

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
Open Source Consulting | Domain Registration