Re: shown disk sizes

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

 



On Wed, 17 Jul 2013 16:37:47 +0200 Christoph Anton Mitterer
<calestyo@xxxxxxxxxxxx> wrote:

> Hi Neil, et al...
> 
> (btw: do we have an issue tracker somewhere?)

Yes - this mailing list.
The protocol is that as long as you care about the issue and haven't had
satisfactory response, you post a "Can anyone help with this" every week or
so.
That way we don't have a problem with lots of stale entries that no-one cares
about.

> 
> I was experimenting a bit... created two GPT partitions exactly 10 GiB
> (aka 20971520 sectors a 512B).
> 
> Created a raid 1 on them:
> mdadm --create /dev/md/data --verbose --metadata=1.2 --raid-devices=2
> --spare-devices=0 --size=max --chunk=32 --level=raid1 --bitmap=internal
> --name=data /dev/sda1 /dev/sdb1
> 
> The size is a multiple of the 32KiB so no rounding effects should kick
> in.

chunksize is not very meaningful for RAID1.  If you add '-v' mdadm should
tell you:
  mdadm: chunk size ignored for this level

Maybe it should round the size down to a multiple of the given chunk size,
but as you said "--size=max", maybe not..  Not sure.

> 
> 
> Now:
> --examine gives for both devices:
> Avail Dev Size : 20969472 (10.00 GiB 10.74 GB)
>      Array Size : 20969328 (10.00 GiB 10.74 GB)
>   Used Dev Size : 20969328 (10.00 GiB 10.74 GB)
>     Data Offset : 2048 sectors
>    Super Offset : 8 sectors
> 
> => Avail is the available payload size on each component device,... so
> given that we have the first 2048S for the superblock/bitmap/etc... that
> fits exactly.
> 
> => Why is the array size / used dev size smaller?

Good question.  Not easy to answer ... it is rather convoluted.  Different
bits of code try to reserve space for things differently and they don't end
up agreeing.  I might try to simplify that.

> 
> 
> 
> --detail gives:
>      Array Size : 10484664 (10.00 GiB 10.74 GB)
>   Used Dev Size : 10484664 (10.00 GiB 10.74 GB)
> 
> => That's half of the Array Size from above? Is that a bug?

The number is in K rather than sectors.  Sorry :-(
The numbers if brackets, which have units, match.

> 
> 
> --query gives even another value:
> /dev/md/data: 9.100GiB raid1 2 devices, 0 spares. Use mdadm --detail for
> more detail.
> => But the device really has 20969328S it seems... so the 9.1 GiB seems
> a bit bogus as well?

I think this is fixed in 3.3-rc1 by commit 570abc6f3881b5152cb1244

http://git.neil.brown.name/git?p=mdadm.git;a=commitdiff;h=570abc6f3881b5152cb1244

> 
> 
> Last but not least... when the tools print values like "10.00 GiB 10.74
> GB"... wouldn't it be better if they printed "~10.00 GiB ~10.74 GB" or
> something like this to show that the values are rounded and not
> _exactly_ 10 GiB... could be helpful to avoid misalignment issues.

Would that really help?  Given that 10.00GiB is not exactly the same as
10.74GB, isn't it obvious that they must be approximations?

I'm not exactly against adding '~' but it doesn't seem necessary.
Does anyone else have thoughts?

Thanks,
NeilBrown

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux