Jump to content

LVM is cool


jlc
 Share

Recommended Posts

I recently rebuilt my main box with gentoo using lvm and here's my partioins.

 

bash-2.05b# df -h

Filesystem            Size  Used Avail Use% Mounted on

/dev/hda2             2.0G  514M  1.5G  26% /

/dev/vg/usr            10G  2.2G  7.9G  22% /usr

/dev/vg/opt           5.0G  419M  4.6G   9% /opt

/dev/vg/tmp           2.0G   33M  2.0G   2% /tmp

/dev/vg/var           5.0G  230M  4.8G   5% /var

/dev/vg/home           20G   19G  2.0G  91% /home

none                  378M     0  378M   0% /dev/shm

 

As you can see when I moved my backup info over to home, almost filled it up. So I want more space off my 80GB drive. Here we go:

 

bash-2.05b# lvextend -L+10G /dev/vg/home

lvextend -- extending logical volume "/dev/vg/home" to 30 GB

lvextend -- doing automatic backup of volume group "vg"

lvextend -- logical volume "/dev/vg/home" successfully extended



bash-2.05b# resize_reiserfs -f  /dev/vg/home



<-------------resize_reiserfs, 2003------------->

reiserfsprogs 3.6.8







resize_reiserfs: On-line resizing finished successfully.

 

Now I have 10GB extra on my Home space!

 

 bash-2.05b# df -h

Filesystem            Size  Used Avail Use% Mounted on

/dev/hda2             2.0G  515M  1.5G  26% /

/dev/vg/usr            10G  2.2G  7.9G  22% /usr

/dev/vg/opt           5.0G  419M  4.6G   9% /opt

/dev/vg/tmp           2.0G   33M  2.0G   2% /tmp

/dev/vg/var           5.0G  230M  4.8G   5% /var

/dev/vg/home           30G   19G   12G  61% /home

none                  378M     0  378M   0% /dev/shm

 

Pretty much useless post, except for showing the advantages of using LVM.

 

8)

Link to comment
Share on other sites

Honestly, I don't know if MDK has it or not. :oops:

RH & SuSE both have it available to use. I think MDK does, I remember it read some several months back when I had it under RH. I could be wrong, just a guess. Anyway, LVM is Logical Volume Management. Here are some links for it.

 

http://www.gentoo.org/doc/en/lvm.xml

 

Install guide under Gentoo, RH & Suse (maybe mdk) are all graphical I don't know if that makes it easier, because I was able to do it faster under gentoo from the command line, less gui to run through I guess. :wink:

 

http://tldp.org/HOWTO/LVM-HOWTO/

 

says it all in the link

 

 

 

The next to links describe a little more from the IBM devel site.

 

http://www-106.ibm.com/developerworks/linu...m/?dwzone=linux

 

http://www-106.ibm.com/developerworks/linu...ml?dwzone=linux

 

If you have ever used Veritas on Sun or HP unix, it's kind of like that. Allows you to take left over space and create volumes(partitions) and mount points on the fly. Also allows you to resize them given that you have the extra space to do so.

 

This helps with people like me who use the old theory of all the major dir's should have there own slice and not jam everything in to /. If everyone has there own slice, you can run into the problem of not allocating enough space to one dir, get's full and then you start makeing symlinks to dir's and pretty soon its all kinds of messy.

Link to comment
Share on other sites

mdk doesn´t come with a lvm i guess?!

is there a secret diskdrake option for it that i have overlooked?

 

I threw in the MDK 9.2_rc2 disk in and went to advanced disk setup during the install and LVM is an option,

 

So there you have it folks, next time you install mdk and you have a decent size drive, why not play with LVM?? Just remember, create the LVM slices somewhat small so you have free space to allocate later. If you use it all up during the initial install, then you've got nothing left over, makes sence right? RIGHT!~ :wink:

Link to comment
Share on other sites

  • 2 weeks later...

Another cool feature, I re-built my Gentoo box AGAIN, cause before I had 2 volume groups on a 40GB & 80GB drive, I didn't realize that I could span one group on both drives, so I did!

 

Well that's not really the cool part, I noticed after I got it up that a df-h showed:

 

/var

/tmp

/home

 

as 25 GB partions, :oops: when I created them I just pushed up on the keyboard and changed /mnt points not the size. Will that stinks, what would I use a 25 GB tmp dir for? NOTHING :D

 

So, to make a long story short I just commented out /tmp & /var from /etc/fstab. umount doesn't work, cause there BUSY!

 

# resize_reiserfs -s-20G /dev/vg/var

# lvreduce -L-20G /dev/vg/var

# mount -treiserfs /dev/vg/var /var

 

So now I have a 5GB /var, just replaced 20 with 23 and the right mnt point (/tmp) and now I have a 2GB /tmp dir.

 

Pretty easy huh?

 

It did give a warning saying that it was experimental and it could blow your system up. I was in the begining for the most part, so who cares. I didn't want 50GB taken up for /var & /tmp so why not experiment??

 

Later, 8)

Link to comment
Share on other sites

Why would you want to rebuild a gentoo system so often!?   :D

 

Idiot comes to mind :oops: I wanted to change the way my HD's were being utilized, had no other way to do it.

 

Plus it's fun! 8)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...