Chaps, Perhaps this question is a little basic for this list but I''m not really sure of the simplest method or best tool for the job. I''ve created some images with `dd=/dev/zero ....` and I''m using them for the domUs now. Some of them have been running for a few months with no probs. Trouble is that I''d like to create a separate partition within the domU. Options:- 1 - use fdisk? Not sure if that''s possible for a file-based image. Can''t run it within the domU 2 - run dd to create another partiton? Not sure how that would work 3 - create the new image from scratch and create the new partition as required and tell /etc/fstab about it. -- John Maclean - 07739 171 531 MSc (DIC) _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Sat, 2007-02-24 at 11:46 +0000, john maclean wrote:> Chaps, > > Perhaps this question is a little basic for this list but I''m not > really sure of the simplest method or best tool for the job. > > I''ve created some images with `dd=/dev/zero ....` and I''m using them > for the domUs now. Some of them have been running for a few months > with no probs. Trouble is that I''d like to create a separate partition > within the domU. Options:- > 1 - use fdisk? Not sure if that''s possible for a file-based image. > Can''t run it within the domU > 2 - run dd to create another partiton? Not sure how that would work > 3 - create the new image from scratch and create the new partition as > required and tell /etc/fstab about it. >You can do this pretty easily. For the path of least resistance I''d : Create new images the size of the partition you want to create Do. Not. Format. Them. use xm block-attach to add them , then update the xen config file. Then use fdisk from within the dom-u as you wish. If you do this, be sure to name the block device "sdc" or whatever the next letter would be, not sdc1 , as you will be making sdc1 in the dom-u. Format them from within the dom-u Update fstab as needed fsck mount. Otherwise, do the above, but make the device big enough to partition as you want the primary drive to be. Then simply roast it, format it, cp -dpR everything over that you need then block-detach it after unmounting it. After that, update the xen config files to reflect the new backing for the boot device, and update the boot parameter accordingly. If using an initrd in the dom-u, think for a moment if you need to update any hard coded paths that may have been added in linuxrc. I really recommend just doing the first option. More time to goof off that way. Best, --Tim _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
John, sorry I forgot to mention something to you. If you do slice up a virtual block device into partitions, you will need to use one of the quemu tools known as ''lomount'' to mount them from dom-0. You should probably get familiar with it before putting anything serious on the drive. I have also never attempted to fsck a sliced lv or file backed vbd image from dom-0, I''m not quite sure how you would go about doing that if necessary. Best, --Tim On Sat, 2007-02-24 at 11:46 +0000, john maclean wrote:> Chaps, > > Perhaps this question is a little basic for this list but I''m not > really sure of the simplest method or best tool for the job. > > I''ve created some images with `dd=/dev/zero ....` and I''m using them > for the domUs now. Some of them have been running for a few months > with no probs. Trouble is that I''d like to create a separate partition > within the domU. Options:- > 1 - use fdisk? Not sure if that''s possible for a file-based image. > Can''t run it within the domU > 2 - run dd to create another partiton? Not sure how that would work > 3 - create the new image from scratch and create the new partition as > required and tell /etc/fstab about it. >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
john maclean
2007-Feb-24 12:26 UTC
Fwd: [Xen-users] Creation of additional image within a domU
Thanks for that speedy reply! Didn''t expect any one to make sense of my jumbled initial message. -*- mode fingers_crossed -*- On 24/02/07, Tim Post <tim.post@netkinetics.net> wrote:> John, sorry I forgot to mention something to you. If you do slice up a > virtual block device into partitions, you will need to use one of the > quemu tools known as ''lomount'' to mount them from dom-0. > > You should probably get familiar with it before putting anything serious > on the drive. > > I have also never attempted to fsck a sliced lv or file backed vbd image > from dom-0, I''m not quite sure how you would go about doing that if > necessary. > > Best, > --Tim > > On Sat, 2007-02-24 at 11:46 +0000, john maclean wrote: > > Chaps, > > > > Perhaps this question is a little basic for this list but I''m not > > really sure of the simplest method or best tool for the job. > > > > I''ve created some images with `dd=/dev/zero ....` and I''m using them > > for the domUs now. Some of them have been running for a few months > > with no probs. Trouble is that I''d like to create a separate partition > > within the domU. Options:- > > 1 - use fdisk? Not sure if that''s possible for a file-based image. > > Can''t run it within the domU > > 2 - run dd to create another partiton? Not sure how that would work > > 3 - create the new image from scratch and create the new partition as > > required and tell /etc/fstab about it. > > > >-- John Maclean - 07739 171 531 MSc (DIC) -- John Maclean - 07739 171 531 MSc (DIC) _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
john maclean
2007-Feb-25 00:05 UTC
Re: [Xen-users] Creation of additional image within a domU
Um, for some reason I don''t get any output when i run `fdisk -l` within a domU. Here is the /etc/fstab for the domU. [root@cpxvm ~]# cat /etc/fstab # This file is edited by fstab-sync - see ''man fstab-sync'' for details # /etc/fstab: static file system information. # # <file system> <mount point> <type> <options> <dump> <pass> /dev/sda1 / ext3 defaults 1 1 /dev/sda2 none swap sw 0 0 /dev/sda3 /alpha ext3 defaults 1 1 none /dev/pts devpts gid=5,mode=620 0 0 none /dev/shm tmpfs defaults 0 0 none /proc proc defaults 0 0 none /sys sysfs defaults 0 0 Created image and run ''xm block attach`. All ok so far. Now it should be a case of running fdisk within the domU, right? On 24/02/07, john maclean <jayeola@gmail.com> wrote:> Thanks for that speedy reply! Didn''t expect any one to make sense of > my jumbled initial message. > > -*- mode fingers_crossed -*- > > On 24/02/07, Tim Post <tim.post@netkinetics.net> wrote: > > John, sorry I forgot to mention something to you. If you do slice up a > > virtual block device into partitions, you will need to use one of the > > quemu tools known as ''lomount'' to mount them from dom-0. > > > > You should probably get familiar with it before putting anything serious > > on the drive. > > > > I have also never attempted to fsck a sliced lv or file backed vbd image > > from dom-0, I''m not quite sure how you would go about doing that if > > necessary. > > > > Best, > > --Tim > > > > On Sat, 2007-02-24 at 11:46 +0000, john maclean wrote: > > > Chaps, > > > > > > Perhaps this question is a little basic for this list but I''m not > > > really sure of the simplest method or best tool for the job. > > > > > > I''ve created some images with `dd=/dev/zero ....` and I''m using them > > > for the domUs now. Some of them have been running for a few months > > > with no probs. Trouble is that I''d like to create a separate partition > > > within the domU. Options:- > > > 1 - use fdisk? Not sure if that''s possible for a file-based image. > > > Can''t run it within the domU > > > 2 - run dd to create another partiton? Not sure how that would work > > > 3 - create the new image from scratch and create the new partition as > > > required and tell /etc/fstab about it. > > > > > > > > > > -- > John Maclean - 07739 171 531 > MSc (DIC) > > > -- > John Maclean - 07739 171 531 > MSc (DIC) >-- John Maclean - 07739 171 531 MSc (DIC) _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Mark Williamson
2007-Feb-26 17:32 UTC
Re: [Xen-users] Creation of additional image within a domU
> Perhaps this question is a little basic for this list but I''m not > really sure of the simplest method or best tool for the job. > > I''ve created some images with `dd=/dev/zero ....` and I''m using them > for the domUs now. Some of them have been running for a few months > with no probs. Trouble is that I''d like to create a separate partition > within the domU. Options:- > 1 - use fdisk? Not sure if that''s possible for a file-based image. > Can''t run it within the domU > 2 - run dd to create another partiton? Not sure how that would work > 3 - create the new image from scratch and create the new partition as > required and tell /etc/fstab about it.Well, this is interesting, are you currently exporting the file-based block device to the guest as a whole device, or as a partition? If the latter, then you could just attach another file-based block device as another partition (just add it in the dom0 config and it should show up in the guest). If the former then you''ll need to either repartition your existing VBD (e.g. resize the filesystem in the current VBD) or add a new one then partition it from within the guest. There are probably other ways of doing this too..... With more information about your current setup it should be easier to give more specific suggestions. Cheers, Mark -- Dave: Just a question. What use is a unicyle with no seat? And no pedals! Mark: To answer a question with a question: What use is a skateboard? Dave: Skateboards have wheels. Mark: My wheel has a wheel! _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Mark Williamson
2007-Feb-26 17:35 UTC
Re: [Xen-users] Creation of additional image within a domU
> John, sorry I forgot to mention something to you. If you do slice up a > virtual block device into partitions, you will need to use one of the > quemu tools known as ''lomount'' to mount them from dom-0.This is also shipped with the Xen source distribution because it''s so useful.> You should probably get familiar with it before putting anything serious > on the drive.You can possibly also xm block-attach the VBD into dom0 and then access it. *however* I''m not sure this is guaranteed to be safe when using blktap. It might be OK using the loop device based file-VBDs, but I''m not 100%.> I have also never attempted to fsck a sliced lv or file backed vbd image > from dom-0, I''m not quite sure how you would go about doing that if > necessary.The kpartx tools may be useful here, they create device maps from partition tables. Otherwise, you can read out the partition tables using (s)disk, then create device maps (or bind /dev/loop devices) yourself to correspond to the partitions you''re interested in. So many options :-) Sorry if it''s a bit confusing! Cheers, Mark> Best, > --Tim > > On Sat, 2007-02-24 at 11:46 +0000, john maclean wrote: > > Chaps, > > > > Perhaps this question is a little basic for this list but I''m not > > really sure of the simplest method or best tool for the job. > > > > I''ve created some images with `dd=/dev/zero ....` and I''m using them > > for the domUs now. Some of them have been running for a few months > > with no probs. Trouble is that I''d like to create a separate partition > > within the domU. Options:- > > 1 - use fdisk? Not sure if that''s possible for a file-based image. > > Can''t run it within the domU > > 2 - run dd to create another partiton? Not sure how that would work > > 3 - create the new image from scratch and create the new partition as > > required and tell /etc/fstab about it. > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users-- Dave: Just a question. What use is a unicyle with no seat? And no pedals! Mark: To answer a question with a question: What use is a skateboard? Dave: Skateboards have wheels. Mark: My wheel has a wheel! _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
john maclean
2007-Feb-26 21:48 UTC
Re: [Xen-users] Creation of additional image within a domU
Thanks. `xm block-attach <name> etc etc` worked OK. However ''lomount foo` gave me a " file too big" error. Over to lvm land. I hear that you can resize LVM stuff on the fly. Would''ve been very interesting to see how it would''ve turned out though. On 26/02/07, Mark Williamson <mark.williamson@cl.cam.ac.uk> wrote:> > John, sorry I forgot to mention something to you. If you do slice up a > > virtual block device into partitions, you will need to use one of the > > quemu tools known as ''lomount'' to mount them from dom-0. > > This is also shipped with the Xen source distribution because it''s so useful. > > > You should probably get familiar with it before putting anything serious > > on the drive. > > You can possibly also xm block-attach the VBD into dom0 and then access it. > *however* I''m not sure this is guaranteed to be safe when using blktap. It > might be OK using the loop device based file-VBDs, but I''m not 100%. > > > I have also never attempted to fsck a sliced lv or file backed vbd image > > from dom-0, I''m not quite sure how you would go about doing that if > > necessary. > > The kpartx tools may be useful here, they create device maps from partition > tables. > > Otherwise, you can read out the partition tables using (s)disk, then create > device maps (or bind /dev/loop devices) yourself to correspond to the > partitions you''re interested in. > > So many options :-) Sorry if it''s a bit confusing! > > Cheers, > Mark > > > Best, > > --Tim > > > > On Sat, 2007-02-24 at 11:46 +0000, john maclean wrote: > > > Chaps, > > > > > > Perhaps this question is a little basic for this list but I''m not > > > really sure of the simplest method or best tool for the job. > > > > > > I''ve created some images with `dd=/dev/zero ....` and I''m using them > > > for the domUs now. Some of them have been running for a few months > > > with no probs. Trouble is that I''d like to create a separate partition > > > within the domU. Options:- > > > 1 - use fdisk? Not sure if that''s possible for a file-based image. > > > Can''t run it within the domU > > > 2 - run dd to create another partiton? Not sure how that would work > > > 3 - create the new image from scratch and create the new partition as > > > required and tell /etc/fstab about it. > > > > _______________________________________________ > > Xen-users mailing list > > Xen-users@lists.xensource.com > > http://lists.xensource.com/xen-users > > -- > Dave: Just a question. What use is a unicyle with no seat? And no pedals! > Mark: To answer a question with a question: What use is a skateboard? > Dave: Skateboards have wheels. > Mark: My wheel has a wheel! >-- John Maclean - 07739 171 531 MSc (DIC) _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users