All of lore.kernel.org
 help / color / mirror / Atom feed
From: lspnet <lspnet@126.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] help with understanding qcow2 file format
Date: Fri, 29 Jan 2016 14:40:15 +0000 (UTC)	[thread overview]
Message-ID: <loom.20160129T150306-389@post.gmane.org> (raw)
In-Reply-To: 55F972A6.50906@redhat.com

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:

cloud@cloud-pc:$ sudo debugfs /dev/vda1
debugfs: blocks /home/cloud/test
347008

cloud@cloud-pc:$ 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)

cloud@cloud-pc:$ 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

cloud@cloud-pc:$ 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

cloud@cloud-pc:$ 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

      parent reply	other threads:[~2016-01-29 14:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-16 10:56 [Qemu-devel] help with understanding qcow2 file format Vasiliy Tolstov
2015-09-16 11:04 ` Laszlo Ersek
2015-09-16 11:15   ` Vasiliy Tolstov
2015-09-16 11:58     ` Markus Armbruster
2015-09-16 13:46   ` Eric Blake
2015-09-17  7:07     ` Vasiliy Tolstov
2015-09-17 14:38       ` Eric Blake
2016-01-29 14:40     ` lspnet [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=loom.20160129T150306-389@post.gmane.org \
    --to=lspnet@126.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.