How does bulk dataset creation without GUI work?

wilschie

Cadet
Joined
Feb 1, 2024
Messages
3
Hello,

Can someone please point me to some documentation on how to create datasets via script or command line?

Every few months I get 10 to 20 new users who need their own data shares and after a few months the user accounts and the data shares are deleted. On Solaris I do that with a simple bash script, with zfs create, chown and chmod. Does this also work with TrueNAS? Or do I have to use the GUI, which would be quite cumbersome given the high fluctuation rate of users and their data shares? How do larger companies with hundreds of users or dozens of user groups do it?

Best
Willi
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
Yes and no. This sounds like something you would want to use the API for.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,700
a simple bash script, with zfs create, chown and chmod. Does this also work with TrueNAS?
Yes. (for the datasets). For the users, you will need to use API calls as suggested, or do it in the GUI.

EDIT: maybe the CLI is actually more useful here:

cli at the shell, then you can use account user create (you get prompts there to help you fill it)
 

wilschie

Cadet
Joined
Feb 1, 2024
Messages
3
The users live in a Samba AD DC. On this Samba server I have a user_create script which creates the accounts. After account creation the script SSH connects to the file servers where it creates the user's and/or group's datasets (zfs create) and sets permissions (chown and chgrp). This works for NFS exports. SMB exports are configured in a simple smb.conf file. Can I do the same with a TrueNAS system? Can I SSH into the TrueNAS CLI?
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,700
SMB exports are configured in a simple smb.conf file. Can I do the same with a TrueNAS system?
Perhaps you should be using the "Use as home share" option in the SMB share you set up just once... then all users connect to the exact same share, but see only their own files.
 
Top