LinuxQuestions.org
Visit Jeremy's Blog.
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 07-08-2009, 10:18 AM   #1
tanveer
Member
 
Registered: Feb 2004
Location: e@rth
Distribution: RHEL-3/4/5,Gloria,opensolaris
Posts: 525

Rep: Reputation: 39
LVM resize problem


Hi,
I did an installation on my test server using LVM. Now it contains /, swap and /usr. Now they are all under LVM and /usr is 20GB, / is 10GB and swap is 2GB. Now what I knew about LVM was it automatically takes space from other LVM partitions if one gets full. So I have two question

1. If /usr gets full then will it take space from / automatically or not?
- which I didn't see happen in that system
2. If the partition table of an OS is like below which is without LVM

/ 10 GB
swap 2 GB
/var 20 GB
/usr 20 GB

Can I put this OS under LVM without destroying the os?

thanks in advance.
 
Old 07-08-2009, 11:38 AM   #2
rayfordj
Member
 
Registered: Feb 2008
Location: Texas
Distribution: Fedora, RHEL, CentOS
Posts: 488

Rep: Reputation: 78
much speculation and assumption made on my part based on the limited information available...


Quote:
Originally Posted by tanveer View Post
I did an installation on my test server using LVM. Now it contains /, swap and /usr. Now they are all under LVM and /usr is 20GB, / is 10GB and swap is 2GB. Now what I knew about LVM was it automatically takes space from other LVM partitions if one gets full. So I have two question

1. If /usr gets full then will it take space from / automatically or not?
- which I didn't see happen in that system
LVM does not automatically take action. It provides administrative flexibility of storage resources to dynamically allocate storage as necessary which is not easily done with traditional partitions. You may intervene and take steps to reduce a filesystem so that the allocated physical extents may then be used to extend another logical volume, but this is far from automatic and comes with its own set of risks.

Quote:
Originally Posted by tanveer View Post
2. If the partition table of an OS is like below which is without LVM

/ 10 GB
swap 2 GB
/var 20 GB
/usr 20 GB

Can I put this OS under LVM without destroying the os?
That depends entirely on any additional available storage you might have and if the OS supports LVM. If you have consumed the entire disk it becomes more difficult than if you have 20-30GB free (unpartitioned, unformatted) space. It would likely be optimal to re-install the OS on LVM and restore data from backup. However, if you have available disk space (either on this same disk or on another disk) and are feeling up to it, you may wish to undertake the challenge. If in the above example, all partitions are primary, you are out of luck without another disk. Also, it looks like you might have /boot under / so you'll still need a non-LVM /boot partition so that GRUB may locate the necessary files to proceed with OS boot.

Short of a clean install on LVM and restore, the 2nd best would be to work from a Live-CD so that the on-disk filesystem does not have any open files to contend with. While shoveling the data around is not itself difficult, you'll need to be sure to make all the necessary modifications elsewhere in the OS to ensure that it knows now where to look for things. This is where it may become troublesome.

examples:
- grub.conf will need to be modified to provide correct root= location to kernel.
- fstab will need to be updated to reflect new device names to mount locations mappings
- initrd will need to include necessary LVM information


I really have more questions than answers at this point based on such limited information. I'm sure we could dig up dozens of guides and HOW-TOs that discuss and demonstrate examples similar to what you are asking. While I am not saying it is impossible to do, I am -- at least at this time -- saying that it might not be worth the headache to you...



 
  


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
LVM resize Problem bharatlalgupta Linux - General 4 12-22-2009 12:00 AM
Fedora LVM volume group & Physical Volume resize problem gabeyg Fedora 1 05-14-2008 11:26 AM
Resize LV with LVM Slipstream2006 Linux - General 4 03-30-2007 09:47 AM
LVM Resize - After logical resize, FS size does not match physical size. spectra Linux - Software 6 11-01-2006 11:28 AM

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

All times are GMT -5. The time now is 11:53 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