<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Disk on n3s0 || notes</title>
    <link>https://notes.n3s0.tech/tags/disk/</link>
    <description>Recent content in Disk on n3s0 || notes</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Tue, 25 Jul 2023 09:22:56 -0600</lastBuildDate><atom:link href="https://notes.n3s0.tech/tags/disk/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Creating QCOW2 Disk Images With qemu-img(1)</title>
      <link>https://notes.n3s0.tech/posts/20230725092256/</link>
      <pubDate>Tue, 25 Jul 2023 09:22:56 -0600</pubDate>
      
      <guid>https://notes.n3s0.tech/posts/20230725092256/</guid>
      <description>Some notes for creating qcow2 disk images with qemu-img.</description>
      <content:encoded><![CDATA[<p>This is will be a short entry that contains notes for creating qcow2 disk
images using qemu-img(1). For now I&rsquo;m not going to focus entirely on
their use and just creating them. This can be useful for scaffolding the
disks you need for a KVM VM before its creation.</p>
<p>The create option is used to create a new image file.</p>
<p>Using the -f flag it specifies the format that will be generated for the
VM. If this option isn&rsquo;t specified. The qemu-img(1) command will pick a
format.</p>
<p>The file name of the file comes next. The full path can be specified so
it&rsquo;s put in the desired location on the file system. One thing to
consider. Depending on the path this is going to. Permissions may need
to be assigned OR elevation of privileges may be needed to be utilized.</p>
<p>Finally, there is the size portion of the command. This is pretty
straight forward. This is the size of the image file in the location in
bytes. There are four options for this. These are: kilobyte (k/K),
megabyte (M), gigabyte (G), and terabyte (T).</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">qemu-img create -f qcow2 /var/lib/libvirt/images/tl-app-01/tl-app-01-00.qcow2 16G
</span></span></code></pre></div><p>The qemu-img(1) command can do a lot. But, in this scenario I&rsquo;m just
creating image file(s) for a VM server that&rsquo;s being built. Although it&rsquo;s
manual. It&rsquo;s usually part of my process for building qcow2 images.</p>
<h2 id="reference">Reference</h2>
<ul>
<li><a href="https://qemu.readthedocs.io/en/latest/tools/qemu-img.html">qemu-img(1)</a></li>
</ul>
]]></content:encoded>
    </item>
    
  </channel>
</rss>
