Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 12-27-2003, 09:23 AM   #1
Registered: May 2003
Location: The States
Distribution: Gentoo
Posts: 245

Rep: Reputation: 30

I want to put my /usr directory onto a LVM partition if I can extend the partition while I am still using it. Is this possible? Please give me a concrete example if possible.

I have put /usr onto a LVM partition before, but when I tried to extend it the change didnt show up for df. I then copied the /usr files back to my root partition at /usr2 so that I could mke2fs -j /dev/lvmpart/usr. Naturally I wanted to make the change in space visible to df.

When I tried to remount the volume I had major problems (I was being told that the volume was already mounted...of course it wasnt but anyway...). I had copied /usr to /usr2 thinking that I would remount the extended partition and copy /usr2 back. I ultimately had to reinstall everything.

So what can I do differently this time? I believe that I have to compile the kernel with something special to be able to use mke2fs while using the partition, right?

My guess is that with /usr I have to copy the files to a larger partition and then mount that partition....but wait, doesnt that defeat the purpose of LVM? Why should I use LVM if I have to extend, unmount, mke2fs, remount (having lost any data on that partition), recopy data from a backup, and then go on my way. I want to extend and be done with it. What knowledge am I missing?
Old 12-29-2003, 01:52 PM   #2
Registered: May 2003
Location: Belgium
Distribution: Gentoo, Debian
Posts: 44

Rep: Reputation: 15
Why put just one dir on your lvm partition?
I suggest putting following on it:
You can even put your swap onto it. (I did )
Putting your / onto it is not recommended. But if you really want to, read this:

the LVM-howto

First you have to make sure that lvm-support is compiled into your kernel.
don't forget to install the lvm-user package

then as you said:
make your lvm-partition
mke2fs -j /dev/lvmpart/usr
change fstab

making it larger:
# lvextend -L+1G /dev/lvmpart/usr (change this as neccecary)
# resize2fs -f /dev/lvmpart/usr (i'm using reiserfs and have to use resize_reiserfs)

you don't even have to unmount it!

I don't use LVM very long, but I think its great. I have a normal partition and a second harddrive that form the lvm-partition and had to extend and shrink a few things already. Everyone should use it.


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
lvm anyone? puffinman Linux - Software 2 06-26-2005 11:07 AM
how to get LVM mailnickykav Red Hat 1 03-01-2005 02:22 PM
lvm Ammad Linux - General 2 02-22-2005 08:19 PM
LVM on RH AS 2.1 yoggieb Linux - Enterprise 2 07-18-2004 05:49 AM
To LVM or not to LVM? illtbagu Linux - Software 3 12-29-2003 04:17 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:40 PM.

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