From: Coly Li <colyli@suse.de>
To: clodoaldo.pinto.neto@gmail.com
Cc: "Jens-U. Mozdzen" <jmozdzen@nde.ag>, linux-bcache@vger.kernel.org
Subject: Re: undo make-bcache (was: Re: Can't mount an encrypted backing device)
Date: Fri, 17 Jan 2020 08:58:52 +0800 [thread overview]
Message-ID: <32fb3244-cb9e-460d-3156-99e418dda44f@suse.de> (raw)
In-Reply-To: <CA+Z73LGXJOwYEb+GmPuuDi3TcJbGG=NLv-5vCRcEvB+kgr4a+A@mail.gmail.com>
On 2020/1/17 5:52 上午, Clodoaldo Neto wrote:
>
> Em seg, 13 de jan de 2020 11:19, Coly Li <colyli@suse.de
> <mailto:colyli@suse.de>> escreveu:
>>
>> On 2020/1/13 8:44 下午, Jens-U. Mozdzen wrote:
>> > Hi Coly,
>> >
>> > jumping in here, because I was looking for a way to revert from bcache
>> > to plain device:
>> >
>> > Zitat von Coly Li <colyli@suse.de <mailto:colyli@suse.de>>:
>> >> The super block location of the backing disk is occupied by bcache. You
>> >> cannot mount the file system directly from the backing disk which is
>> >> formated as bcache backing device [...] (bcache offset all I/Os on
>> >> bcache device 4KB behind the requesting
>> >> LBA on backing disk).
>> >
>> > Assuming that no caching device is associated with a backing device (so
>> > the backing device is "clean" as in "containing all data blocks with the
>> > current content"), could one convert the content of a backing device to
>> > a "non-bcached device" by removing the first 4096 octets of the backing
>> > device content?
>> >
>> > Something like "dd if=backingdev of=newdev skip_bytes=4096 ..."?
>>
>> Hi Jens-U,
>>
>> you may try dmsetup to setup a linear device mapper target, and the map
>> table just skipping the first 4KB (bcache superblock area). If you are
>> lucky, I mean the real file system is not corrupted, the created device
>> mapper target can be mounted directly.
>
>
> I'm trying dmsetup but it does not accept anything other than 0 and 0
> at the beginning and end of the table:
>
> # echo '0 3774578672 linear /dev/mapper/backing-device 8' | dmsetup
> create dmb
> device-mapper: reload ioctl on dmb failed: Invalid argument
> Command failed.
The above line should work, if 3774578672 is a correct size number in
sectors.
>
> # echo '8 3774578664 linear /dev/mapper/backing-device 0' | dmsetup
> create dmb
> device-mapper: reload ioctl on dmb failed: Invalid argument
> Command failed.
>
> I'm not sure about how it works. Is it not 8 sectors for 4k bytes?
>
It works on my side, my kernel is Linux v5.5-rc2, lvm2 version is
2.02.180, dmsetup version is 1.02.149. The difference is the device
size, my disk size is much less.
--
Coly Li
next prev parent reply other threads:[~2020-01-17 0:59 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CA+Z73LFJLiP7Z2_cDUsO4Om_8pdD6w1jTSGQB0jY5sL-+nw1Wg@mail.gmail.com>
[not found] ` <CA+Z73LGvXa_V8t=KYPkrmeJ-xmEXmz1uAnaT=Yj5AReZgLeqhg@mail.gmail.com>
[not found] ` <alpine.LRH.2.11.2001062258320.2074@mx.ewheeler.net>
2020-01-11 13:42 ` Can't mount an encrypted backing device Clodoaldo Neto
2020-01-16 22:55 ` Eric Wheeler
2020-01-18 10:44 ` Clodoaldo Neto
[not found] ` <65c05b80-679b-2ccb-1bd1-a9a6887c9c51@suse.de>
2020-01-13 12:44 ` undo make-bcache (was: Re: Can't mount an encrypted backing device) Jens-U. Mozdzen
2020-01-13 14:18 ` Coly Li
[not found] ` <CA+Z73LGG1pBtT=0WN5vEyqEvzxEnqMRZ26S_2x4Gd5JPSmuXmQ@mail.gmail.com>
[not found] ` <CA+Z73LFNxP8kDMSq74DBKDbCXpbtMA9svpc1KddkUmrk-cfnOA@mail.gmail.com>
[not found] ` <CA+Z73LGXJOwYEb+GmPuuDi3TcJbGG=NLv-5vCRcEvB+kgr4a+A@mail.gmail.com>
2020-01-16 21:56 ` Clodoaldo Neto
2020-01-16 23:00 ` Eric Wheeler
2020-01-18 11:44 ` Clodoaldo Neto
2020-01-17 0:58 ` Coly Li [this message]
2020-01-18 10:54 ` Clodoaldo Neto
2020-01-18 12:22 ` Clodoaldo Neto
2020-01-18 12:34 ` Coly Li
2020-01-18 13:43 ` Clodoaldo Neto
2020-01-18 14:16 ` Coly Li
2020-01-18 14:31 ` Coly Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=32fb3244-cb9e-460d-3156-99e418dda44f@suse.de \
--to=colyli@suse.de \
--cc=clodoaldo.pinto.neto@gmail.com \
--cc=jmozdzen@nde.ag \
--cc=linux-bcache@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox