Project

General

Profile

Bug #1699

beadm destroy complains "device busy" if hampered by snapshots

Added by Rich Lowe almost 8 years ago. Updated over 7 years ago.

Status:
Resolved
Priority:
Normal
Category:
cmd - userland programs
Start date:
2011-10-28
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:

Description

Trying to destroy some of my BEs, it complained "device busy". This appears to be because the BE I was trying to destroy had snapshots (of its own, not the origins of other BEs).

It's not clear to me whether it should destroy any snapshots of BE I'm attempting to destroy implicitly, or whether it should, at least, check if snapshots are present and say something directly useful. But it should do one or the other.

This is running Illumos bits circa the 29th of May (sadly, the "clean" BE is that old on this machne).

History

#1

Updated by Alexander Eremin almost 8 years ago

I have:
# beadm list -s
BE/Snapshot Space Policy Created
lxnew
lxnew@2011-05-17-12:55:58 10.3G static 2011-05-17 16:55
lxnew@2011-06-11-11:09:18 44.5M static 2011-06-11 15:09
lxnew@2011-06-21-14:37:22 48.5M static 2011-06-21 18:37
lxnew@2011-06-27-11:28:42 4.04G static 2011-06-27 15:28
lxnew@2011-06-28-08:25:00 197M static 2011-06-28 12:25
# beadm destroy lxnew
Are you sure you want to destroy lxnew?
This action cannot be undone (y/[n]): y
Destroyed successfully

Could you try after reboot, for example?

#2

Updated by Rich Lowe almost 8 years ago

$ sudo beadm create foo
Created successfully
$ sudo zfs snapshot rpool/ROOT/foo@bar
$ sudo beadm destroy foo
Are you sure you want to destroy foo?
This action cannot be undone (y/[n]): y
Unable to destroy foo.
Device busy.
$ sudo zfs destroy rpool/ROOT/foo@bar
$ sudo beadm create foo@bar
Created successfully
$ sudo beadm destroy foo
Are you sure you want to destroy foo?
This action cannot be undone (y/[n]): y
Unable to destroy foo.
Device busy.
$ sudo beadm destroy foo@bar
Are you sure you want to destroy foo@bar?
This action cannot be undone (y/[n]): y
Destroyed successfully
$ sudo beadm destroy foo
Are you sure you want to destroy foo?
This action cannot be undone (y/[n]): y
Destroyed successfully

It'd be nice to have at least a better message (indicating there are snapshots), it'd be even nicer. to list them and have a 'destroy -r' to destroy them too, as ZFS would.

#3

Updated by Alexander Eremin almost 8 years ago

  • Assignee set to Alexander Eremin
  • % Done changed from 0 to 10

Rich Lowe wrote:

[...]

It'd be nice to have at least a better message (indicating there are snapshots), it'd be even nicer. to list them and have a 'destroy -r' to destroy them too, as ZFS would.

beadm has "-s" for destroy command, bit this is undocumented:

# beadm create zzz
Created successfully
# zfs snapshot rpool/ROOT/zzz@bar
~# beadm destroy -s zzz
Are you sure you want to destroy zzz?
This action cannot be undone (y/[n]): y
Destroyed successfully

Agree, beadm should warn if BE has snapshots

#4

Updated by Rich Lowe over 7 years ago

  • Category set to cmd - userland programs
  • Status changed from New to Resolved
  • % Done changed from 10 to 100
  • Tags deleted (needs-triage)

Resolved in r13527 commit:4b5bd4534d91

Also available in: Atom PDF