Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Other Things Gentoo
  • Search

[MOSTLY SOLVED] Bcache device not created

Still need help with Gentoo, and your question doesn't fit in the above forums? Here is your last bastion of hope.
Post Reply
Advanced search
5 posts • Page 1 of 1
Author
Message
statikregimen
Apprentice
Apprentice
Posts: 173
Joined: Sat Jul 16, 2011 7:31 am
Location: USA/Michigan
Contact:
Contact statikregimen
Website

[MOSTLY SOLVED] Bcache device not created

  • Quote

Post by statikregimen » Sun Aug 27, 2017 10:03 pm

I followed this: https://forums.gentoo.org/viewtopic-t-959542.html and looked at the wiki. I also checked out the Arch wiki and did some google-fu. Nothing explains what to do if the device isn't created (or at least not added to /dev). Or I'm blind/retarded.

Code: Select all

# make-bcache --cache /dev/md127
UUID:                   bfc3163f-e8ec-421e-b777-20f893ea7e1a
Set UUID:               f0159be2-a75b-4bd2-950e-a46a101abbaa
version:                0
nbuckets:               243056
block_size:             1
bucket_size:            1024
nr_in_set:              1
nr_this_dev:            0
first_bucket:           1

# make-bcache --bdev /dev/sda1 
UUID:                   c8b2c169-3dff-4caa-96b7-8ca1057fe1f8
Set UUID:               2616cd85-dde4-4d1f-917b-8e411f70a265
version:                1
block_size:             1
data_offset:            16

# ls /dev/bcache*
ls: cannot access '/dev/bcache*': No such file or directory

# ls /sys/block/bcache*
ls: cannot access '/sys/block/bcache*': No such file or directory
I've used this partition set up before (in Ubuntu) - md127 is 128GB RAID0 array of 2 SSDs for the cache.
Last edited by statikregimen on Wed Aug 30, 2017 2:15 am, edited 2 times in total.
Top
russK
l33t
l33t
User avatar
Posts: 665
Joined: Tue Jun 27, 2006 3:44 am

  • Quote

Post by russK » Mon Aug 28, 2017 5:56 am

Is it possible you haven't loaded the bcache module?

Code: Select all

# modprobe bcache
Top
statikregimen
Apprentice
Apprentice
Posts: 173
Joined: Sat Jul 16, 2011 7:31 am
Location: USA/Michigan
Contact:
Contact statikregimen
Website

  • Quote

Post by statikregimen » Mon Aug 28, 2017 4:51 pm

That is technically true, because I built it in to the kernel

Code: Select all

--- Multiple devices driver support (RAID and LVM)
<*>   Block device as cache
[ ]     Bcache debugging
[ ]     Debug closures
I don't think that matters, though...In fact, don't you sometimes need to do that if you want to put your root partition on a bcache device (note: that's not what I'm doing in this case - i'll be using it for my /home)?
Top
bbgermany
Veteran
Veteran
User avatar
Posts: 1844
Joined: Mon Feb 21, 2005 8:19 am
Location: Oranienburg/Germany

  • Quote

Post by bbgermany » Mon Aug 28, 2017 5:45 pm

Hi,

What happens, if you run the following:

Code: Select all

echo /dev/md127 > /sys/fs/bcache/register
echo /dev/sda1 > /sys/fs/bcache/register
check the syslog afterwards, there should be something like the following:

Code: Select all

[    3.566663] bcache: register_cache() registered cache device sda1
[    4.169683] bcache: register_bdev() registered backing device md127
greets, bb
Desktop: Ryzen 7 5800X, 32GB, 2TB, RX7700XT
Noebook: Dell XPS 13 9370, 16GB, 1TB
Server #1: Ryzen 5 Pro 4650G, 64GB, 16.5TB
Server #2: Ryzen 4800H, 32GB, 22TB
Top
statikregimen
Apprentice
Apprentice
Posts: 173
Joined: Sat Jul 16, 2011 7:31 am
Location: USA/Michigan
Contact:
Contact statikregimen
Website

  • Quote

Post by statikregimen » Mon Aug 28, 2017 7:35 pm

bbgermany,

That works! Now I get my bcache0 device.

The thing that remains to be seen, is if it will persist through reboots. Getting somewhere though...It just seems odd that it didn't get created automatically like I'm used to, via the make-bcache command.

EDIT: It does not... The Arch wiki says "If the /dev/bcache0 device now exists, type exit and continue booting. You will need to fix your initcpio to ensure devices are registered before mounting the root device. " and I'm not sure what that entails yet. I'm sure I can hack around this but it would be nice to have it set up properly.

EDIT2: I finally found this in the official bcache docs (not that I've spent a ton of time on this):
To make bcache devices known to the kernel, echo them to /sys/fs/bcache/register:

echo /dev/sdb > /sys/fs/bcache/register
echo /dev/sdc > /sys/fs/bcache/register

To register your bcache devices automatically, you could add something like
this to an init script:

echo /dev/sd* > /sys/fs/bcache/register_quiet
The Howto forum post mentions making an init script but I misread it and thought it was for when you want to use the bcache device as your root partition. So I overlooked it. I'm going to go with that solution for now to deal with reboots, but would still love to know if something else is wrong with my system such that /dev/bcache0 wasn't created after running the initial setup commands (make-bcache), like all the tutorials/wikis I've read seem to suggest should have happened. The lack of an init script being generated is probably directly due to Gentoo not being a carebear distro :P

EDIT3: I think this will be my last edit for now... I made the following init script based on another one in my /etc/init.d:

Code: Select all

#!/sbin/openrc-run

depend() {
        before checkfs fsck
        after modules
}

start() {
        echo /dev/sda1 > /sys/fs/bcache/register
        echo /dev/md127 > /sys/fs/bcache/register
        return 0
}

stop() {
        return 0
}
I saved it to /etc/init.d/bcache and then ran:

Code: Select all

cd /etc/init.d/
chmod +x bcache
rc-update add bcache boot
Many huge thanks tor the replies!! <3
Top
Post Reply

5 posts • Page 1 of 1

Return to “Other Things Gentoo”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic