You are not logged in.
I'm trying to set up a cached block device with bcache. I first was using the information in the Arch Wiki. I've created the backing device as well as the caching device, however when I go to attach the cache to the backing I'm given that I don't have permission, as root, to do so. I've checked the perisions with "ls -l" and root has full permissions "lrwxrwxrwx 1 root root 0 Dec 21 22:19 bcache0 -> ../devices/virtual/block/bcache0".
$ sudo echo "f17a3ee8-2408-48df-9485-36f934176f6d" > /sys/block/bcache0/bcache/attach
bash: /sys/block/bcache0/bcache/attach: Permission deniedAt this point I looked elsewhere. I first tried to Google the issue, but that wasn't fruitful. I then went to the documentation over at the Evil Pie Pirate's place, and saw that it suggests to register the devices first as seen in line 49-52 here. To this end I tried "sudo echo /dev/sdb1 > /sys/fs/bcache/register", but, again, am told that I can't do that.
I'm not sure what I should do.
[edit] Solution: use "su" instead of "sudo".
[edit2] Also, for those curious, whatever bug was going around with bcache and btrfs not playing together well seems to have been fixed. I've tried out a number of use cases this morning -- including scrubbing, balancing, degragging, and snapshots -- and so far I haven't gotten any errors. All tests are being conducted on a partition that is being used solely for this test, and is not in normal use, and I haven't tried with a RAID of any sort yet.
Last edited by nstgc (2014-12-22 17:21:18)
Offline
Have you tried to run this as root, not with sudo?
Offline
Have you tried to run this as root, not with sudo?
This worked. Thank you. By, by the way, would it make a difference?
Offline
$ sudo echo "f17a3ee8-2408-48df-9485-36f934176f6d" > /sys/block/bcache0/bcache/attach bash: /sys/block/bcache0/bcache/attach: Permission denied
That command ran echo as root, then, as your normal user, tried to write to /sys/.../attach. You can't do that ![]()
You could have said
sudo bash -c 'echo "f17a3ee8-2408-48df-9485-36f934176f6d" > /sys/block/bcache0/bcache/attach'
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Offline
nstgc wrote:$ sudo echo "f17a3ee8-2408-48df-9485-36f934176f6d" > /sys/block/bcache0/bcache/attach bash: /sys/block/bcache0/bcache/attach: Permission deniedThat command ran echo as root, then, as your normal user, tried to write to /sys/.../attach. You can't do that
You could have said
sudo bash -c 'echo "f17a3ee8-2408-48df-9485-36f934176f6d" > /sys/block/bcache0/bcache/attach'
Ah, thank you.
Offline