All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brendan Boerner <bboerner.biz@gmail.com>
To: linux-bcache@vger.kernel.org
Subject: How to release backing device from bcache?
Date: Fri, 22 Jan 2021 10:52:53 -0600	[thread overview]
Message-ID: <CAKkfZL06PzvN6M+A+RC6C-eTL9uNReQTDbqHGRFbmRA9BzVUtQ@mail.gmail.com> (raw)

How do I get bcache to completely give up access to a backing device
so I can mount it using losetup?

My backing device is an lvm logical volume which I expanded in size.

I want to mount it using losetup to use xfs_growfs however I can't
access the backing device:

root@timber4:/var/log# umount /mnt/archives/ ; echo 1 >
/sys/block/bcache1/bcache/stop ; echo 1 > /sys/block/dm-1/bcache/stop
; losetup -o 8192 /dev/loop0 /dev/vg-bfd02/archives_bc
-bash: /sys/block/dm-1/bcache/stop: No such file or directory
losetup: /dev/vg-bfd02/archives_bc: failed to set up loop device:
Device or resource busy

I know in some cases udev is scurrying in and causing the cache to be
recreated but even immediately after the stop and before udev can get
in the backing device is still locked:

Jan 22 11:48:33 timber4 kernel: [370093.820204] XFS (bcache1):
Unmounting Filesystem
Jan 22 11:48:33 timber4 kernel: [370093.830609] bcache:
bcache_device_free() bcache1 stopped
Jan 22 11:48:33 timber4 systemd[1]: Stopped File System Check on
/dev/disk/by-uuid/cb9c1149-73b8-4929-bcc6-d1599d41da73.
Jan 22 11:48:33 timber4 kernel: [370093.904348] bcache:
register_bcache() error /dev/dm-1: device busy

I was able to do this in the past when I first started learning to use
bcache which is why this is especially perplexing.

Suggestions?

Thanks,
Brendan

             reply	other threads:[~2021-01-22 18:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-22 16:52 Brendan Boerner [this message]
2021-01-22 17:14 ` How to release backing device from bcache? Brendan Boerner

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=CAKkfZL06PzvN6M+A+RC6C-eTL9uNReQTDbqHGRFbmRA9BzVUtQ@mail.gmail.com \
    --to=bboerner.biz@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.