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

zpool split cannot open '/dev/sdc': Device or resource busy #807

Closed
stroobandt opened this issue Jul 5, 2012 · 4 comments
Closed

zpool split cannot open '/dev/sdc': Device or resource busy #807

stroobandt opened this issue Jul 5, 2012 · 4 comments
Milestone

Comments

@stroobandt
Copy link

My situation: I am running 0.6.0.65-0ubuntu1~precise1. I have a 3-way mirror with a filesystem tank/home that is mounted as /home with legacy. (Without legacy would not work, but that is a different bug.) So:

zfs list

NAME USED AVAIL REFER MOUNTPOINT
tank 369G 544G 30K /tank
tank/home 369G 544G 369G legacy

Problem:

zpool split tank backup /dev/sdc

always results in the following message:
cannot open '/dev/sdc': Device or resource busy

(I actually use /dev/by-id instead of /dev/sdc, but I left this out for clarity.)
Putting /dev/sdc offline works, but does not resolve this issue.
Manually umount /home does not work because device is busy.

@behlendorf
Copy link
Contributor

This is likely because the device has been opened O_EXCL, this has slightly different behavior than on Solaris where it's just advisory. There are several other bugs like this which are being looked at.

@stroobandt
Copy link
Author

Is there a convenient way to forcefully change this O_EXCL flag on the command line?
I find myself now using parted to delete partition tables in order to circumvent this...

@behlendorf
Copy link
Contributor

This was fixed in 0.6.1 as a consequence of resolving the hot spares issues. See issue #250 commit 8128bd8.

[behlendo@centos-6-3-amd64 zfs]$ sudo zpool status -v
  pool: tank
 state: ONLINE
  scan: none requested
config:

        NAME            STATE     READ WRITE CKSUM
        tank            ONLINE       0     0     0
          mirror-0      ONLINE       0     0     0
            /tmp/vdev1  ONLINE       0     0     0
            /tmp/vdev2  ONLINE       0     0     0
            /tmp/vdev3  ONLINE       0     0     0

errors: No known data errors

[behlendo@centos-6-3-amd64 zfs]$ sudo zpool split tank backup /tmp/vdev3
[behlendo@centos-6-3-amd64 zfs]$ sudo zpool status -v
  pool: tank
 state: ONLINE
  scan: none requested
config:

        NAME            STATE     READ WRITE CKSUM
        tank            ONLINE       0     0     0
          mirror-0      ONLINE       0     0     0
            /tmp/vdev1  ONLINE       0     0     0
            /tmp/vdev2  ONLINE       0     0     0

errors: No known data errors
[behlendo@centos-6-3-amd64 zfs]$ sudo zpool import -d /tmp/
   pool: backup
     id: 13729394525721321345
  state: ONLINE
 action: The pool can be imported using its name or numeric identifier.
 config:

        backup        ONLINE
          /tmp/vdev3  ONLINE

@wq9578
Copy link

wq9578 commented Mar 20, 2023

Same experience in current zfs-macOS-2.1.6-1 (maybe similar to moby/moby#24403).

A similar earlier attempt was, however, successful.

[user@host:~]% sudo zpool split testpool testpool3 /dev/disk2s1                              
cannot open '/dev/disk2s1': Resource busy
Unable to split testpool: Device list must include at most one disk from each mirror
[user@host:~]% sudo zpool split testpool testpool3 media-72A23CE3-[...]
cannot open '/private/var/run/disk/by-id/media-72A23CE3-[...]': Resource busy
Unable to split testpool: permission denied
[user@host:~]% zfs -V                       
zfs-macOS-2.1.6-1
zfs-kmod-2.1.6-1
[user@host:~]% brew info openzfs
==> openzfs: 2.1.6,432
https://openzfsonosx.org/
[...]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants