Fail if the device has any leftover superblock or partition table label.
Add a --wipe-bcache flag to overwrite bcache superblocks and recommend
wipefs for non-bcache superblocks.
Once the device is safe to write, always zero immediately before the
bcache superblock.
Make sure errors go to stderr. Use pkg-config.
As discussed on irc yesterday.
Cheers,
Lars
From 791a4b7b2c25e21ffeb4184da5e61f18cde86246 Mon Sep 17 00:00:00 2001
From: Lars Ellenberg <lars@linbit.com>
Date: Wed, 17 Jul 2013 11:49:12 +0200
Subject: [PATCH] make-bcache: fix guessing of "block_size" to use BLKSSZGET
Using stat.st_blocksize is wrong:
that is the linux buffer cache granularity,
it is tunable, and defaults to 4k.
This caused bcache to default to create devices with
logical_block_size = 4k, potentially breaking otherwise healthy disk
or file system images unnecessarily.
e.g. some xfs image previously created with 512 byte "sector size"
would, once bcache'd, refuse to mount with
mount: function not implemented
device supports 4096 byte sectors (not 512)
We want the logical_block_size here.
Only show nbuckets and nr_this_dev on cache devices;
explain nbuckets' relation to device size by printing
both total_sectors (superblock included) and
cache_sectors (superblock excluded).
This means bcache devices will be registered earlier and in all
cases, not just when the rootfs fails to mount.
The initramfs hook is still there to ensure the bcache module
and udev rules are shipped if an initramfs is used.
Hi Kent,
please find a little patch (attached) to introduce probe-bcache.8 man page to
bcache-tools.
Thank you.
Cheers,
Dmitry.
From 0ff7680042622e356516739936095cb4eab02de6 Mon Sep 17 00:00:00 2001
From: Dmitry Smirnov <onlyjob@member.fsf.org>
Date: Thu, 16 Feb 2012 13:23:00 +1100
Subject: [PATCH] added probe-bcache.8 man page
"bcache.c:120: warning: integer constant is too large for 'long' type"
"bcache.c:128: warning: integer constant is too large for 'long' type"
Signed-off-by: Gwendal Grignou <gwendal@google.com>