Quantcast

LVM - How to resize a volume group?

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

LVM - How to resize a volume group?

Dejan Čabrilo-2
Hello all,

I'm new to LVM so my terminology and understanding may be wrong, but
let me try to ask the question:

* I currently have two partitions on a hard disk: sda1 (/boot) and sda2.
* sda2 holds a logical volume group (VolGroup00), which holds 3 volumes.
* I would like to shrink the volume group VolGroup00 (sda2), in order
to free up some space on the hard disk, and create sda3 partition

I know I can free up some space on VolGroup00 (shrink one of the
volumes). But, how can I non-destructively resize the volume group
itself? What would be the steps involved?

Thank you,
Dejan Čabrilo

P.S. Obviously, there are workarounds like using a second HD to move
all my stuff there and then create a new setup, but I'd like to do it
without any workarounds, if possible.

--
fedora-list mailing list
[hidden email]
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: LVM - How to resize a volume group?

Brian Tillman
Hi Dejan,

Can you be more clean on your goal, I understand you'd like to create  
a new filesystem?

Please provide output of the following two commands:

vgdisplay
lvdisplay

Brian


On May 25, 2008, at 8:59 AM, Dejan Čabrilo wrote:

> Hello all,
>
> I'm new to LVM so my terminology and understanding may be wrong, but
> let me try to ask the question:
>
> * I currently have two partitions on a hard disk: sda1 (/boot) and  
> sda2.
> * sda2 holds a logical volume group (VolGroup00), which holds 3  
> volumes.
> * I would like to shrink the volume group VolGroup00 (sda2), in order
> to free up some space on the hard disk, and create sda3 partition
>
> I know I can free up some space on VolGroup00 (shrink one of the
> volumes). But, how can I non-destructively resize the volume group
> itself? What would be the steps involved?
>
> Thank you,
> Dejan Čabrilo
>
> P.S. Obviously, there are workarounds like using a second HD to move
> all my stuff there and then create a new setup, but I'd like to do it
> without any workarounds, if possible.
>
> --
> fedora-list mailing list
> [hidden email]
> To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


--
fedora-list mailing list
[hidden email]
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: LVM - How to resize a volume group?

Dejan Čabrilo-2
> Can you be more clean on your goal, I understand you'd like to create a new
> filesystem?

I would like to create a new primary partition. I currently have sda1
(/boot) and sda2 (lvm), and would like to shrink sda2.

> Please provide output of the following two commands:
> vgdisplay
> lvdisplay

Attached.

Thanks,
Dejan

--
fedora-list mailing list
[hidden email]
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list

lvdisplay (1K) Download Attachment
vgdisplay (862 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: LVM - How to resize a volume group?

Brian Tillman
Dejan

Instead of making a new partition on disk, why not create another logical volume? You can shrink one of the two logical volumes {root | home} and create a new LV for your new partition. This will allow you more flexibility in the future with resizing, and will be worlds easier than shrinking your LV's VG's, PV, the partition, and then writing a new one.

If you're using EXT2/3 for your /home, you can shrink the LV like this:

# umount /home
# e2fsadm -L-1G /dev/VolGroup00/home
# mount /home


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean. See the e2fsadm man page for more information.
See the lvcreate manpage for instructions on creating the new volume.
Brian
On May 25, 2008, at 9:51 AM, Dejan Čabrilo wrote:
Can you be more clean on your goal, I understand you'd like to create a new
filesystem?

I would like to create a new primary partition. I currently have sda1
(/boot) and sda2 (lvm), and would like to shrink sda2.

Please provide output of the following two commands:
vgdisplay
lvdisplay

Attached.

Thanks,
Dejan

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

<lvdisplay><vgdisplay>-- 
fedora-list mailing list


--
fedora-list mailing list
[hidden email]
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: LVM - How to resize a volume group?

Dejan Čabrilo-2
2008/5/25 Brian Tillman <[hidden email]>:
> Instead of making a new partition on disk, why not create another logical
> volume? You can shrink one of the two logical volumes {root | home} and
> create a new LV for your new partition.

Unfortunately, the OS I need this partition for does not read LV's :(

So I truly do need a new primary partition :(

--
fedora-list mailing list
[hidden email]
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: LVM - How to resize a volume group?

Brian Tillman
You'll have to shrink the PV first before resizing the partition..  
see the pvresize man page.

Brian

On May 25, 2008, at 10:18 AM, Dejan Čabrilo wrote:

> 2008/5/25 Brian Tillman <[hidden email]>:
>> Instead of making a new partition on disk, why not create another  
>> logical
>> volume? You can shrink one of the two logical volumes {root |  
>> home} and
>> create a new LV for your new partition.
>
> Unfortunately, the OS I need this partition for does not read LV's :(
>
> So I truly do need a new primary partition :(
>
> --
> fedora-list mailing list
> [hidden email]
> To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


--
fedora-list mailing list
[hidden email]
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: LVM - How to resize a volume group?

Dejan Čabrilo-2
On Sun, May 25, 2008 at 7:33 PM, Brian Tillman
<[hidden email]> wrote:
> You'll have to shrink the PV first before resizing the partition.. see the
> pvresize man page.

Excellent. That seems to be what I was looking for.

Thanks!
Dejan

--
fedora-list mailing list
[hidden email]
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: LVM - How to resize a volume group?

Dejan Čabrilo-2
On Sun, May 25, 2008 at 7:40 PM, Dejan Čabrilo <[hidden email]> wrote:
>> You'll have to shrink the PV first before resizing the partition.. see the
>> pvresize man page.

Right, so I shrunk the PV, and I want to shrink /dev/sda2.

What's the safest way to do it?
Can parted accomplish it, or should I delete a partition in fdisk and
then create a smaller one? (the second option scares the hell out of
me!)

Also, are there any gotchas to watch for?

Thanks,
Dejan

--
fedora-list mailing list
[hidden email]
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: LVM - How to resize a volume group?

John Selmys
On 05/27/2008 08:08 AM, Dejan Čabrilo wrote:
On Sun, May 25, 2008 at 7:40 PM, Dejan Čabrilo [hidden email] wrote:
  
You'll have to shrink the PV first before resizing the partition.. see the
pvresize man page.
      

Right, so I shrunk the PV, and I want to shrink /dev/sda2.

What's the safest way to do it?
Can parted accomplish it, or should I delete a partition in fdisk and
then create a smaller one? (the second option scares the hell out of
me!)

Also, are there any gotchas to watch for?

Thanks,
Dejan

  
You'll have to delete /dev/sda2 using fdisk - that's what I use - and then create a new smaller /dev/sda2. Just be careful not to make it smaller than your physical volume. Then you can make /dev/sda3 from the free space you have. Normally I use dd to backup my partition table first, but yours is so small that you could just as easily write it down on a scrap of paper. If you mess things up, you can recover by booting from a liveCD (eg knoppix) and restoring your partition table to its original state.

John
======

--
fedora-list mailing list
[hidden email]
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Loading...