[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-users] Xen 3.0/FreeBSD Image Resize and 6.1 Status



Hi,

I am currently using the FreeBSD 7 kernel/mdroot from http://www.fsmware.com/xenofreebsd/. It seems to be working pretty well with some limited testing, but the website says that FreeBSD 6.1, released soon, should have dom0 and domU support. Unfortunately, the last update was in February and it looks like the development has slowed down.

Has anybody heard any updates on this within the last month or 2? I am really looking forward to running a known stable FreeBSD in DomU, and if dom0 support really works, I'll be in heaven.

Also, in the archive, I noticed a post in February asking about how to resize the mdroot that can be downloaded from the URL above but I'm not positive how to reply to that since I just signed up for this mailing list today. Anyway, this is how I did it:

1. Use the dd command to create a new image with the appropriate size, something like:
 dd if=/dev/zero of=/path/to/my_big_img bs=1024k count=1000

bs=1024k means 1 megabyte, and count=1000 repeats 1000 times, making it 1 gigabyte. You can increase 1000 to 10000 for 10gigs, or whatever size you want.

2. Modify the xmfreebsd config file so there are two drives instead of one:
disk = [ 'file:/path/to/mdroot,hda1,w', 'file:/path/to/my_big_img,hda2,w' ]

** The next commands are executed inside of the domU, not in dom0! **
3. Boot the FreeBSD config and you will have two block devices, then make the new block a valid file system and mount it with:
 newfs /dev/xbd770
 mount /dev/xbd770 /mnt

Note that you should be sure you're not nuking your valid block device -- and please make a backup first so you don't have to download the image again if something breaks ;) If you used the disk config from step 2 above, these two commands should work perfectly. You can then run a df -h to see how much space is available in your image (should be a bit less than the size you specified).

4. Copy the data over to the new image. There may be a better way, but here is the command I used:
 cd /
 tar cpf - `ls | grep -v mnt` | (cd /mnt && tar xpvf -)

The tar command does a copy preserving all the info and copies everything from / that doesn't match mnt (that way it doesn't start copying what it started copying). The command after the pipe tells it to cd to the mount directory and eXtract (preserving fs info) in to the current directory. Note that I used -v so it tells me each file as it's extracting. You can take off the v for improved copy time, and even add an & to the end so you can mess around until it's done (for example, df -h occasionally to see the progress).

5. shut down your domU and modify the "disk = ..." config line to just use your new, bigger image. Now it should boot in to the new image.

The only problem I've noticed with FreeBSD as a domU is an occasional error during boot up, at which point I have to destroy the guest and recreate it. Seems like some sort of race condition, although it may be related to copying the root fs data the way I did but that seems unlikely. Hope this is helpful to someone and I hope more operating system support is added to Xen soon.

- Andrew

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.