mirror of
https://github.com/Dichgrem/Blog.git
synced 2025-12-16 21:42:00 -05:00
update:virtual
This commit is contained in:
@@ -313,6 +313,43 @@
|
||||
</span><span style="color:#888888;"># raw → vhdx
|
||||
</span><span style="color:#ffb964;">qemu-img</span><span> convert</span><span style="color:#ffb964;"> -f</span><span> raw</span><span style="color:#ffb964;"> -O</span><span> vhdx disk.img disk.vhdx
|
||||
</span></code></pre>
|
||||
<h2 id="kuo-zhan">扩展</h2>
|
||||
<ol>
|
||||
<li>扩展大小</li>
|
||||
</ol>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>virsh domblklist <虚拟机名字>
|
||||
</span><span>Target Source
|
||||
</span><span>vda /var/lib/libvirt/images/ubuntu-24-04.qcow2
|
||||
</span><span>
|
||||
</span><span>qemu-img resize /var/lib/libvirt/images/ubuntu-24-04.qcow2 +20G
|
||||
</span></code></pre>
|
||||
<ol start="2">
|
||||
<li>查看磁盘情况:</li>
|
||||
</ol>
|
||||
<pre data-lang="bash" style="background-color:#151515;color:#e8e8d3;" class="language-bash "><code class="language-bash" data-lang="bash"><span style="color:#ffb964;">lsblk
|
||||
</span></code></pre>
|
||||
<ol start="3">
|
||||
<li>如果是单分区系统(ext4):</li>
|
||||
</ol>
|
||||
<ul>
|
||||
<li>安装工具:</li>
|
||||
</ul>
|
||||
<pre data-lang="bash" style="background-color:#151515;color:#e8e8d3;" class="language-bash "><code class="language-bash" data-lang="bash"><span style="color:#ffb964;">sudo</span><span> nix-env</span><span style="color:#ffb964;"> -iA</span><span> nixos.cloud-utils </span><span style="color:#888888;"># 提供 growpart
|
||||
</span></code></pre>
|
||||
<ul>
|
||||
<li>扩展分区:</li>
|
||||
</ul>
|
||||
<pre data-lang="bash" style="background-color:#151515;color:#e8e8d3;" class="language-bash "><code class="language-bash" data-lang="bash"><span style="color:#ffb964;">sudo</span><span> growpart /dev/vda 1
|
||||
</span></code></pre>
|
||||
<ul>
|
||||
<li>扩展文件系统:</li>
|
||||
</ul>
|
||||
<p>ext4:</p>
|
||||
<pre data-lang="bash" style="background-color:#151515;color:#e8e8d3;" class="language-bash "><code class="language-bash" data-lang="bash"><span style="color:#ffb964;">sudo</span><span> resize2fs /dev/vda1
|
||||
</span></code></pre>
|
||||
<p>xfs:</p>
|
||||
<pre data-lang="bash" style="background-color:#151515;color:#e8e8d3;" class="language-bash "><code class="language-bash" data-lang="bash"><span style="color:#ffb964;">sudo</span><span> xfs_growfs /
|
||||
</span></code></pre>
|
||||
<h2 id="ya-suo">压缩</h2>
|
||||
<p>有时候我们需要备份QEMU的镜像,但是镜像大小非常庞大,可以对其进行压缩。</p>
|
||||
<p>首先在虚拟机里(以Ubuntu为例)执行:</p>
|
||||
|
||||
BIN
public/pagefind/fragment/en_38c551a.pf_fragment
Normal file
BIN
public/pagefind/fragment/en_38c551a.pf_fragment
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
public/pagefind/index/en_36835e4.pf_index
Normal file
BIN
public/pagefind/index/en_36835e4.pf_index
Normal file
Binary file not shown.
Binary file not shown.
BIN
public/pagefind/index/en_3fbad4e.pf_index
Normal file
BIN
public/pagefind/index/en_3fbad4e.pf_index
Normal file
Binary file not shown.
Binary file not shown.
BIN
public/pagefind/index/en_64c2165.pf_index
Normal file
BIN
public/pagefind/index/en_64c2165.pf_index
Normal file
Binary file not shown.
BIN
public/pagefind/index/en_b6e357d.pf_index
Normal file
BIN
public/pagefind/index/en_b6e357d.pf_index
Normal file
Binary file not shown.
Binary file not shown.
BIN
public/pagefind/index/en_d4661e9.pf_index
Normal file
BIN
public/pagefind/index/en_d4661e9.pf_index
Normal file
Binary file not shown.
Binary file not shown.
@@ -1 +1 @@
|
||||
{"version":"1.4.0","languages":{"en":{"hash":"en_6fb38cfc92","wasm":"en","page_count":75}},"include_characters":["_","‿","⁀","⁔","︳","︴","﹍","﹎","﹏","_"]}
|
||||
{"version":"1.4.0","languages":{"en":{"hash":"en_2f2a205ef3","wasm":"en","page_count":75}},"include_characters":["_","‿","⁀","⁔","︳","︴","﹍","﹎","﹏","_"]}
|
||||
BIN
public/pagefind/pagefind.en_2f2a205ef3.pf_meta
Normal file
BIN
public/pagefind/pagefind.en_2f2a205ef3.pf_meta
Normal file
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user