qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fam Zheng <famz@redhat.com>
To: 吴兴博 <wuxb45@gmail.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] disk image: self-organized format or raw file
Date: Tue, 12 Aug 2014 19:19:19 +0800	[thread overview]
Message-ID: <20140812111919.GA2803@T430.redhat.com> (raw)
In-Reply-To: <CABPa+v1pjVfNk-gyeARX8+K3S9+SZ4ZrediD7bD3-apTqmxKjQ@mail.gmail.com>

On Tue, 08/12 06:46, 吴兴博 wrote:
> Hi Fam,
>   It's glad to hear you,
> It is said in this post that "All files systems that support inodes
> (ext2/3/4, xfs, btfs, etc) support files with holes while creating the
> files..."
> [
> http://serverfault.com/questions/558761/best-linux-filesystem-for-sparse-files
> ]
> 
> I also heard this claim from other sources, and the only "popular"
> filesystems who don't support holes in real world are just the old FAT32
> and other FAT*.
> Note that holes appear in filesystems when creating a sparse file in
> inode-filesystems. While "punching holes" does remove the existent contents
> from the file, and it was  newly added to only xfs/ext4 in newer linux
> kernel.
> 
> In qemu's disk image, a hole delivers clear message---the corresponding
> sectors/blocks/clusters are never written. So it's up to the guest whether
> to initialize the sectors to zero or just ignore them (filesystems never
> confuse with a uninitialized sector right?). Filesystems should ignore
> uninitialized data just because it's meaningless. Once written, the data
> would be ever meaningful to the guest.
> 
> "punching holes" would add support for "DISCARD" for a image which could
> behave like a SSD. Otherwise the image behaves like a magnetic disk.
> 
> The message in below would not be accurate:
> * cp has --sparse option to support read and create sparse files.
> * Sadly scp doesn't support sparse files.
> * rsync also has a -S --sparse option to properly handle sparse files.
> 
> Not until recently did I realize that the hole is just widely supported in
> *almost* all filesystems. That's why I have come up this idea.
> I understand your concern about the support of hole. If this just because
> the "hole" is never standardized as POSIX or something else?
> 
> So now I get one clear reason: hole is not guaranteed by standardized
> filesystems (I guess a POSIX would be enough).
> Is their something else? If it's the only reason of not using a sparse raw
> file as image, and the only impediment is no-one-should-ever-use FAT32 or
> say the POSIX, we may be very close to  move one step forward.
> 

The problem is cp wouldn't maintain the correctness of a copied raw-with-hole
image, whereas cp does maintain the correctness of any other thin image types,
that has cluster explicit allocation info.

We can't overcome that, unless we tell users "never use `cp' to copy the image,
it will break your data, you have to use `qemu-img convert'". That's
counterintuitive and a step back.

Fam

  reply	other threads:[~2014-08-12 11:19 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-11 23:38 [Qemu-devel] disk image: self-organized format or raw file 吴兴博
2014-08-12  0:52 ` Fam Zheng
2014-08-12 10:46   ` 吴兴博
2014-08-12 11:19     ` Fam Zheng [this message]
     [not found]       ` <CABPa+v1a7meoEtjLkwygjuZEABTqd8q3efGWJvAsAr-mLTQb-A@mail.gmail.com>
     [not found]         ` <20140812113916.GB2803@T430.redhat.com>
2014-08-12 12:03           ` 吴兴博
2014-08-12 12:21             ` Fam Zheng
2014-08-12 13:08   ` Kirill Batuzov
2014-08-12 13:23 ` Eric Blake
2014-08-12 13:45   ` 吴兴博
2014-08-12 14:07     ` Eric Blake
2014-08-12 14:14       ` 吴兴博
2014-08-12 15:30         ` Eric Blake
2014-08-12 16:22           ` Xingbo Wu
2014-08-13  1:29             ` Fam Zheng
2014-08-13 15:42           ` Kevin Wolf
2014-08-12 18:39       ` Richard W.M. Jones
2014-08-12 18:46 ` Daniel P. Berrange
2014-08-12 18:52   ` Richard W.M. Jones
2014-08-12 19:23     ` Xingbo Wu
2014-08-12 20:14       ` Richard W.M. Jones
2014-08-13 15:54 ` Kevin Wolf
2014-08-13 16:38   ` Xingbo Wu
2014-08-13 18:32     ` Kevin Wolf
2014-08-13 21:04       ` Xingbo Wu
2014-08-13 21:35         ` Eric Blake
2014-08-14  2:42         ` Xingbo Wu
2014-08-14  9:06           ` Kevin Wolf
2014-08-14 20:53             ` Xingbo Wu
2014-08-15 10:46               ` Kevin Wolf

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=20140812111919.GA2803@T430.redhat.com \
    --to=famz@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=wuxb45@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).