Results 1 to 2 of 2

Thread: Resize a cloned LVM system

  1. #1
    Join Date
    May 2008
    Beans
    1

    Resize a cloned LVM system

    Hi guys,
    I have a 2Gb LVM Ubuntu Hardy which I cloned to a 4Gb hdd using ddrescue, it's working great but I need to somehow make use of the extra 2Gb physical size. The current setup is this (cfdisk):

    sda1 Primary Linux ext3 254.99MB
    sda5 Logical Linux LVM 1891.82
    Pri/Log Free Space 2187.93

    how do I go about expanding sda5 so it uses the extra 2Gb free space without losing the data already in there?

    Thanks in advance.

  2. #2
    Join Date
    Apr 2008
    Beans
    2

    Re: Resize a cloned LVM system

    It is a safer and probably easier idea to create a new sda6 partition out of the freespace on the drive. You can add that partition to your VG/LV without impacting your data. You get the same effect without the risk to your current data.

    I would recommend backing up your data anyway. It's only 2GB after all.

    Roughly,
    - fdisk the freespace as /dev/sda6
    - vgextend VG /dev/sda6
    - lvresize -L +2G LV
    - resize2fs LV

    Replace "VG" and "LV" with the names of your vg and lv. I'm assuming your LV filesystem is ext2 or ext3 so use resize2fs. If you are using reiserfs then resize_reiserfs.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •