From Fedora Project Wiki

Revision as of 01:42, 13 August 2009 by Ricky (talk | contribs) (Initial guest disk resize SOP)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Shortcut:
ISOP:DRESIZE

Resize disks in our Xen guests

Contact Information

Owner: Fedora Infrastructure Team

Contact: #fedora-admin, sysadmin-main

Location: PHX, Tummy, ibiblio, Telia, OSUOSL

Servers: All xen servers

Purpose: Resize guest disks

How to do it

  1. SSH to the xen server and resize the guest's logical volume:
    lvresize -L [new total size]G /dev/VolGroup00/[guest name]
  2. Shutdown the guest and then start it up again:
    xm shutdown -w [guest name]
    xm create [guest name]
  3. Login into the guest:
    xm console [guest name]
  4. On the guest, run
    fdisk /dev/xvda
  5. Delete the third partition (the LVM partition on the guest) and recreate it with the maximum size. Make sure to set its type to LVM.
  6. Run partprobe:
    partprobe
  7. Check the size of the third partition:
    fdisk -l /dev/xvda3
    If this still reflects the old size, then reboot the guest and verify that its size changed correctly when it comes up again.
  8. Login to the guest again, and run
    pvresize /dev/xvda3
  9. A vgs should now show the new size. Use lvresize to resize the root lv:
    lvresize -L [new root partition size]G /dev/GuestVolGroup00/root
  10. Finally, resize the root partition:
    resize2fs /dev/GuestVolGroup00/root
    and verify that everything worked out.