how to release device locked by bcache
up vote
0
down vote
favorite
Today I bought a 128MB SSD disk, installed it, then installed bcache-tools
. After attempting to access the device I got these errors:
root@dev:/sys/block/sda/bcache# make-bcache -B /dev/sdb1 /dev/sdb1 -C /dev/sda
Can't open dev /dev/sda: Device or resource busy
root@dev:/sys/block/sda/bcache# fdisk /dev/sda
Welcome to fdisk (util-linux 2.27.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
/dev/sda: device contains a valid 'bcache' signature; it is strongly recommended to wipe the device with wipefs(8) if this is unexpected, in order to avoid possible collisions
Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0xfef282bc.
Command (m for help): q
root@dev:/sys/block/sda/bcache# wipefs -a /dev/sda
wipefs: error: /dev/sda: probing initialization failed: Device or resource busy
root@dev:/sys/block/sda/bcache#
So I have the following questions:
- Why did
bcache
started to use my SSD disk (/dev/sda) without even asking me for permission? That's a lot of disrespect to the authority. - How do I disable
bcache
so I can properly format the devices, they are not formatted yet.
This is the output of ls -l in bcache
devices:
root@dev:/sys/block/sda/bcache# ls -l
total 0
-r--r--r-- 1 root root 4096 Apr 26 18:47 block_size
-r--r--r-- 1 root root 4096 Apr 26 18:47 btree_written
-r--r--r-- 1 root root 4096 Apr 26 18:47 bucket_size
-rw-r--r-- 1 root root 4096 Apr 26 18:47 cache_replacement_policy
--w------- 1 root root 4096 Apr 26 18:47 clear_stats
-rw-r--r-- 1 root root 4096 Apr 26 18:47 discard
-r--r--r-- 1 root root 4096 Apr 26 18:47 io_errors
-r--r--r-- 1 root root 4096 Apr 26 18:47 metadata_written
-r--r--r-- 1 root root 4096 Apr 26 18:47 nbuckets
-r--r--r-- 1 root root 4096 Apr 26 18:47 priority_stats
lrwxrwxrwx 1 root root 0 Apr 26 18:47 set -> ../../../../../../../../../../fs/bcache/b9d9517a-a606-4ac2-86dc-3399e9678381
-r--r--r-- 1 root root 4096 Apr 26 18:47 written
root@dev:/sys/block/sda/bcache# pwd
/sys/block/sda/bcache
root@dev:/sys/block/sda/bcache#
.
root@dev:/sys/fs/bcache# ls -l
total 0
drwxr-xr-x 7 root root 0 Apr 26 19:00 b9d9517a-a606-4ac2-86dc-3399e9678381
--w------- 1 root root 4096 Apr 26 19:00 register
--w------- 1 root root 4096 Apr 26 19:00 register_quiet
root@dev:/sys/fs/bcache#
bcache
add a comment |
up vote
0
down vote
favorite
Today I bought a 128MB SSD disk, installed it, then installed bcache-tools
. After attempting to access the device I got these errors:
root@dev:/sys/block/sda/bcache# make-bcache -B /dev/sdb1 /dev/sdb1 -C /dev/sda
Can't open dev /dev/sda: Device or resource busy
root@dev:/sys/block/sda/bcache# fdisk /dev/sda
Welcome to fdisk (util-linux 2.27.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
/dev/sda: device contains a valid 'bcache' signature; it is strongly recommended to wipe the device with wipefs(8) if this is unexpected, in order to avoid possible collisions
Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0xfef282bc.
Command (m for help): q
root@dev:/sys/block/sda/bcache# wipefs -a /dev/sda
wipefs: error: /dev/sda: probing initialization failed: Device or resource busy
root@dev:/sys/block/sda/bcache#
So I have the following questions:
- Why did
bcache
started to use my SSD disk (/dev/sda) without even asking me for permission? That's a lot of disrespect to the authority. - How do I disable
bcache
so I can properly format the devices, they are not formatted yet.
This is the output of ls -l in bcache
devices:
root@dev:/sys/block/sda/bcache# ls -l
total 0
-r--r--r-- 1 root root 4096 Apr 26 18:47 block_size
-r--r--r-- 1 root root 4096 Apr 26 18:47 btree_written
-r--r--r-- 1 root root 4096 Apr 26 18:47 bucket_size
-rw-r--r-- 1 root root 4096 Apr 26 18:47 cache_replacement_policy
--w------- 1 root root 4096 Apr 26 18:47 clear_stats
-rw-r--r-- 1 root root 4096 Apr 26 18:47 discard
-r--r--r-- 1 root root 4096 Apr 26 18:47 io_errors
-r--r--r-- 1 root root 4096 Apr 26 18:47 metadata_written
-r--r--r-- 1 root root 4096 Apr 26 18:47 nbuckets
-r--r--r-- 1 root root 4096 Apr 26 18:47 priority_stats
lrwxrwxrwx 1 root root 0 Apr 26 18:47 set -> ../../../../../../../../../../fs/bcache/b9d9517a-a606-4ac2-86dc-3399e9678381
-r--r--r-- 1 root root 4096 Apr 26 18:47 written
root@dev:/sys/block/sda/bcache# pwd
/sys/block/sda/bcache
root@dev:/sys/block/sda/bcache#
.
root@dev:/sys/fs/bcache# ls -l
total 0
drwxr-xr-x 7 root root 0 Apr 26 19:00 b9d9517a-a606-4ac2-86dc-3399e9678381
--w------- 1 root root 4096 Apr 26 19:00 register
--w------- 1 root root 4096 Apr 26 19:00 register_quiet
root@dev:/sys/fs/bcache#
bcache
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Today I bought a 128MB SSD disk, installed it, then installed bcache-tools
. After attempting to access the device I got these errors:
root@dev:/sys/block/sda/bcache# make-bcache -B /dev/sdb1 /dev/sdb1 -C /dev/sda
Can't open dev /dev/sda: Device or resource busy
root@dev:/sys/block/sda/bcache# fdisk /dev/sda
Welcome to fdisk (util-linux 2.27.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
/dev/sda: device contains a valid 'bcache' signature; it is strongly recommended to wipe the device with wipefs(8) if this is unexpected, in order to avoid possible collisions
Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0xfef282bc.
Command (m for help): q
root@dev:/sys/block/sda/bcache# wipefs -a /dev/sda
wipefs: error: /dev/sda: probing initialization failed: Device or resource busy
root@dev:/sys/block/sda/bcache#
So I have the following questions:
- Why did
bcache
started to use my SSD disk (/dev/sda) without even asking me for permission? That's a lot of disrespect to the authority. - How do I disable
bcache
so I can properly format the devices, they are not formatted yet.
This is the output of ls -l in bcache
devices:
root@dev:/sys/block/sda/bcache# ls -l
total 0
-r--r--r-- 1 root root 4096 Apr 26 18:47 block_size
-r--r--r-- 1 root root 4096 Apr 26 18:47 btree_written
-r--r--r-- 1 root root 4096 Apr 26 18:47 bucket_size
-rw-r--r-- 1 root root 4096 Apr 26 18:47 cache_replacement_policy
--w------- 1 root root 4096 Apr 26 18:47 clear_stats
-rw-r--r-- 1 root root 4096 Apr 26 18:47 discard
-r--r--r-- 1 root root 4096 Apr 26 18:47 io_errors
-r--r--r-- 1 root root 4096 Apr 26 18:47 metadata_written
-r--r--r-- 1 root root 4096 Apr 26 18:47 nbuckets
-r--r--r-- 1 root root 4096 Apr 26 18:47 priority_stats
lrwxrwxrwx 1 root root 0 Apr 26 18:47 set -> ../../../../../../../../../../fs/bcache/b9d9517a-a606-4ac2-86dc-3399e9678381
-r--r--r-- 1 root root 4096 Apr 26 18:47 written
root@dev:/sys/block/sda/bcache# pwd
/sys/block/sda/bcache
root@dev:/sys/block/sda/bcache#
.
root@dev:/sys/fs/bcache# ls -l
total 0
drwxr-xr-x 7 root root 0 Apr 26 19:00 b9d9517a-a606-4ac2-86dc-3399e9678381
--w------- 1 root root 4096 Apr 26 19:00 register
--w------- 1 root root 4096 Apr 26 19:00 register_quiet
root@dev:/sys/fs/bcache#
bcache
Today I bought a 128MB SSD disk, installed it, then installed bcache-tools
. After attempting to access the device I got these errors:
root@dev:/sys/block/sda/bcache# make-bcache -B /dev/sdb1 /dev/sdb1 -C /dev/sda
Can't open dev /dev/sda: Device or resource busy
root@dev:/sys/block/sda/bcache# fdisk /dev/sda
Welcome to fdisk (util-linux 2.27.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
/dev/sda: device contains a valid 'bcache' signature; it is strongly recommended to wipe the device with wipefs(8) if this is unexpected, in order to avoid possible collisions
Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0xfef282bc.
Command (m for help): q
root@dev:/sys/block/sda/bcache# wipefs -a /dev/sda
wipefs: error: /dev/sda: probing initialization failed: Device or resource busy
root@dev:/sys/block/sda/bcache#
So I have the following questions:
- Why did
bcache
started to use my SSD disk (/dev/sda) without even asking me for permission? That's a lot of disrespect to the authority. - How do I disable
bcache
so I can properly format the devices, they are not formatted yet.
This is the output of ls -l in bcache
devices:
root@dev:/sys/block/sda/bcache# ls -l
total 0
-r--r--r-- 1 root root 4096 Apr 26 18:47 block_size
-r--r--r-- 1 root root 4096 Apr 26 18:47 btree_written
-r--r--r-- 1 root root 4096 Apr 26 18:47 bucket_size
-rw-r--r-- 1 root root 4096 Apr 26 18:47 cache_replacement_policy
--w------- 1 root root 4096 Apr 26 18:47 clear_stats
-rw-r--r-- 1 root root 4096 Apr 26 18:47 discard
-r--r--r-- 1 root root 4096 Apr 26 18:47 io_errors
-r--r--r-- 1 root root 4096 Apr 26 18:47 metadata_written
-r--r--r-- 1 root root 4096 Apr 26 18:47 nbuckets
-r--r--r-- 1 root root 4096 Apr 26 18:47 priority_stats
lrwxrwxrwx 1 root root 0 Apr 26 18:47 set -> ../../../../../../../../../../fs/bcache/b9d9517a-a606-4ac2-86dc-3399e9678381
-r--r--r-- 1 root root 4096 Apr 26 18:47 written
root@dev:/sys/block/sda/bcache# pwd
/sys/block/sda/bcache
root@dev:/sys/block/sda/bcache#
.
root@dev:/sys/fs/bcache# ls -l
total 0
drwxr-xr-x 7 root root 0 Apr 26 19:00 b9d9517a-a606-4ac2-86dc-3399e9678381
--w------- 1 root root 4096 Apr 26 19:00 register
--w------- 1 root root 4096 Apr 26 19:00 register_quiet
root@dev:/sys/fs/bcache#
bcache
bcache
asked Apr 27 at 0:05
Nulik
1187
1187
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
bcache
doesn't do this. Either the disk you purchased wasn't clean and already contained a bcache superblock upon unboxing (so it may be a returned drive that wasn't wiped properly), or the first command you ran was fishy: It has /dev/sdb1
twice on the command line which may have confused the command and it already created the superblock and attached /dev/sdb1
.
To get rid of it, detach the backing device:
# echo 1 >/sys/block/sdb/sdb1/bcache/detach
Then unregister the cache:
# echo 1 >/sys/fs/bcache/b9d9517a-a606-4ac2-86dc-3399e9678381/unregister
Now, instantly wipe it before udev reregisters it:
# wipe -a /dev/sda
Do not be confused that /dev/sdb1
still shows up as under control of bcache. It doesn't hurt and you can access it through /dev/bcache0
. It's not attached to a cache and thus doesn't benefit from any caching, it works in pass-through mode until you re-attach it to a cache manually:
# echo CACHE_SET_ID >/sys/block/sdb/sdb1/bcache/attach
In that case, you create a cache device only, then attach any disk to it (with the above command following this one):
# make-bcache -C CACHE_DEV
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
bcache
doesn't do this. Either the disk you purchased wasn't clean and already contained a bcache superblock upon unboxing (so it may be a returned drive that wasn't wiped properly), or the first command you ran was fishy: It has /dev/sdb1
twice on the command line which may have confused the command and it already created the superblock and attached /dev/sdb1
.
To get rid of it, detach the backing device:
# echo 1 >/sys/block/sdb/sdb1/bcache/detach
Then unregister the cache:
# echo 1 >/sys/fs/bcache/b9d9517a-a606-4ac2-86dc-3399e9678381/unregister
Now, instantly wipe it before udev reregisters it:
# wipe -a /dev/sda
Do not be confused that /dev/sdb1
still shows up as under control of bcache. It doesn't hurt and you can access it through /dev/bcache0
. It's not attached to a cache and thus doesn't benefit from any caching, it works in pass-through mode until you re-attach it to a cache manually:
# echo CACHE_SET_ID >/sys/block/sdb/sdb1/bcache/attach
In that case, you create a cache device only, then attach any disk to it (with the above command following this one):
# make-bcache -C CACHE_DEV
add a comment |
up vote
0
down vote
bcache
doesn't do this. Either the disk you purchased wasn't clean and already contained a bcache superblock upon unboxing (so it may be a returned drive that wasn't wiped properly), or the first command you ran was fishy: It has /dev/sdb1
twice on the command line which may have confused the command and it already created the superblock and attached /dev/sdb1
.
To get rid of it, detach the backing device:
# echo 1 >/sys/block/sdb/sdb1/bcache/detach
Then unregister the cache:
# echo 1 >/sys/fs/bcache/b9d9517a-a606-4ac2-86dc-3399e9678381/unregister
Now, instantly wipe it before udev reregisters it:
# wipe -a /dev/sda
Do not be confused that /dev/sdb1
still shows up as under control of bcache. It doesn't hurt and you can access it through /dev/bcache0
. It's not attached to a cache and thus doesn't benefit from any caching, it works in pass-through mode until you re-attach it to a cache manually:
# echo CACHE_SET_ID >/sys/block/sdb/sdb1/bcache/attach
In that case, you create a cache device only, then attach any disk to it (with the above command following this one):
# make-bcache -C CACHE_DEV
add a comment |
up vote
0
down vote
up vote
0
down vote
bcache
doesn't do this. Either the disk you purchased wasn't clean and already contained a bcache superblock upon unboxing (so it may be a returned drive that wasn't wiped properly), or the first command you ran was fishy: It has /dev/sdb1
twice on the command line which may have confused the command and it already created the superblock and attached /dev/sdb1
.
To get rid of it, detach the backing device:
# echo 1 >/sys/block/sdb/sdb1/bcache/detach
Then unregister the cache:
# echo 1 >/sys/fs/bcache/b9d9517a-a606-4ac2-86dc-3399e9678381/unregister
Now, instantly wipe it before udev reregisters it:
# wipe -a /dev/sda
Do not be confused that /dev/sdb1
still shows up as under control of bcache. It doesn't hurt and you can access it through /dev/bcache0
. It's not attached to a cache and thus doesn't benefit from any caching, it works in pass-through mode until you re-attach it to a cache manually:
# echo CACHE_SET_ID >/sys/block/sdb/sdb1/bcache/attach
In that case, you create a cache device only, then attach any disk to it (with the above command following this one):
# make-bcache -C CACHE_DEV
bcache
doesn't do this. Either the disk you purchased wasn't clean and already contained a bcache superblock upon unboxing (so it may be a returned drive that wasn't wiped properly), or the first command you ran was fishy: It has /dev/sdb1
twice on the command line which may have confused the command and it already created the superblock and attached /dev/sdb1
.
To get rid of it, detach the backing device:
# echo 1 >/sys/block/sdb/sdb1/bcache/detach
Then unregister the cache:
# echo 1 >/sys/fs/bcache/b9d9517a-a606-4ac2-86dc-3399e9678381/unregister
Now, instantly wipe it before udev reregisters it:
# wipe -a /dev/sda
Do not be confused that /dev/sdb1
still shows up as under control of bcache. It doesn't hurt and you can access it through /dev/bcache0
. It's not attached to a cache and thus doesn't benefit from any caching, it works in pass-through mode until you re-attach it to a cache manually:
# echo CACHE_SET_ID >/sys/block/sdb/sdb1/bcache/attach
In that case, you create a cache device only, then attach any disk to it (with the above command following this one):
# make-bcache -C CACHE_DEV
answered Nov 21 at 22:34
hurikhan77
888
888
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1028573%2fhow-to-release-device-locked-by-bcache%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown