Skip to contentSkip to conversation

reading an ex linux bcache disk

DISCUSSION jdd 2 participants 5 messages May 28, 2015 1 message not in the archive bcache (block layer cache)

lore
Share & tools
lore

jdd

author
#0 lore raw

Hello,

I have the following problem.

I used bcache on a computer with one hard drive and one small ssd.

(openSUSE 13.2)

this computer broke, it do not boot anymore. I could only recover the hard drive that seems perfectly working - I can read all the partitions but the bcache one.

is there any way to read the bcache partition content? As far as I know, the computer was shut down properly (it broke because somebody walked on it :-).

right now this is only a theoretical question (the problem is real, but there is nothing important on the bcache partition), but what I read on the net let me think this is not a trivial thing. If the disk content can't be recovered, I wont anymore use bcache :-(.

right now I get a "file system unknown" when I try to mount the bcache partition.

thanks for your help
jdd

A message that is not in the archive (sent off-list or not yet received): CAPBO7Ta2fHeS2eZaxvoTVBhEuukL=Mux7bZEvMCdcwpLJzSZvA@mail.gmail.com

author
#2 lore raw
Quoted 6 lines · Josep Lladonosa
Quoted 1 line

right now I get a "file system unknown" when I try to mount the

bcache partition.

To mount a bcache partition you need an associated caching device (previous ssd, or a newly created), if I am not wrong. At least I had to do this to access to one.

could I use (for a moment only) an usb device? it's not for performance, only to access the partition. It seems to be possible for new install?

thanks
jdd

#3 lore raw
In reply to jdd

Hello jdd,

Quoted 8 lines · you

Hello,

I have the following problem.

I used bcache on a computer with one hard drive and one small ssd.

(openSUSE 13.2)

Quoted 7 lines

this computer broke, it do not boot anymore. I could only recover the hard drive that seems perfectly working - I can read all the partitions but the bcache one.

is there any way to read the bcache partition content? As far as I know, the computer was shut down properly (it broke because somebody walked on it :-).

You can access the contents of the bcache volume without using a cache partition at all. All you'll need is a kernel that supports bcache and one or two commands from the terminal. I don't have time to go into details, but probably it will be something like:

echo 1 > /sys/block/sda/sda3/bcache/running

(Taken from https://wiki.archlinux.org/index.php/Bcache, you may want to look
there or at https://www.kernel.org/doc/Documentation/bcache.txt for more
information.)

Pavel Goran

author
#4 lore raw
Quoted 3 lines · Pavel Goran

You can access the contents of the bcache volume without using a cache partition at all. All you'll need is a kernel that supports bcache and one or two commands from the terminal.

good, because I can't ake the install of bcahe work with the old disk :-(

I don't have time to go into details, but

Quoted 7 lines

probably it will be something like:

echo 1 > /sys/block/sda/sda3/bcache/running

(Taken from https://wiki.archlinux.org/index.php/Bcache, you may want to look
there or at https://www.kernel.org/doc/Documentation/bcache.txt for more
information.)

I will read this now
thanks
jdd

author
#5 lore raw
In reply to Pavel Goran

Le 28/05/2015 11:09, Pavel Goran a écrit :

got it!

Quoted 1 line

echo 1 > /sys/block/sda/sda3/bcache/running

was the key :-)! thanks!

the manual says:

"make-bcache has the ability to format multiple devices at the same time"

but then:

To get started:

mkfs.ext4 /dev/bcache0

so the word "format" is not used always with the same meaning (for me, formatting is creating a file system).

gladfully, make-bcache do *not* format the partition :-)

What I did:

* install a new system elsewhere (same distro I used with bcache). kernel 3.16.7 install bcache-tools

make-bcache -B /dev/sda8 (the old bcache backing)

tried to find /sys/block/sda/bcache, but it do not exist. Your example made me think the manual lacked a level, it have to be sys/block/sda/sda8/bcache

echo 1 > /sys/block/sda/sda3/bcache/running

and then /dev/bcache0 shows up!

mount /dev/bcache0 /mnt allows me to access the files on the partition

so good, thanks!
jdd