qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] help with understanding qcow2 file format


From: lspnet
Subject: Re: [Qemu-devel] help with understanding qcow2 file format
Date: Fri, 29 Jan 2016 14:40:15 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

hi,I have read 2015-qcow2-expanded.pdf and qcow2.txt,
so I understand how to convert  the offset in the virtual disk to the 
offset into the image file(qcow2).

but I wish to know how to convert  the block using ext4 to the offset in 
the virtual disk. Please help me.

the file block information is below:

address@hidden:$ sudo debugfs /dev/vda1
debugfs: blocks /home/cloud/test
347008

address@hidden:$ stat /home/cloud/test
File: /home/cloud/test
size:8   Blocks:8   IO Block:4096  regular file
Device: fd01h/64769d  Inode:131601  Links:1

OS' file system information is below: (ubuntu 14.04, ext4)

address@hidden:$ fdisk -l 
Disk /dev/vda: 8589 MB, 8589934592 bytes
16 heads, 63 sectors/track, 16644 cylinders, total 16777216 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000005f4

  Device Boot      Start         End      Blocks   Id  System
/dev/vda1   *        2048    12582911     6290432   83  Linux
/dev/vda2        12584958    16775167     2095105    5  Extended
/dev/vda5        12584960    16775167     2095104   82  Linux swap 
/ Solaris

address@hidden:$ dumpe2fs -h /dev/vad1
Filesystem volume name:   <none>
Last mounted on:          /
Filesystem UUID:          bbcbbb0e-a335-46fe-b829-b4bf7bef513b
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      has_journal ext_attr resize_inode dir_index 
filetype needs_recovery extent flex_bg sparse_super large_file 
huge_file uninit_bg dir_nlink 
extra_isize
Filesystem flags:         signed_directory_hash 
Default mount options:    user_xattr acl
Filesystem state:         clean
Errors behavior:          Continue
Filesystem OS type:       Linux
Inode count:              393216
Block count:              1572608
Reserved block count:     78630
Free blocks:              716304
Free inodes:              215296
First block:              0
Block size:               4096
Fragment size:            4096
Reserved GDT blocks:      383
Blocks per group:         32768
Fragments per group:      32768
Inodes per group:         8192
Inode blocks per group:   512
Flex block group size:    16
Filesystem created:       Thu Jan 21 14:42:55 2016
Last mount time:          Fri Jan 29 21:25:03 2016
Last write time:          Fri Jan 29 21:25:03 2016
Mount count:              7
Maximum mount count:      -1
Last checked:             Thu Jan 21 14:42:55 2016
Check interval:           0 (<none>)
Lifetime writes:          4221 MB
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
First inode:              11
Inode size:               256
Required extra isize:     28
Desired extra isize:      28
Journal inode:            8
First orphan inode:       131699
Default directory hash:   half_md4
Directory Hash Seed:      475ee556-9a7f-4c7b-93c3-21249906efea
Journal backup:           inode blocks
Journal features:         journal_incompat_revoke
Journal size:             128M
Journal length:           32768
Journal sequence:         0x00000dc8
Journal start:            18

address@hidden:$ cat /etc/fstab
# /etc/fstab: static file system information.
# <file system> <mount point> <type><options><dump> <pass>
# / was on /dev/vda1 during installation
UUID=bbcbbb0e-a335-46fe-b829-b4bf7bef513b /    
           ext4    errors=remount-ro 0       1
# swap was on /dev/vda5 during installation
UUID=e2e3ec5c-dc4c-4f5d-a176-0f166b419785 none  swap  sw   0  0

reply via email to

[Prev in Thread] Current Thread [Next in Thread]