This change is done after a discussion with Slava and
Raghu.
Change-Id: I225a890f08e162536d080d66bddaeae02196d215
Signed-off-by: Surbhi Palande <sap@rts26.daterainc.com>
Invoking bcachectl will now show you a help
message and a usage indicator.
Change-Id: I9f6163b196b32723c21ddbce04d4a20015173a1a
Signed-off-by: Surbhi Palande <sap@daterainc.com>
the devices in the super-block.
bcache.h: Bring version information to the latest kernel version.
bcache-super-show.c: Add setsize for caching devices. This indicates
the number of devices in caching set.
Testing done:
1.0 make-bcache with --label option and checking back to see if
bcache-super-show shows the devices.
2.0 bcache-super-show does not bail if version is 5.
3.0 bcache-super-show shows the correct setsize.
Change-Id: If0f1ec6204b233b34ff4c8a57a8809d2c8dbe3e3
thie enables building it in a different directory, more
flexible install and configure options, and should make it
easier to eventualy create deb and rpm packages. Additionally
this makes it much easier to build and test this package
as it now behaves the same way as others we are using.
Move the rule to run a bit later, after
the standard udev rules have called blkid.
Don't run blkid manually, and run probe-bcache
as a fallback which can be patched out in a
package that depends on util-linux 2.24+.
probe-bcache: bail if libblkid finds anything
Preserve our last-resort safety check here
in case earlier rules fail to call blkid.
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.