[ILUG] How do I add a second disk to a xen vm?

Conor Wynne mariconor at gmail.com
Tue Apr 22 13:06:38 IST 2008


Hi all,

I need to add a second disk to a vm as i didn't make the original large
enough for what I need.
I have done the following so far:

dd if=/dev/zero of=/var/xen_vms/newdisk.img bs=1M count=3000

I then modified theconfig file as follws:

name = "rh4_yum_server"
uuid = "4a61b209-d111-1858-d7e6-948dc934e4af"
maxmem = 400
memory = 400
vcpus = 1
bootloader = "/usr/bin/pygrub"
on_poweroff = "destroy"
on_reboot = "restart"
on_crash = "restart"
vfb = [ "type=vnc,vncunused=1" ]
disk = [ "tap:aio:/var/xen_images/rhel4_yum_server.img,xvda,w" ]
disk = [ "tap:aio:/var/xen_images/yumsrvdisk2.img,xvdb,w" ]
vif = [ "mac=00:16:3e:1e:7c:5a,bridge=xenbr0" ]

I then reboot the rh4_yum_server vm, and then:
[root at rh4 ~]# fdisk -l

Disk /dev/xvda: 4194 MB, 4194304000 bytes
255 heads, 63 sectors/track, 509 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

    Device Boot      Start         End      Blocks   Id  System
/dev/xvda1   *           1          13      104391   83  Linux
/dev/xvda2              14         509     3984120   8e  Linux LVM
[root at rh4 ~]#

No joy then. What am I doing wrong lads?

Conor



More information about the ILUG mailing list