Skip to contentSkip to conversation

Extending the Root Volume with LVM

linux-lvm Sean McGlynn 5 participants 6 messages Feb 12, 2007 – Feb 20, 2007

lore
Share & tools
lore
#0 lore raw

I am working with
RHEL 4 Update 4. When initially installing the OS I allowed the installation to automatically partition the disk, and it used LVM to create a logical volume to mount the root file system. The only other logical volume it created was for the swap file.

Now, as an
experiment, I am attempting to extend the volume group and logical volume on which root is mounted. Everything appeared to be going smoothly (extending the VG, extending the LV, doing a vgchange, and then a lvm lvchange), but I am now at the point where I want to run e2fsck to check the file system and resize2fs to resize the files system to realize the added space, and I can't do either because the volume is mounted, and cannot be unmounted.

I've read a few
suggestions such as using the installation media to go in in rescue mode, but nothing seems to do the trick. I also read something that said that you cannot extend the root volume, and that you shouldn't have to. This appears to be more accurate than anything else I've read.

Is it the case that
you cannot extent the root volume, and if so, why would RHEL configure the root volume using LVM if you can't? If I am missing something, I would greatly appreciate someone pointing out what I'm missing.

Thank
you.

____________________________________________________________________________________
Don't pick lemons.
See all the new 2007 cars at Yahoo! Autos.
http://autos.yahoo.com/new_cars.html

#1 lore raw
Quoted 5 lines · Sean McGlynn

I am working with RHEL 4 Update 4. When initially installing the OS I allowed the installation to automatically partition the disk, and it used LVM to create a logical volume to mount the root file system. The only other logical volume it created was for the swap file.

Now, as an experiment, I am attempting to extend the volume group and logical volume on which root is mounted. Everything appeared to be going smoothly (extending the VG, extending the LV, doing a vgchange, and then a lvm lvchange), but I am now at the point where I want to run e2fsck to check the file system and resize2fs to resize the files system to realize the added space, and I can't do either because the volume is mounted, and cannot be unmounted.

I've read a few suggestions such as using the installation media to go in in rescue mode, but nothing seems to do the trick.

Why, what problems did you run into? When rescue mode asked you whether you wanted it to find and mount the root partitions, did you select "skip"? Here are step by step instructions on how I reduced the LVM (on FC4), including e2fsck and resize2fs.

https://www.redhat.com/archives/linux-lvm/2006-August/msg00081.html

Quoted 1 line

I also read something that said that you cannot extend the root volume, and that you shouldn't have to. This appears to be more accurate than anything else I've read.

Definitely not true.

#2 lore raw

Clark

Have a look at ext2online. It comes with RHEL 4.

Regards,
Chris

Quoted 37 lines · On Mon, 12 Feb 2007 12:35:45 -0800 Duane Clark <[email protected]> wrote:
Quoted 13 lines · Sean McGlynn

I am working with RHEL 4 Update 4. When initially installing the OS I allowed the installation to automatically partition the disk, and it used LVM to create a logical volume to mount the root file system. The only other logical volume it created was for the swap file.

Now, as an experiment, I am attempting to extend the volume group and logical volume on which root is mounted. Everything appeared to be going smoothly (extending the VG, extending the LV, doing a vgchange, and then a lvm lvchange), but I am now at the point where I want to run e2fsck to check the file system and resize2fs to resize the files system to realize the added space, and I can't do either because the volume is mounted, and cannot be unmounted.

Quoted 2 lines

I've read a few suggestions such as using the installation media to go in in rescue mode, but nothing seems to do the trick.

Why, what problems did you run into? When rescue mode asked you whether you wanted it to find and mount the root partitions, did you select "skip"? Here are step by step instructions on how I reduced the LVM (on FC4), including e2fsck and resize2fs.

https://www.redhat.com/archives/linux-lvm/2006-August/msg00081.html

Quoted 4 lines

I also read
something that said that you cannot extend the root volume, and that you shouldn't have to. This appears to be more accurate than anything else I've read.

Definitely not true.

_______________________________________________
linux-lvm mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

#3 lore raw
Quoted 3 lines · Chris Osicki

Clark

Have a look at ext2online. It comes with RHEL 4.

I'll admit I was unaware of that command. I notice that the third sentence of the man page says "It is only possible to enlarge a mounted filesystem". While Sean was indeed increasing the size, I was trying to reduce it.

<just a bit of venting, so feel free to ignore>
A big pain with Linux, in my view, is that even after using it for six years, I am unaware of the majority of features available in it. I did what I thought was reasonable; I read the HOWTO (the one mentioned down there at the bottom of this email ;). No mention of ext2online there, nor any mention of the steps I used to resize a root filesystem; only the steps for a filesystem that can be easily unmounted while the OS is running.

And in order to figure out the steps to resize the root filesystem, I read through a lot of man pages and web pages and howtos, and nowhere do I recall coming across ext2online (though I'll admit that was awhile ago). By the way, I suggested in my posting that the steps be added to the howto (the subject line was "Howto suggestion..."). And I have seen other postings here with suggestions about the howto.

#4 lore raw
In reply to Sean McGlynn
Quoted 5 lines · Sean McGlynn

I am working with RHEL 4 Update 4. When initially installing the OS I allowed the installation to automatically partition the disk, and it used LVM to create a logical volume to mount the root file system. The only other logical volume it created was for the swap file.

Now, as an experiment, I am attempting to extend the volume group and logical volume on which root is mounted. Everything appeared to be going smoothly (extending the VG, extending the LV, doing a vgchange, and then a lvm lvchange), but I am now at the point where I want to run e2fsck to check the file system and resize2fs to resize the files system to realize the added space, and I can't do either because the volume is mounted, and cannot be unmounted.

I've read a few suggestions such as using the installation media to go in in rescue mode, but nothing seems to do the trick.

Why, what problems are you running into? When rescue mode asked if you wanted it to find and mount the filesystems, did you select "skip"? Here is step by step how I reduced the LVM on FC4, including e2fsck and resize2fs:

https://www.redhat.com/archives/linux-lvm/2006-August/msg00081.html

Quoted 1 line

I also read something that said that you cannot extend the root volume, and that you shouldn't have to. This appears to be more accurate than anything else I've read.

Definitely not true. I have used the above technique on several drives.

#5 lore raw
In reply to Sean McGlynn
Quoted 3 lines · Sean McGlynn

I am working with RHEL 4 Update 4. When initially installing the OS I allowed the installation to

...

Quoted 3 lines

Now, as an experiment, I am attempting to extend the volume group and logical volume on which root is mounted. Everything appeared to be going smoothly (extending the VG, extending the LV, doing a vgchange, and then a lvm lvchange), but I am now at the point where I want to run e2fsck to check the file system and resize2fs to resize the files system to realize the added space, and I can't do either because the volume is mounted, and cannot be unmounted.

I've read a few

you probablu missed to "read the fine manual(TM)" provided with your rhel. or the fine release notes

rhel 4 supports online resize of filesystem, check the man page of ext2online to find more.

L.

Signature · 6 lines
Luca Berra -- [email protected]
       Communication Media & Services S.r.l.
/"\
\ /     ASCII RIBBON CAMPAIGN
 X        AGAINST HTML MAIL
/ \