All of lore.kernel.org
 help / color / mirror / Atom feed
* How to release backing device from bcache?
@ 2021-01-22 16:52 Brendan Boerner
  2021-01-22 17:14 ` Brendan Boerner
  0 siblings, 1 reply; 2+ messages in thread
From: Brendan Boerner @ 2021-01-22 16:52 UTC (permalink / raw)
  To: linux-bcache

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How to release backing device from bcache?
  2021-01-22 16:52 How to release backing device from bcache? Brendan Boerner
@ 2021-01-22 17:14 ` Brendan Boerner
  0 siblings, 0 replies; 2+ messages in thread
From: Brendan Boerner @ 2021-01-22 17:14 UTC (permalink / raw)
  To: linux-bcache

Nm, user error.

Should have been using 'losetup -o 8192 /dev/loop0 /dev/dm-1'.

Thanks,
Brendan

On Fri, Jan 22, 2021 at 10:52 AM Brendan Boerner <bboerner.biz@gmail.com> wrote:
>
> 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-01-22 18:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-22 16:52 How to release backing device from bcache? Brendan Boerner
2021-01-22 17:14 ` Brendan Boerner

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.