Re: Creating bdev on md array fails, but not quite ...
From: Daniel Smedegaard Buus <hidden>
Date: 2014-03-27 13:35:12
I was a bit quick there — I hadn't realized I was reusing a couple of EBS devices that I'd previously set up as a bdev, so that's why it wouldn't recreate it. Still puzzled, though, why a --wipe would result in a device busy error. On Thu, Mar 27, 2014 at 2:00 PM, Daniel Smedegaard Buus [off-list ref] wrote:
Hi :)
I'm trying to create a scripted bcache setup for an EC2 AMI. It'll
detect appropriate EBS devices, join them in a raid0 array, then do
the same for ephemeral devices. This results in /dev/md0 and /dev/md1.
So far so good.
My script fails when I try to create the bdev;
# make-bcache --bdev /dev/md0
Can't open dev /dev/md0: Device or resource busy
Interesting thing is, I now have
/sys/devices/virtual/block/md0/bcache, though no /sys/block/bcache0.
I can echo 1 > /sys/devices/virtual/block/md0/bcache/stop and the
md0/bcache directory disappears. Trying again, I get:
# make-bcache --bdev /dev/md0
Already a bcache device on /dev/md0, overwrite with --wipe-bcache
# make-bcache --bdev --wipe-bcache /dev/md0
Can't open dev /dev/md0: Device or resource busy
And /sys/devices/virtual/block/md0/bcache reappears.
What gives? This seems pretty strange to me.
The kernel is 3.13.0-19-generic #39-Ubuntu SMP Fri Mar 21 14:18:44 UTC
2014 x86_64 x86_64 x86_64 GNU/Linux
Thanks,
Daniel :)