Skip to content

Commit

Permalink
ocp
Browse files Browse the repository at this point in the history
  • Loading branch information
wangzheng422 committed Oct 12, 2023
1 parent a5749e5 commit 868364d
Show file tree
Hide file tree
Showing 3 changed files with 1,066 additions and 0 deletions.
42 changes: 42 additions & 0 deletions redhat/notes/2023/2023.10.qcow2.modify.md
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

```
Loading

0 comments on commit 868364d

Please sign in to comment.