-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a5749e5
commit 868364d
Showing
3 changed files
with
1,066 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# modify qcow2 | ||
|
||
```bash | ||
# https://platform9.com/blog/how-to-create-customized-qcow-images/ | ||
qemu-img info rhcos-openstack.x86_64.qcow2 | ||
# image: rhcos-openstack.x86_64.qcow2 | ||
# file format: qcow2 | ||
# virtual size: 16 GiB (17179869184 bytes) | ||
# disk size: 2.46 GiB | ||
# cluster_size: 65536 | ||
# Format specific information: | ||
# compat: 1.1 | ||
# compression type: zlib | ||
# lazy refcounts: false | ||
# refcount bits: 16 | ||
# corrupt: false | ||
# extended l2: false | ||
|
||
virt-filesystems --long -h -a rhcos-openstack.x86_64.qcow2 | ||
# Name Type VFS Label Size Parent | ||
# /dev/sda2 filesystem vfat EFI-SYSTEM 127M - | ||
# /dev/sda3 filesystem ext4 boot 350M - | ||
# /dev/sda4 filesystem xfs root 3.3G - | ||
|
||
|
||
# https://docs.openstack.org/image-guide/modify-images.html | ||
modprobe nbd max_part=16 | ||
|
||
qemu-nbd -c /dev/nbd0 rhcos-openstack.x86_64.qcow2 | ||
|
||
partprobe /dev/nbd0 | ||
|
||
ls -l /dev/nbd0* | ||
# brw-rw----. 1 root disk 43, 0 Oct 12 13:55 /dev/nbd0 | ||
# brw-rw----. 1 root disk 43, 1 Oct 12 13:55 /dev/nbd0p1 | ||
# brw-rw----. 1 root disk 43, 2 Oct 12 13:55 /dev/nbd0p2 | ||
# brw-rw----. 1 root disk 43, 3 Oct 12 13:55 /dev/nbd0p3 | ||
# brw-rw----. 1 root disk 43, 4 Oct 12 13:55 /dev/nbd0p4 | ||
|
||
mount /dev/nbd0p2 /mnt/2 | ||
|
||
``` |
Oops, something went wrong.