How to resize LVM?

Hello!

I have installed Suse on 70 GB partition on 160 GB disk.
I used LVM and this is a list of LVM disks on 70 GB

1.6 GB /swap
21 GB /root
47 GB /home

and there is a 164 MB /boot partition outside of LVM.

Rest of 160 GB is a 90 GB NTFS partition, which is free - empty.

It is possible to resize LVM, or /root and /home to use entire 160 GB disk?

Yes of course it’s possible :slight_smile: this I guess this is one of the reasons LVM was created.

The info You provided doesn’t tell anything useful. In order to get proper help You would have to post the output of these commands here :

lvscan
pvscan
vgscan
fdisk -l

Alternatively You can do some reading on LVM and figure it out on your own :slight_smile:
LVM HOWTO

Best regards,
Greg

The fact that you did not provide any usefull information makes @glistwan to ask for it. Please put that computer output between CODE tags Posting in Code Tags - A Guide, I say this beecuse I guess you may not know this feature (it is rather hidden in the forum functions). Else it will be more or less unreadable for everybody (including you).

hcvv wrote:
> The fact that you did not provide any usefull information makes
> @glistwan to ask for it.

Well, that’s perhaps a little too pessimistic. We don’t need to know all
the details to be able to tell the OP what to do.

(1) reformat the NTFS partition as an LVM PV
(2) add the PV to the appropriate VG (if there’s more than one VG,
you’ll need to make more than one PV from the NTFS partition)
(3) extend the LVs
(4) extend the filesystems within the LVs

More detailed explanations are in the HOW-TO on how to use the
command-line to do those tasks. Alternatively, you can use the
Partitioner in YaST.

As always, make a backup first!

I do not take any risks. People tell you one and a half line of story and when you then ask for and get the real information, it very of happens to be quite different from what the story suggested. I do not give technical detailed advice based on a biased and hazy view.

I do not take any risks too.
After i am reading instroctions on site LVM HOW TO, decided that is too much for my skills in Linux, i backup all files from home folder, reinstall Suse, used ALL 160 GB disk and copy data back to home folder.
It take almost all afternoon but now i have what i want and all data saved.
Thanks to all;)

That is a very practical solution in your case.

But I still wonder how comes you have an LVM based system when you do not know the LVM basics. (You do not need to answer this one, I can live with many of this sort of questions :’()

No it’s not hard. djh-novell really summarized it in the 4 points he posted so You are just 4 steps away from what You want to do. If I were in your shoes I would do the backup and just try it. The worst thing You can encounter is recovery from backup which most likely what You will have to do anyway when reinstalling from scratch. But the thing You can gain is learning how to do that and it’s so much fun to be able to resize file systems on a running system :slight_smile: Once You get the hang of it it is actually quite easy and LVM has methods to back up some meta data or whatever that’s called that in most cases lets You recover without backup if You screw something up.

@hcvv
I guess by choosing LVM set up during the installation. I never tried that but I guess it can guide You quite well and maybe propose some recommended set up. That’s just a guess of course.

Best regards,
Greg

I ran into something similar while trying to extend the root (/) partition.
I couldn’t get the /mnt/sysimage to unmount.
So I ended up booting “linux rescue” from the FC5 CD.
Then do NOT mount the file system, instead at the shell prompt do:

get the name of the vol group

lvm vgscan

active the vol ie: /dev/Vol files are added)

lvm vgchange -a y /dev/VolGoup00

#Check the existing file system for errors:
e2fsck -f /dev/VolGroup00/LogVol00

#Resize the root (/) file system:
resize2fs /dev/VolGroup00/LogVol00

#Resize LogVol00 where root LV is located
lv lvreduce -l -423 VolGroup00/LogVol00

#Now we can create additional LVs in freed space
lvcreate -L 2G -n LVGIT VolGroup00

####################################
#REBOOT to normal startup system #####
####################################

#View all available logical volumes
lvdisplay

#Format filesystem making it EXT3
mke2fs -j /dev/VolGroup00/LVGIT

#Create mount point /dir
mkdir /git

#Mount LV to mountpoint
mount /dev/VolGroup00/LVGIT /git

#List files on mounted file system
ls -la /git

#Edit file system table config file
vi /etc/fstab

#Append line below
/dev/VolGroup00/LVGIT /git ext3 defaults 0 0

#Unmount filesystem
umount /git

#Test automount
mount -a

#Display all curently mounted filesytems and VOLUMES
df -h

###################################################################################
#Some additional useful commands

#reduce size of a LV partition
lvreduce -L -64M /dev/VolGroup00/LVGIT

#extend LVM volume
lvextend -L +300M /dev/VolGroup00/BACKUP-GIT

#claim extended space
resize2fs -p /dev/VolGroup00/BACKUP-GIT

###################################################################################

LVM howtos
Reference link:
LVM Configuration - How to configured Logical Volumes in Linux - Lvm, Lvs, Pvs, Lvdisplay, Vgs

LVM Configuration
LVM Configuration - How to configured Logical Volumes in Linux - Lvm, Logical Volume Management, Physical Volume, Logica

LVM Resizing Guide
LVM Resizing Guide - Howto Resize Logical Volumes in Linux - Resizing, Lvm, Lvresize, Linux, Vgdisplay

Logical Volume Manager: How can I extend a Volume Group?
Logical Volume Manager: How can I extend a Volume Group? | HowtoForge - Linux Howtos and Tutorials

LVM Snapshots
LVM Snapshots - Redirecting Steams in Linux - Stdout, Stdin, Stderr, Linux, Input

A Beginner’s Guide To LVM
A Beginner’s Guide To LVM | HowtoForge - Linux Howtos and Tutorials

A simple introduction to working with LVM
A simple introduction to working with LVM

Would you like to look at any more background information for improved support of logical volume management?

It makes my blood boil to see these disdainful ‘RTFM’ type responses & references to dense technical information.
The poor guy just wanted to know a simple bit of info.

  1. You need to boot off the OpenSUSE Rescue disk.
    If you do not have it already go here : software.opensuse.org: Download openSUSE 12.3
    Choose ‘Rescue’ & download the disk image.
    Burn it to CD or put it on a USB stick.

  2. Boot from the rescue disk.
    Open Gparted & ‘activate’ the partition containing your Logical Volumes.
    Open Yast & choose Expert Partition tool.
    Click on your Logical Volume & choose which to resize, click resize.

  3. When your finished resizing etc:
    Exit the Expert partitioning tool.
    Open Gparted & DEactivate the partition containg your LV’s.

  4. Exit & reboot.

It takes 1 minute via the provided GUI tools no thanks to the smart asses who rubbished this guy on this thread.


Chris