Discussion:
Creating bdev on md array fails, but not quite ...
Daniel Smedegaard Buus
2014-03-27 13:00:56 UTC
Permalink
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 :)
Daniel Smedegaard Buus
2014-03-27 13:34:31 UTC
Permalink
I was a bit quick there =E2=80=94 I hadn't realized I was reusing a cou=
ple 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=
=2E

On Thu, Mar 27, 2014 at 2:00 PM, Daniel Smedegaard Buus
Post by Daniel Smedegaard Buus
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=
=2E
Post by Daniel Smedegaard Buus
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
# 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 UT=
C
Post by Daniel Smedegaard Buus
2014 x86_64 x86_64 x86_64 GNU/Linux
Thanks,
Daniel :)
Loading...