LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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 10-19-2005, 10:37 AM   #1
eigoteacher
LQ Newbie
 
Registered: Oct 2005
Distribution: Fedora Core 3
Posts: 1

Rep: Reputation: 0
Resizing a root LVM filesystem


Hi everyone,

Thanks for your help in advance.

Here's my situation:


I've got 3 hard disks. On the first there is a 100mb boot partition. The rest of that hard-drive and the whole of the other two constitute the physical volumes for an LVM Logical Volume Group.

That Volume Group is then divided into 2 Logical Volumes, a small SWAP partition and the main big one which takes up the remainder of the space. This big partition, which is mounted as my root, has a EXT3 filesystem.

Now I've recently popped in some more ram and want to increase my swap space to compensate.

The trouble is I need to reduce my logical root partition to free up this space first. I can't do this while it's mounted so I try booting from my install (FC3) cd, and running the rescue mode.

If I tell the rescue mode program to mount the system image, the logical volume is mounted and can't be shrunk, so that's no good.

If I tell it not to mount the system image, I can't find the Volume Group anywhere in dev/ nor can I run any of the LVM tools.

So I downloaded a LiveCD from www*sysresccd*org (the *s are .s (I'm not allowed to post URLs in this forum)).

This CD definately has the LVM tools included so that's all good.

I boot up, it's all fine.

I run lvscan, it tells me my Logical Volumes are, as usual, at

/dev/VolGroup00/LogVol00
/dev/VolGroup00/LogVol01

The trouble is I look in dev/ and there's no VolGroup00/ there.

I try resize2fs anyway, but obviously it can't find the filesystem.

So vgscan finds the Volume Group and lvscan the Logical Volume, lvdisplay even prints out all the right information for it, but it doesn't exist in dev/ so I can't shrink it.

So that's pretty much as far as I've gotten before running out of ideas.

Anyone else see something I'm missing?

Thank you again for helping.

Matt
 
Old 10-20-2005, 02:57 AM   #2
MasterC
Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
It may be a difference of using udev versus MAKEDEV or devfs. It's odd that the lvm tools are reporting it, but maybe they are just grabbing their info from fstab or something.

Check the obvious variations:
/dev/vg/
dev/VolGroup/

Otherwise, I don't know for sure what to tell you other than to play with other rescue CD's. I use Gentoo as my rescue CD usually, but I've recently been using Knoppix for it's partimage support. Not pushing anything, but just showing you that there are other rescue options, and maybe trying a few will give you one that works like you expect.

Good Luck!

Cool
 
Old 05-15-2006, 09:40 AM   #3
madsere
LQ Newbie
 
Registered: May 2006
Posts: 3

Rep: Reputation: 0
Same problem here.

Have RHEL4-ES server which was installed with 100% of the disk space allocated to /dev/mapper/VolGroup00-LogVol00. Wanted to shrink this but since it is mounted as root that's not allowed. Created a LiveCD with LVM2, booted from it but vgscan don't see the LVM2 disk.

Have tried creating the device (mknod) but nothing works.

Any suggested method to get this to work?
 
Old 05-15-2006, 09:51 AM   #4
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD
Posts: 2,020

Rep: Reputation: 309Reputation: 309Reputation: 309Reputation: 309
When you boot for your liveCD, first, make sure it has the correct version of LVM. I use LVM2 on my Debian system, but when I boot Knoppix it only has LVM1. Simple enough to install LVM2 on Knoppix however. You should be able to check versions by using the commandline option --version with any of the commands, e.g., "lvdisplay --version".

After verifying you have the correct version of LVM on your LiveCD, you should run "pvscan" [edit] and "vgscan" [/edit]. Then "vgchange -a y".

Now look at your /dev directory and see if things are there.

Last edited by haertig; 05-15-2006 at 10:07 AM.
 
Old 05-15-2006, 10:00 AM   #5
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD
Posts: 2,020

Rep: Reputation: 309Reputation: 309Reputation: 309Reputation: 309
Quote:
Originally Posted by eigoteacher
Now I've recently popped in some more ram and want to increase my swap space to compensate.
MORE ram actually makes you LESS likely to swap. Run "vmstat -s" and look for "pages swapped in" and "pages swapped out" statistics. If you're not currently swapping much, you shouldn't need more swap space. Alternately, load your system down a bit, so that you're using memory, then monitor what's going on with "vmstat -a 5 30". Ignore the first reading, then look at the "si" and "so" columns. You should run this vmstat command at various times under various load conditions to get a better picture of how your memory subsystem is performing.
 
Old 05-15-2006, 10:06 AM   #6
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD
Posts: 2,020

Rep: Reputation: 309Reputation: 309Reputation: 309Reputation: 309
Quote:
Originally Posted by haertig
Simple enough to install LVM2 on Knoppix however.
I guess it would have been nice if I had told you HOW to do this! From a Knoppix boot, open a terminal window, then:
Code:
$ su
# modprobe dm-mod
# apt-get update
# apt-get install lvm-common lvm2
# lndir /lib/lvm-200/ /sbin/
# pvscan
# vgscan
# vgchange -a y
 
Old 05-15-2006, 10:14 AM   #7
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD
Posts: 2,020

Rep: Reputation: 309Reputation: 309Reputation: 309Reputation: 309
Oops - one more post. Madsere - I didn't realize that you had resurected this thread from last year. It's better to start a new topic than to dredge up an old one. I was responding to the OP when I was talking about verifying LVM versions. It wasn't clear that the OP had done that, but you say that you did so it's irrelevent for you. Another reason not to drag up an old thread from the ashes. You asked questions, but my answers were not targeted at you - rather to the OP.
 
Old 08-23-2007, 09:36 AM   #8
adidalax
LQ Newbie
 
Registered: Aug 2007
Posts: 1

Rep: Reputation: 0
Just a quick follow up for those Google'ing for this out there (I was one of them)....

The current (2007.0) Gentoo live CD includes LVM2 support. I was trying to do the same thing on a Dell PowerEdge 6800. All you have to do is boot w/ the following options:

gentoo dolvm2 doscsi

Obviously, if you aren't using SCSI drives, you don't need the second option. This worked for me flawlessly. It detected my VG fine w/o any extra commands, etc...
 
  


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
LVM and shrinking the root filesystem coreychch Linux - Newbie 4 05-21-2012 01:47 AM
LVM: Resizing the root partition fulat2k Linux - General 6 01-08-2012 04:35 PM
Resizing an ext3 LVM Partition PenguinPwrdBox Linux - Software 1 09-04-2005 02:34 AM
Increase EXT3 Filesystem size in a LVM? jadupl2 Red Hat 3 11-14-2004 08:40 PM
bootsector location with lvm filesystem flv7a Linux - General 1 11-07-2003 10:53 AM


All times are GMT -5. The time now is 04:50 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration