Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot mount bcachefs from lvm raid0 device #313350

Closed
jezcope opened this issue May 21, 2024 · 6 comments · Fixed by #313424
Closed

cannot mount bcachefs from lvm raid0 device #313350

jezcope opened this issue May 21, 2024 · 6 comments · Fixed by #313424
Labels
0.kind: bug Something is broken 0.kind: regression Something that worked before working no longer

Comments

@jezcope
Copy link
Contributor

jezcope commented May 21, 2024

Describe the bug

I have an LVM setup, and I've been trying out bcachefs by using it as scratch space (since it's stuff I don't mind losing) on an LVM RAID0 volume with 4 stripes. Since #304761 updated bcachefs-tools to 1.7.0 I can't mount this, but switching back to a previous generation with bcachefs-tools 1.4.1 or using bcachefs-tools 1.3.3 from nixos-23.11 lets me mount it just fine. Using a linear volume instead also works fine.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Create an LV with -t raid0 --stripes 2
  2. Create a bcachefs filesystem on the new LV
  3. Try to mount the new filesystem

Running bcachefs mount with -v results in:

INFO - bcachefs::commands::cmd_mount: mounting with params: device: /dev/dm-38:/dev/dm-40, target: /mnt, options: 
DEBUG - bcachefs::commands::cmd_mount: parsing mount options: 
INFO - bcachefs::commands::cmd_mount: mounting bcachefs filesystem, /mnt
INFO - bcachefs::commands::cmd_mount: mounting filesystem
ERROR - bcachefs::commands::cmd_mount: Fatal error: Device or resource busy

Expected behavior

Should mount correctly. Output from bcachefs-tools 1.3.3:

INFO - bcachefs_rust::cmd_mount: mounting with params: device: /dev/vg/test, target: /mnt, options: 
DEBUG - bcachefs_rust::cmd_mount: parsing mount options: 
INFO - bcachefs_rust::cmd_mount: mounting bcachefs filesystem, /mnt
INFO - bcachefs_rust::cmd_mount: mounting filesystem
INFO - bcachefs_rust::cmd_mount: Successfully mounted

Additional context

I don't know enough about Linux FS implementations, but suspect it might be an instance of koverstreet/bcachefs-tools#260

Notify maintainers

@davidak @JohnRTitor @Madouura

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.9.1, NixOS, 24.05 (Uakari), 24.05.20240519.6c0b7a9`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Lix, like Nix) 2.90.0-beta.1-lixpre20240506-b6799ab`
 - channels(jez): `""`
 - channels(root): `"home-manager, nixos"`
 - nixpkgs: `/nix/store/r8nhgnkxacbnf4kv8kdi8b6ks3k9b16i-source`

Add a 👍 reaction to issues you find important.

@jezcope jezcope added the 0.kind: bug Something is broken label May 21, 2024
@JohnRTitor
Copy link
Contributor

JohnRTitor commented May 21, 2024

Is it an encrypted setup?

Can you try it with the updated upstream patch?

Test for both master and 1.7.0 branch

@jezcope
Copy link
Contributor Author

jezcope commented May 21, 2024

No, unencrypted. Will give the patch a try... Thanks!

@jezcope
Copy link
Contributor Author

jezcope commented May 21, 2024

Well, the patch doesn't make a difference, but that's ok because just building it from master at kentoverstreet/bcachefs-tools works fine. If I was a betting man I'd guess the issue is fixed by one of the udev-related commits from 7 May. It also gets rid of all the annoying warnings about not finding bcachefs superblocks as it walks the device tree.

Thanks for the pointers, I guess this will be fixed once nixpkgs gets bcachefs-tools 1.7.1?

@JohnRTitor
Copy link
Contributor

So as I understand it, it is working on the bcachefs master branch, with or without the patch?

@jezcope
Copy link
Contributor Author

jezcope commented May 21, 2024

Yes, that's correct. Using the following overlay to my nixpkgs causes everything to work as expected:

final: prev: { bcachefs-tools = inputs.bcachefs-tools.packages.${prev.system}.bcachefs; }

with:

inputs.bcachefs-tools.url = "github:koverstreet/bcachefs-tools";

and this in my flake.lock:

    "bcachefs-tools": {
      "inputs": {
        "flake-compat": "flake-compat",
        "nixpkgs": "nixpkgs",
        "utils": "utils"
      },
      "locked": {
        "lastModified": 1715290148,
        "narHash": "sha256-ZmkeYPiCy7vkXnMFbtUF4761K+I+Ef7UbmSY7dJG09U=",
        "owner": "koverstreet",
        "repo": "bcachefs-tools",
        "rev": "3ac510f6a41feb1b695381fa30869d557c00b822",
        "type": "github"
      },
      "original": {
        "owner": "koverstreet",
        "repo": "bcachefs-tools",
        "type": "github"
      }
    },

@JohnRTitor
Copy link
Contributor

I am motivated to open #313424, as we don't want to ship a broken bcachefs-tools on 24.05. Please do test the PR.

@JohnRTitor JohnRTitor added the 0.kind: regression Something that worked before working no longer label May 21, 2024
JohnRTitor added a commit to JohnRTitor/nixpkgs that referenced this issue May 22, 2024
Moved temporarily to unstable to fix NixOS#313350

Also vendor the updated patch for NixOS#309388
from koverstreet/bcachefs-tools#263
alyssais pushed a commit that referenced this issue May 26, 2024
Moved temporarily to unstable to fix #313350

Also vendor the updated patch for #309388
from koverstreet/bcachefs-tools#263
github-actions bot pushed a commit that referenced this issue May 26, 2024
Moved temporarily to unstable to fix #313350

Also vendor the updated patch for #309388
from koverstreet/bcachefs-tools#263

(cherry picked from commit 1037866)
Sobte pushed a commit to Sobte/nixpkgs that referenced this issue May 28, 2024
Moved temporarily to unstable to fix NixOS#313350

Also vendor the updated patch for NixOS#309388
from koverstreet/bcachefs-tools#263
@JohnRTitor JohnRTitor moved this to Done in Bcachefs Jun 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken 0.kind: regression Something that worked before working no longer
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants