Re: Everchanging bytes at the end of mirror disks
- In reply to: Warner Losh : "Re: Everchanging bytes at the end of mirror disks"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 11 Dec 2022 09:43:01 UTC
11.12.2022 11:22, Warner Losh пишет:
>
>
> On Sat, Dec 10, 2022, 11:52 PM Artem Kuchin <artemkuchin76@gmail.com>
> wrote:
>
> Hello!
>
> I am writing a small utility for myseld and part of it is comparing
> gmirror disks. After running some tests i realized that some bytes at
> the very end of disks are constantly changing.
>
>
> The last sector has metadata about the mirror and about the mirror
> element. It's this latter data that differs.
>
>
Looking at g_mirror.h
struct g_mirror_metadata {
char md_magic[16]; /* Magic value. */
uint32_t md_version; /* Version number. */
char md_name[16]; /* Mirror name. */
uint32_t md_mid; /* Mirror unique ID. */
uint32_t md_did; /* Disk unique ID. */
uint8_t md_all; /* Number of disks in mirror. */
uint32_t md_genid; /* Generation ID. */
uint32_t md_syncid; /* Synchronization ID. */
uint8_t md_priority; /* Disk priority. */
uint32_t md_slice; /* Slice size. */
uint8_t md_balance; /* Balance type. */
uint64_t md_mediasize; /* Size of the smallest
disk in mirror. */
uint32_t md_sectorsize; /* Sector size. */
uint64_t md_sync_offset; /* Synchronized offset. */
uint64_t md_mflags; /* Additional mirror flags. */
uint64_t md_dflags; /* Additional disk flags. */
char md_provider[16]; /* Hardcoded provider. */
uint64_t md_provsize; /* Provider's size. */
u_char md_hash[16]; /* MD5 hash. */
};
From this metadata seems like it is updated nearly each write:
md_sync_offset (from g_mirror_sync_request), md_hash, maybe others. Poor
last sector is written quadrillion times a day every day.
It does not look good to me, but maybe i am wrong? Also, does it mean no
go for gmirror on ssd?
Artem