Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Apr 2017 09:12:52 -0700
From:      Maxim Sobolev <sobomax@freebsd.org>
To:        Kirk McKusick <mckusick@mckusick.com>
Cc:        FreeBSD Filesystems <freebsd-fs@freebsd.org>
Subject:   Re: UFS snapshot "file" is slightly bigger than underlying disk partition
Message-ID:  <CAH7qZfvn7ra03Gg1ZvP6Rr2GBkUxTDPevZ62yXdYMcri_PWXAA@mail.gmail.com>
In-Reply-To: <201704201431.v3KEVN59061503@chez.mckusick.com>
References:  <CAH7qZfs4oBdtvJEir95eHkTeVm%2BTPO59%2Bz2L1n0pXj4o3fB9Ww@mail.gmail.com> <201704201431.v3KEVN59061503@chez.mckusick.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Is it possible to hide it somehow from the external view then by any
chance? If nothing else, there are some reserved areas for boot code for
example and such in the on-disk format as far as I know. What I am
interested here is just making compressed image of the FS with the mkuzip,
but since the snapshot has some extra bytes at the end, what I am getting
is not 1:1 replica, but it now has an extra unwanted block(s) at the end. I
can obviously tweak mkuzip to have ability to ignore trailing XXX bytes,
but IMHO that would better to be handled in the UFS code.

-Max

On Thu, Apr 20, 2017 at 7:31 AM, Kirk McKusick <mckusick@mckusick.com>
wrote:

> > From: Maxim Sobolev <sobomax@freebsd.org>
> > Date: Thu, 20 Apr 2017 02:39:12 -0700
> > Subject: UFS snapshot "file" is slightly bigger than underlying disk
> partition
> > To: FreeBSD Filesystems <freebsd-fs@freebsd.org>,
> >         Kirk McKusick <mckusick@mckusick.com>
> >
> > Hi Kirk,
> >
> > I've noticed that the snapshot file is slightly bigger than underlying
> disk
> > partition. First I thought it's some kind of header attached to the end,
> > but the size of difference is actually dependent on the disk size. Is it
> by
> > design, or some sort of "off by x" error? What's annoying about that is
> > that the size is not multiple of SECTOR_SIZE. Also looks like if I just
> cut
> > that junk out resulting FS image is just as usable.
> >
> > Attached script illustrates that. The first column is size of the
> > partition, the second column is the size of the difference, both in
> bytes.
> >
> > 1048576 48
> > 2097152 56
> > 4194304 72
> > 8388608 72
> > 16777216 72
> > 33554432 72
> > 67108864 72
> > 134217728 72
> > 268435456 72
> > 536870912 72
> > 1073741824 72
> > 2147483648 72
> > 4294967296 96
> > 8589934592 152
> > 17179869184 256
> > 34359738368 464
> > 68719476736 880
> > 137438953472 1720
> > 274877906944 3392
> > 549755813888 6744
> >
> > Please advise, thanks.
> >
> > -Max
> > (P.S. This is 11.0-RELEASE-p9)
>
> The extra space is for auxilary information that is used to track
> changes made in the snapshot. Removing it will cause your snapshot
> maintainance to slow down by 10-100x and in the worst case can
> cause it to become corrupt. In short, don't mess with it.
>
>         Kirk McKusick
>
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAH7qZfvn7ra03Gg1ZvP6Rr2GBkUxTDPevZ62yXdYMcri_PWXAA>