Skip to contentSkip to conversation

Resizing the root LVM partition

linux-lvm Jonathan Morace 4 participants 5 messages Sep 12, 2005 – Sep 14, 2005

lore
Share & tools
lore
#0 lore raw

I'm having a problem adding disks to my root partition, which is using LVM. The quick summary is that I think I need to run resize2fs on the root partition, but I can't figure out how to unmount the root partition to do so.

The longer version of the story... I'm running Fedora Core 2, and when I installed I had the root partition configured to be on two disks using LVM. I added two more disks to the computer and followed the howto to initialize the disks, add the physical volumes to the volume group, and extend the logical volume. When I run "lvdisplay" I see my logical volume is the correct size, but "df" only shows the original size. I'm assuming this is because I haven't done a "resize2fs". The reason I haven't is because I can't figure out how to unmount the root filesystem in order to do this. If I boot with linux rescue, I can choose not to mount the filesystems, but then the LVM devices don't exist. I read somewhere that running "lvm vgscan -v --mknodes" should do the trick, but as far as I could tell, no devices were created.

Any ideas on how I can get the root partition resized to include the new disks?

Thanks for the help,

Jonathan

#1 lore raw
Quoted 19 lines · Jonathan Morace

I'm having a problem adding disks to my root partition, which is using LVM. The quick summary is that I think I need to run resize2fs on the root partition, but I can't figure out how to unmount the root partition to do so.

The longer version of the story... I'm running Fedora Core 2, and when I installed I had the root partition configured to be on two disks using LVM. I added two more disks to the computer and followed the howto to initialize the disks, add the physical volumes to the volume group, and extend the logical volume. When I run "lvdisplay" I see my logical volume is the correct size, but "df" only shows the original size. I'm assuming this is because I haven't done a "resize2fs". The reason I haven't is because I can't figure out how to unmount the root filesystem in order to do this. If I boot with linux rescue, I can choose not to mount the filesystems, but then the LVM devices don't exist. I read somewhere that running "lvm vgscan -v --mknodes" should do the trick, but as far as I could tell, no devices were created.

Quoted 1 line

Any ideas on how I can get the root partition resized to include the new disks?

Hi Jonathan,

if you take a look to the list-archive, you'll find more detailed answer.

In short, boot from a recovery media / Live-CD ( you can't umount root to resize the fs! ), resize your rootfs, reboot.

Ciao
Klaus

Signature · 8 lines
Mit freundlichen Gr�ssen / best regards

Klaus Strebel, Dipl.-Inform. (FH), mailto:[email protected]

/"\
\ /     ASCII RIBBON CAMPAIGN
 X        AGAINST HTML MAIL
/ \
#2 lore raw
In reply to Jonathan Morace
Quoted 19 lines · Jonathan Morace

I'm having a problem adding disks to my root partition, which is using LVM. The quick summary is that I think I need to run resize2fs on the root partition, but I can't figure out how to unmount the root partition to do so.

The longer version of the story... I'm running Fedora Core 2, and when I installed I had the root partition configured to be on two disks using LVM. I added two more disks to the computer and followed the howto to initialize the disks, add the physical volumes to the volume group, and extend the logical volume. When I run "lvdisplay" I see my logical volume is the correct size, but "df" only shows the original size. I'm assuming this is because I haven't done a "resize2fs". The reason I haven't is because I can't figure out how to unmount the root filesystem in order to do this. If I boot with linux rescue, I can choose not to mount the filesystems, but then the LVM devices don't exist. I read somewhere that running "lvm vgscan -v --mknodes" should do the trick, but as far as I could tell, no devices were created.

Quoted 1 line

Any ideas on how I can get the root partition resized to include the new disks?

Run 'lvm vgchange -ay' after the vgscan command and your devices should be there.

Signature · 8 lines
AJ Lewis                                   Voice:  612-638-0500
Red Hat                                    E-Mail: [email protected]
One Main Street SE, Suite 209
Minneapolis, MN 55414
   
Current GPG fingerprint = D9F8 EDCE 4242 855F A03D  9B63 F50C 54A8 578C 8715
Grab the key at: http://people.redhat.com/alewis/gpg.html or one of the
many keyservers out there...
#4 lore raw
In reply to Jonathan Morace
Quoted 1 line · Jonathan Morace

The longer version of the story... I'm running Fedora Core 2, and

Doesn't FC2 come with the kernel patches for online Ext2/3 resizing? Try running ext2online on your LVM device.

Fredrik Tolf

#3 lore raw
In reply to AJ Lewis
Quoted 20 lines
Quoted 20 lines · Jonathan Morace

I'm having a problem adding disks to my root partition, which is using LVM. The quick summary is that I think I need to run resize2fs on the root partition, but I can't figure out how to unmount the root partition to do so.

The longer version of the story... I'm running Fedora Core 2, and when I installed I had the root partition configured to be on two disks using LVM. I added two more disks to the computer and followed the howto to initialize the disks, add the physical volumes to the volume group, and extend the logical volume. When I run "lvdisplay" I see my logical volume is the correct size, but "df" only shows the original size. I'm assuming this is because I haven't done a "resize2fs". The reason I haven't is because I can't figure out how to unmount the root filesystem in order to do this. If I boot with linux rescue, I can choose not to mount the filesystems, but then the LVM devices don't exist. I read somewhere that running "lvm vgscan -v --mknodes" should do the trick, but as far as I could tell, no devices were created.

Quoted 5 lines
Quoted 1 line

Any ideas on how I can get the root partition resized to include the new disks?

On 9/13/05, AJ Lewis <[email protected]> wrote:
Run 'lvm vgchange -ay' after the vgscan command and your devices should be there.

Thank you very much, that was exactly what I needed. For anyone else trying to figure this out...

1. Boot from Fedora install cd (type "linux rescue" from the boot promp)
2. When asked whether you want to find Fedora installations, choose "Skip".
3. Run "lvm vgscan -v --mknodes"
4. Run "lvm vgchange -ay"
5. Run "efsck -f /dev/Volume00/LogVol00" (resize2fs prompted me to do this first)
6. Run "resize2fs /dev/Volume00/LogVol00"
7. Reboot, and everything is good.

Thanks,

Jonathan