Bug 170523 - [zfs] zfs rename pool@snapshot1 pool@snapshot2 UNMOUNTS dataset
Summary: [zfs] zfs rename pool@snapshot1 pool@snapshot2 UNMOUNTS dataset
Status: Closed Works As Intended
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 9.0-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-10 11:50 UTC by Slawomir Wojciech Wojtczak
Modified: 2018-01-18 05:12 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Slawomir Wojciech Wojtczak 2012-08-10 11:50:00 UTC
It is not possible to rename ZFS SNAPSHOT that is cloned and mounted as / filesystem.

Fix: 

Should be as easy as that one:
http://www.freebsd.org/cgi/query-pr.cgi?pr=167905
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2014-04-17 05:35:12 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-fs

Over to maintainer(s).
Comment 2 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:59:48 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped
Comment 3 Alan Somers freebsd_committer freebsd_triage 2018-01-16 16:10:23 UTC
Is this still an issue for you?  A lot has changed since 2012.  Also, could you be a little more clear about what the problem is?  Normally a ZFS filesystem should be unmounted (and remounted elsewhere) when renamed.  That's intended behavior.
Comment 4 Slawomir Wojciech Wojtczak 2018-01-17 11:48:41 UTC
Still.

# zfs rename sys/ROOT/default sys/ROOT/default1
cannot unmount '/': Invalid argument

Is the unmount really necessary?
Comment 5 Andriy Gapon freebsd_committer freebsd_triage 2018-01-17 12:41:55 UTC
(In reply to vermaden from comment #4)
Yes, it is.
The dataset can have descendants, their full names obviously also change, they need to be mounted at new paths, etc.
zfs could be smarter about datasets with mountpoint=legacy and maybe it is, I haven't checked.
If you know what you are doing you can use zfs rename -u.  See the manual page.
Comment 6 Slawomir Wojciech Wojtczak 2018-01-18 00:00:33 UTC
(In reply to Andriy Gapon from comment #5)

# zfs rename -u sys/ROOT/default sys/ROOT/default-one
# zfs rename -u sys/ROOT/default-one sys/ROOT/default

Works like a charm, sorry for not reading man page that attentively ...

You may close this one.