Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Jul 2019 12:37:08 +0200
From:      Emmanuel Vadot <manu@bidouilliste.com>
To:        Pete Wright <pete@nomadlogic.org>
Cc:        freebsd-virtualization@freebsd.org
Subject:   Re: Custom Qcow2 Images
Message-ID:  <20190719123708.de3ac7c0041a7c356080fa7b@bidouilliste.com>
In-Reply-To: <95a027df-46c3-24ba-8acd-ddb24579885e@nomadlogic.org>
References:  <459c53d0-f00b-6ce3-dfab-de3ddac1c0bb@nomadlogic.org> <95a027df-46c3-24ba-8acd-ddb24579885e@nomadlogic.org>

index | next in thread | previous in thread | raw e-mail


 Hi Pete,

On Thu, 18 Jul 2019 19:53:42 -0700
Pete Wright <pete@nomadlogic.org> wrote:

> 
> On 7/14/19 4:37 PM, Pete Wright wrote:
> > Hey there folks,
> > I am wondering if anyone has any pointers on creating a custom Qcow2 
> > FreeBSD that is akin in size to nanobsd.  I have an environment where 
> > we need to run a single binary and want to keep our disk image as 
> > small as possible.  It will run inside a user-mode Qemu process.  
> > Reading through the nanobsd script it seems that it expects a raw disk 
> > for installation, so I do think using the nanobsd script itself well 
> > work well.  Has anyone else done something similar?  My goal is to 
> > have a disk image that is around 500MB.
> >
> > Thanks in advance!
> > -pete
> >
> 
> 
> I wanted to close the loop on this discussion as I think I've found a 
> workable solution for my use-case.  I'm using a three step process:
> 
> 1) generate a raw disk image using "poudriere image".  This phase 
> references a Jail I've built that has disabled lots of uneeded features 
> as per the docs here:
> https://bsdrp.net/documentation/technical_docs/poudriere
> 
> 2) next I use mkimg(1) to convert the raw disk image to a bootable qcow2 
> image that I can boot from Qemu.  this results in a disk image that's 
> about 800MB.
> 
> 3) the final phase is to use qemu-img to create a compressed qcow2 
> image.  the resulting artifact of that process is a ~325MB Qcow2 
> diskimage that actually has decent performance (on my SSD backed zfs 
> filesystem).
> 
> I attempted to use poudriere image to generate a usb image directly, and 
> while that did work well sizing wise i ran into an issue where 
> insufficient inodes were allocated.  I reference what I ran into in this 
> github issue:
> https://github.com/freebsd/poudriere/issues/701

 This is a problem with makefs, I don't recall the details but even
when using -f to ensure that a minimum of free inode were present I had
problems, I'll try to find my notes on this.
 Using rawdisk this uses mdconfig/newfs so you don't have inodes
problems.

> For me this current setup is fine for my purposes, although I'm sure 
> others can optimize this workflow a bit :)

 I won't be against you adding qcow2 support in poudriere image :)

> Also, thanks again Allan and Dave Cottlehuber (who pinged me offlist) 
> for giving me some hints and pointing me in the right direction!
> 
> Cheers,
> -pete
> 
> -- 
> Pete Wright
> pete@nomadlogic.org
> @nomadlogicLA
> 
> _______________________________________________
> freebsd-virtualization@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
> To unsubscribe, send any mail to "freebsd-virtualization-unsubscribe@freebsd.org"


-- 
Emmanuel Vadot <manu@bidouilliste.com> <manu@freebsd.org>


help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20190719123708.de3ac7c0041a7c356080fa7b>