How to rename dataset?

Status
Not open for further replies.

HolyK

Ninja Turtle
Moderator
Joined
May 26, 2011
Messages
654
Hi,

probably really dumb question or i am blind and i can't see an option to rename dataset. I made a typo in dataset name and it looks ugly. I already have approx 100GB files in it. Is there a non-destructive way how to rename dataset or do i need to move all of the files out of it, then destroy/create and move all back?

Things like "mv yyy zzz" is a baaad idea i guess since it is not a directory but a mountpoint ... ;)

So probably correct way would be a "unmount -> zfs rename raidz/yyy raidz/zzz-> mount" ?

Anyway i found some old notes that i should not do this from CLI but from GUI via export/import otherwise database could get corrupted ? But no export/import in GUI at all ... :(

Thanks!


EDIT: LoL ... forum is censoring "trippleX" into "***" :D:D:D:D:D:D
 

paleoN

Wizard
Joined
Apr 22, 2012
Messages
1,403
So probably correct way would be a "unmount -> zfs rename raidz/yyy raidz/zzz-> mount" ?
The zfs rename should handle the unmount/mount for you. Unless you tell it not to, man zfs.
Code:
zfs rename poolname/datasetA/ugly poolname/datasetA/sightly


Anyway i found some old notes that i should not do this from CLI but from GUI via export/import otherwise database could get corrupted ? But no export/import in GUI at all ... :(
For what version? AFAIK, this works fine in current versions.
 

HolyK

Ninja Turtle
Moderator
Joined
May 26, 2011
Messages
654
Sorry, forgot to mention version (lame) ... its FreeNAS-8.3.0-RELEASE-p1-x64 (r12825) ... I have Import / Auto-Import buttons but no "Export" one o_O

Ill try that rename from cli ... thanks!
 

William Grzybowski

Wizard
iXsystems
Joined
May 27, 2011
Messages
1,754
It will work fine from CLI, no need to detach/auto import. Just remember to change it everywhere in the GUI that could use the dataset name, like periodic snapshot, replication, shares, etc.
 

paleoN

Wizard
Joined
Apr 22, 2012
Messages
1,403
I have Import / Auto-Import buttons but no "Export" one o_O
I was ignoring the part about an "Export" button, but I can see how my quoting made that confusing. Now that you have your NAS running, nice setup by the way, you will find it worthwhile to read through the manual again. In other words RTFM and yes, it covers exporting.
 
Status
Not open for further replies.
Top