Shuffling datasets around in a pool, latest Scale

I thought it was time to organize my dataset tree a little better, instinct from Linux admin days said use mv and hope for the best. However, I found a post from the old Truenas forum saying zfs rename handles those duties and it’s way faster.

Let’s say I want to go from pool zoop, dataset mickey, child dataset freddy, new dataset next to mickey called donald, to pool zoop, dataset donald, mickey, and freddy. Confused yet?

zoop
|_mickey
| |_freddy
|_donald

zoop
|_donald
|_mickey
|_freddy

The zfs rename will allow for this restructuring, from what I read. However, in the first tree, mickey, freddy and donald all had (SMB shares) mappings to apps and clients. So, say, an app called bigbird has a host mapping pointing at freddy, nested under mickey.

How big of an impact will this change be? Will I need to retool all the shares and apps to reflect the new structure (I imagine so and I’ve recorded that)? Will Truenas even let me get away with this since there are share and apps depending on things being where they are currently referenced or do I need to turn things off while I rearrange? Anyone done these shenanigans?

Thanks.

Well, looks like it will work, at least my test run did. I generated some dummy files in a new dataset so it would actually do some work. The new top-level datasets were called “movetest” and “movetest-subset”. The goal was to slot movetest-subnet under movetest in the hierarchy. This is the command I used. “zfs rename poolroot/movetest-subset poolroot/movetest/movetest-subset”.

Before and after.

Wish me luck on moving the stuff that actually matters.