0% found this document useful (0 votes)
10 views50 pages

FreeNAS-configuration-steps

Uploaded by

Dorra Ben arbi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views50 pages

FreeNAS-configuration-steps

Uploaded by

Dorra Ben arbi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 50

Network Attached Storage using

FreeNAS on VMWare Workstation

First , we have to download the latest STABLE version of FreeNAS 11.2 : FreeNAS-11.2-RELEASE.

Second, we have to extract the WinRAR file in your downloads :

Part 1: Create Virtual Machine on VMware Workstation/Player :

1. Start the New Virtual Machine wizard and choose the “typical” configuration type :
2. Since you'll be installing the guest OS later, select "I will install the operating system later.":

3.Follow these properties in order to launch correctly the VM :

- Guest OS: FreeBSD 11 64-bit :


-Give a name to your virtual machine as well as its location :

-Disk size: minimum recommended 40GB :

-Click on "Customize Hardware..." to adjust the following settings:

-Memory: 2GB :
-CPU: 1 processor, 2 cores, virtualize Intel VT-x :

-For your Network Configuration :

-You have to select "Bridged" for the network configuration to allow the VM to
communicate on the same network as the host and to check "Replicate physical network
connection state" :

-Click “close” then click “finish” to create your virtual machine :

-When your virtual machine is ready , click “Edit virtual machine settings” :

-To Add Hard Disks :

-Click on "Add..." and select "Hard Disk.":


-Select “SCSI” as disk type SCSI provides better performance, especially for multi-disk setups like NAS,
and is ideal for tasks that require high throughput and reliability :

-Select “Create new virtual disk” :

-Specify the disk size to 20 GB :

-Check “Store the virtual disk as a single file” for optimal performance :

-Specify the disk file and it’s location :

-Repeat this process to add all three virtual hard disks for FreeNAS.
Part 2: Install and Configure FreeNAS :

1.1. Installation of FreeNAS :

1-Go to “Edit virtual machine settings” then you should have “CD/DVD (IDE) “ check “Use
ISO image file “ and its location :

-Go to “Enable or disable windows functionalities” and there is a file called “Hyper-V” that shouldn’t
be checked for your virtual machine to launch properly :

-Then your virtual machine should be able to launch without problems :


2-For installing FreeNAS, we have to choose “Install/Upgrade”. This will install the FreeNAS
if it does not existed :

-There is a problem that occurs like this :

-The message indicates that your virtual machine has less than 8 GB of RAM, which is the
minimum recommended configuration for FreeNAS. However, you can continue the
installation with less RAM, but this might affect performance.

-For your best , you should you can go back into the virtual machine settings and increase
the RAM to 8 GB or more to ensure a better experience.

-How to increase RAM on VMware:

.Shut down the virtual machine :

.Click “Edit Virtual Machine Settings”.


.In the Memory section, increase the value to 8 GB or more:

.Restart the virtual machine and resume the installation.

-You can check the available RAM on your PC by opening “Task Manager” then click “Performance”:

-Click “Power on this virtual machine” then we choose “Install/Upgrade” again.

3- Choose the disk where FreeNAS should be installed. We have a total of 4 drives, choose
the first drive ada0 (40GB) ada0 drive for FreeNAS installation. Other hard drives will be
used for storage :

- The message you receive indicates that the selected disk (da0, the 40 GB disk) will be formatted,
which will erase all partitions and data on that disk. This also means that you will not be able to use
this specific disk to store shared data, as it will be used exclusively for the FreeNAS installation :
-You must choose the 40 GB disk (da0) for the FreeNAS installation. This drive will only be used to
host the FreeNAS operating system. The other 20 GB disks will be used later for storing the data you
want to share over the network.

- Here's why:

.da0 (40GB): This disk will only be used to install FreeNAS. It will not be used to store your files or
share data. In general, it is advisable to dedicate a specific disk (here, da0) only to the FreeNAS
operating system.

.20 GB disks: These disks will be used to configure storage volumes and create storage pools in
FreeNAS. They will be used to share files on the network.

-Enter your root password :

-For the FreeNAS Boot Mode , choose “Boot via BIOS” :


4-Click “Ok” :

-It brings me to the “FreeNAS 11.3-U5 Console Setup” and instead of choosing “Install/Update” you choose “Reboot
System” :

1.2. Initial Configuration :

After FreeNAS setup completed, use the console setup menu to make different configuration to
access the FreeNAS web dashboard. By default, it will assign a dynamic IP address so we have
to
configure it manually. The following figure presents all the available options for configuration:
1. Configure network interface: Choose option 1 and select the default first interface.
Use
the following settings for configuring static IP:

∙ Interface name em0


∙ Do not reset network configuration
∙ Do not configure interface for DHCP
∙ IP address 192.168.100.50/24
∙ Do not configure IPv6
∙ Restart network

-To check if the change in IP address and other network settings were saved correctly in
FreeNAS, you can follow these steps:
-Access the FreeNAS console: If you are still in the configuration interface, you can
simply exit the options and return to the main console.
-Check network settings: If you are in the FreeNAS console, you can access the
command line by choosing option 9 to access the shell. In the shell, you can use the
following command to view network settings:
- Finally, you can test connectivity to the address IP static by pinging it. Use the following
command:

- The "exit" button is not a physical button on the keyboard. To exit a shell interface (like
in FreeNAS), you simply type the word "exit" using your keyboard :

2. Configure default route : choose option 4 and use the following settings :
∙ IP default route 192.168.100.1
∙ Do not configure IPv6 default route
- To check if your default route is configured correctly in FreeNAS, you can follow these
steps:

1. Access the Shell:


o Go to the console setup menu (the menu you’ve been using).
o Select option 9 for Shell.
2. Check the Routing Table:

- Finally, you can test connectivity to the default route (gateway) by pinging it. Use the
following command:

-If you receive responses, it means the configuration is working correctly.

3. Configure DNS server : choose option 6, and use the following settings :
∙ DNS domain : Lab.local
∙ DNS nameserver 1 : 8.8.8.8
∙ DNS Nameserver 2 : 8.8.4.4
4.Reset root password by selecting option 7 :

5. Access to the shell by selecting option 9 and test the connectivity of your VM to
www.google.com (8.8.8.8) :
1.3. User and Group creation on FreeNAS :

-To access the FreeNAS GUI interface, open the web browser and enter the IP address used to
configure the interface setup. At first login, we need to define a PASSWORD for the root user to
access GUI interface. Set a strong password for your storage server and continue “LOG IN”.

-The "LOG IN" option will take you to the latest interface where you can configure the system,
whereas the "LEGACY WEB INTERFACE" refers to an older version of the interface that might
not be necessary unless you're using an older version of FreeNAS. Once you click on "Log In,"
you'll be prompted to set a strong password for the root user, allowing access to the modern
interface where you'll manage users, groups, and other configurations :

-If you are getting the error message "Username or Password is incorrect", it may be due to
one of the following reasons:

1. Username: Make sure that you are logging in as the root user, as that’s the default
administrative account for FreeNAS.
2. Password: Ensure that you are entering the password correctly. This should be the
password you set for the root user during the initial configuration.

-As long as you're accessing FreeNAS within a trusted local network (such as your home or a secure
LAN), it's safe to proceed. However, it’s a good practice to enable HTTPS for better security,
especially if you'll be accessing it over less secure networks or remotely.
 Navigate to the Web Interface Settings:

 From the FreeNAS dashboard, go to System > General.

 Enable HTTPS:

 Scroll down to the GUI section.


 Check the box for Web Interface Protocols to see that you can select HTTPS (you
can also leave HTTP checked if you want both enabled) :

-You'll need to provide an SSL certificate for HTTPS to work. If you do not have one:

 You can create a self-signed certificate (this will still show as "Not Secure" but the
connection is encrypted).
 To create a self-signed certificate:
o Go to System > Certificates.
o Click on Add to create a new certificate.
o Select Create Internal Certificate and fill in the required details :

Here’s the information you should enter for the internal certificate:

 Identifier: FreeNAS_HTTPS_Cert (or any name you prefer)


 Internal Certificate: Checked (make sure this option is selected)
 Type: Signing Certificate Authority
 Signing Certificate Authority: Checked (ensure this is selected)
 Key Length: 2048
 Digest Algorithm: SHA256
 Lifetime: 3650 (days)
 Country: TN (for United States)
 State: Tunisia
 Locality: Tunis (or any other city in your chosen state)
 Organization: Your organization or home network name (e.g., My Home Network).
 Email: [email protected] (or your actual email address)
 Common Name: This should be the fully qualified domain name (FQDN) or IP address of
your FreeNAS server:

 For example: freenas.local or 192.168.100.50 (the IP address you configured).

 Subject Alternate Names: www.yourdomain.com (optional; include any alternate names


if needed)
 Certificate: (Leave this blank; it will be generated)
 Private Key: (Leave this blank; it will be generated)
 Passphrase: YourSecurePassphrase (create a strong passphrase)

 Confirm Passphrase: YourSecurePassphrase (repeat the passphrase for


confirmation)

If the "Signing Certificate Authority" field is empty and you cannot proceed with saving the
HTTPS settings, it means that FreeNAS is expecting a Certificate Authority (CA) to sign the
internal certificate. Here's how you can fix this:

-Steps to create a Certificate Authority (CA) in FreeNAS:

1. Go to the FreeNAS Web Interface.


2. Navigate to "System" > "Certificates" > "Certificate Authorities."
3. Click "Add" to create a new Certificate Authority (CA).
o Name: Choose an identifier for your CA (e.g., FreeNAS_CA).
o Type: Select "Internal CA."
o Key Length: Keep the default (2048).
o Digest Algorithm: Select "SHA256."
o Lifetime: Set a reasonable value (e.g., 3650 days for 10 years).
o Country: Select the appropriate country (e.g., United States, Spain for
Barcelona, Tunisia, etc.).
o State: Enter your state or region.
o Locality: Enter your city (e.g., "Barcelona" for Spain).
o Organization: Enter the name of your organization.
o Email: Provide a valid email address.
o Common Name: You can use FreeNAS_CA or another descriptive name.
4. Save the Certificate Authority.
-Then we go back to the internal certificate and put the informations mentioned
previously, this time when you want go to "Signing Certificate Authority" you can choose
the CA you just created (e.g., FreeNAS_CA) and then click “save” :
-Configure HTTPS:

 Go to System → General in the FreeNAS menu.


 In the GUI SSL Certificate dropdown, select the internal certificate you created
(FreeNAS_HTTPS_Cert).
 Check the box labeled Web Interface HTTP to HTTPS Redirect if you want to
force all HTTP connections to redirect to HTTPS.

Steps to Enable HTTPS:

 Protocol:
o Set this to HTTPS to enable secure access to the web interface.
 WebGUI IPv4 Address:
o Keep this as 0.0.0.0 if you want the web interface to be accessible from all
network interfaces on your system.
o Alternatively, if you want to bind it to a specific IP address (like the static IP
you configured earlier), enter that IP here (e.g., 192.168.100.50).
 WebGUI IPv6 Address:
o Leave this as :: if you are not using IPv6. This is the default setting.
 WebGUI HTTP Port:
o This port should be 80 if you want to enable HTTP access alongside HTTPS.
If you want to disable HTTP and only allow HTTPS, remove or change this
value.
 WebGUI HTTPS Port:
o Keep this as 443, which is the default port for HTTPS.
 Language:
o Set this to English or your preferred language.
 Console Keyboard Map:
o You can change the Console Keyboard Map to AZERTY or whatever layout
you want.
 Timezone:
o Set the timezone to your location. For example, you can change Africa/Tunis
to your actual timezone.
 Syslog Level and Server:
o If you are using a syslog server for logging, enter the appropriate information.
Otherwise, you can leave these fields blank.
-Then click on “save” :

- This way, both HTTP and HTTPS will be available, but you can still access the FreeNAS
interface securely via HTTPS. When accessing the web interface, simply use https://your-
IP-address to enforce a secure connection.
1. To add a new group of users in FreeNAS and set the group name as LABGroup, follow
these steps:

1. Log in to the FreeNAS web interface.


2. Navigate to the "Accounts" tab at the top of the page.
3. Under "Accounts", select "Groups".
4. Click on the "Add" button (usually represented by a "+" icon) to create a new group.
5. In the "Group Name" field, enter "LABGroup" as the name for the group.
6. Configure any other settings as needed (such as Group ID, permissions, etc.).
7. Click "Save" to create the group.

-Once the group is created, you can assign users to the “LABGroup” or further customize the
group's permissions.

-Here’s what each option means, and whether you should check them:

1. Permit Sudo:
o What it means: If you check this option, members of the group will be
allowed to use the sudo command to execute commands with superuser
privileges.
o Should you check it?: If you want users in the LABGroup to have
administrative privileges (e.g., to install software or change system settings),
then check this option. If you want to restrict their access and control, leave it
unchecked.
2. Allow Repeated GIDs:
o What it means: This option allows the same Group ID (GID) to be used by
multiple groups.
o Should you check it?: Typically, you don’t need to check this option unless
you have a specific need for multiple groups to share the same GID. In most
cases, it’s best to leave this unchecked to avoid potential permission conflicts.
2. To add a new user in FreeNAS and attach it to the group you created (LABGroup), follow these
steps:

 Navigate to Users:

 Go to the Accounts tab in the main menu.


 Click on Users.

 Add New User:

 Click on the Add button (usually represented by a plus sign or "Add User" option).

-When adding a new user in FreeNAS with the provided fields, here's how to fill out each
section and what to consider:

1. Name & Contact


 Full Name: Enter the user's full name. This is for identification and can be anything
meaningful.
 Username: Enter a unique username for the user. This will be used for logging in.
 Email: Enter the user's email address (optional). This is helpful for notifications and
password recovery but isn't required.
 Password: Set a strong password for the user. Make sure it meets any security
requirements (e.g., length, complexity).
 Confirm Password: Repeat the password to confirm it is typed correctly.

2. ID & Groups

 User ID: This can typically be left as is (e.g., 1000). FreeNAS will auto-generate a
User ID if left blank.
 New Primary Group: Select LABGroup from the dropdown to assign the user to the
group you created earlier.
 Auxiliary Groups: If needed, you can add the user to additional groups here, but it’s
optional.

3. Directories & Permissions

 Home Directory: Set this to /nonexistent if you do not need a home directory for
this user. If a home directory is needed, you could set a path like
/mnt/pool_name/home/username, replacing pool_name with your actual pool name.
 Home Directory Permissions:
o Owner: Select the user you are creating.
o Group: You can select the LABGroup.
o Other: Configure permissions according to your needs (Read, Write, Execute).

4. Authentication

 SSH Public Key: If you plan to use SSH access for this user, you can paste their SSH
public key here.
 Enable password login: Set this to Yes if you want the user to log in with a password.
 Shell: Select the shell type (e.g., csh, bash, etc.). For most users, csh or sh is fine
unless specific shell functionality is needed.
 Lock User: Leave unchecked unless you want to prevent the user from logging in.
 Permit Sudo: Check this if you want to grant the user sudo privileges (administrative
access). If unsure, leave it unchecked.
 Microsoft Account: Leave this as is unless you want to link a Microsoft account.
5. Save the User

 Once you have filled in all the required fields, click on “Save” to create the user :

 Verify User Creation:


To confirm if the user you added is attached to the LABGroup in FreeNAS, follow these
steps:

Step 1: Access the FreeNAS Web Interface

1. Open your web browser and enter the IP address of your FreeNAS server to access the
web interface.
2. Log in with your admin credentials.

Step 2: Navigate to Accounts

1. In the FreeNAS web interface, click on the "Accounts" tab.


2. Select "Users" from the dropdown menu.

Step 3: View Users

1. You will see a list of all users.


2. Locate the user you just added in the list.

Step 4: Check Group Membership

1. Click on the user’s name or the "Edit" button (usually represented by a pencil icon)
next to the user.
2. In the user details, look for the "Primary Group" section.
3. The Primary Group should be displayed as LABGroup if the user is correctly
attached to that group.

Step 5: Check Auxiliary Groups (if needed)

1. In the same user detail view, you can also check the Auxiliary Groups field to see if
the user is part of any additional groups.

Step 6: Save Changes (if needed)

 If you need to make any changes, remember to click "Save" after editing the user's
settings.

By following these steps, you can confirm the group membership of the user you added in
FreeNAS. If you see LABGroup as the primary group, the user is correctly attached to that
group.
1.4.Storage Volume creation :
-To create a storage volume with a RAIDZ layout in FreeNAS, follow these steps:

-Step 1: Navigate to the Storage Tab

1. On the top menu, click on the "Storage" tab.


2. Select "Pools" from the dropdown.

Step 2: Open the Volume Manager

1. In the Pools page, click "Add" to create a new pool.


2. Choose "Create New Pool" and click "Create Pool".

In FreeNAS (TrueNAS) and other similar storage systems, a pool (also called a storage pool)
refers to a collection of physical storage devices (hard drives, SSDs, etc.) that are grouped
together to create a single logical storage unit. This pool is managed by a filesystem like ZFS
(the filesystem used by FreeNAS/TrueNAS), which provides features like redundancy, data
integrity, and performance enhancements.

What Is a Pool?

A pool is an abstraction that allows multiple physical disks to be combined into a single large
storage space. The idea is to manage the storage in a flexible way, using the features of the
ZFS filesystem to distribute data across the disks for both capacity and fault tolerance.

 Physical Disks: These are your actual hard drives or SSDs that you add to the pool.
 Logical Storage: The pool acts like one large volume of storage, even though it may
consist of several physical disks.

Example: You can have 3 disks (each 20 GB) in a RAIDZ1 pool, and the system will
treat this as a single logical pool with 40 GB of usable space (after accounting for
parity).

What Is Pool Storage?

Pool storage refers to the actual usable space you get from the pool after considering
redundancy (if applicable) and other factors. The total capacity of the pool depends on:

 Number and size of disks: How many disks are in the pool and their individual capacities.
 Layout/Redundancy: The layout (Stripe, RAIDZ, Mirror, etc.) affects the amount of usable
storage and the level of fault tolerance.

Key Features of a Storage Pool:

1. Data Protection: Depending on the layout (RAIDZ, Mirror, etc.), the pool can protect data
against disk failures by using techniques like parity or disk mirroring.
2. Scalability: You can add more disks to a pool (expand the pool) to increase its capacity.
3. Performance: A pool can improve performance by distributing data across multiple disks,
allowing for faster read/write speeds (especially with layouts like striping or adding cache
drives).
4. Snapshots and Clones: With ZFS, you can create snapshots (point-in-time copies of the data)
and clones of data in the pool.
5. Flexibility: Pool storage abstracts the complexity of physical disk management, so users don't
have to worry about managing each disk individually.

Example of Pool and Pool Storage in Action:

Let's say you create a RAIDZ1 pool using three 20 GB disks:

 Physical storage: 3 x 20 GB disks = 60 GB total.


 Pool storage (after RAIDZ1 redundancy): One disk's worth of space (20 GB) is used for parity,
leaving you with 40 GB of usable storage.
 Fault tolerance: If one of the disks fails, you can replace it, and the system will rebuild the
data from the remaining disks.

In short, a pool combines multiple disks into one logical unit, and pool storage refers to the
total available capacity after considering the layout and redundancy of that pool.

Step 3: Add Available Disk Drives

1. In the Volume Manager window, a list of all available drives will be displayed.
2. Select all available disk drives by clicking on each one or selecting them all at once
if necessary.

-Steps to Create a New Pool Using the Available Disks:

1. Name the Pool:


o In the Name field, enter a name for the pool (e.g., "LabPool").
2. Select the Disks:
o In the Available Disks section, you should see your 3 disks: da1, da2, and da3
(each with 20 GiB capacity).
o Select all three disks by clicking on them individually or selecting them all at
once.
3. Move Disks to Data VDevs:
o After selecting the disks, click the arrow forward button (→) to move them
to the Data VDevs section. This is where you tell FreeNAS how to arrange your
disks into the storage pool.
4. Choose RAIDZ Layout:
o Under the Data VDevs section, you should see options like Stripe, RAIDZ1,
etc.
o FreeNAS (now known as TrueNAS) provides several layout options when configuring
a storage pool, each offering different levels of performance, redundancy, and
capacity. Here are the main layout options you’ll encounter:

1.Stripe (No Redundancy)

 Meaning: A striped pool uses all the selected disks to maximize storage capacity, but
it does not provide redundancy. If any disk in the stripe fails, the entire pool is lost,
and data cannot be recovered.
 Use Case: Best for scenarios where performance and maximizing storage capacity are
more important than data safety. Not recommended for critical data storage.
 Capacity: Total capacity is the sum of all the disks.

Example: 3 x 20 GiB disks = 60 GiB usable space.

2. Mirror (High Redundancy)


 Meaning: In a mirror setup, each disk is duplicated across others. If one disk fails, its
copy (mirror) on another disk will keep the data safe. For every two disks, the usable
capacity is equal to only one disk because the second disk is a mirror (backup).
 Use Case: Best for small setups where high redundancy is needed. You lose half of
your total disk capacity but gain excellent fault tolerance.
 Capacity: 50% of the total disk space is usable.

Example: 2 x 20 GiB disks = 20 GiB usable space (the other 20 GiB is for
redundancy).

3. RAIDZ1 (Single Parity) – Similar to RAID 5

 Meaning: RAIDZ1 distributes data across all disks with a parity (redundancy) block,
so if one disk fails, it can be replaced, and the data will be rebuilt using the parity data.
 Use Case: Offers a good balance of redundancy and storage capacity. RAIDZ1 can
tolerate the failure of one disk.
 Capacity: Capacity is the total disk space minus the space of one disk used for parity.

Example: 3 x 20 GiB disks = 40 GiB usable space (one disk worth of space is used for
parity).

4. RAIDZ2 (Double Parity) – Similar to RAID 6

 Meaning: RAIDZ2 is similar to RAIDZ1 but offers double parity, meaning it can
tolerate two disk failures before data is lost. It uses two disks' worth of space for
redundancy.
 Use Case: Ideal for medium to large setups where higher redundancy is needed. It
provides better fault tolerance than RAIDZ1, but you lose more disk space to parity.
 Capacity: Capacity is the total disk space minus the space of two disks used for
parity.

Example: 4 x 20 GiB disks = 40 GiB usable space (two disks' worth of space is used
for parity).

5. RAIDZ3 (Triple Parity)

 Meaning: RAIDZ3 offers triple parity, meaning it can tolerate the failure of three
disks without data loss. It uses three disks' worth of space for redundancy.
 Use Case: Best for very large setups or mission-critical data environments where high
fault tolerance is essential.
 Capacity: Capacity is the total disk space minus the space of three disks used for
parity.
Example: 5 x 20 GiB disks = 40 GiB usable space (three disks' worth of space is used
for parity).

6. Spare (Hot Spare Disk)

 Meaning: In a pool with RAIDZ or Mirror configurations, a Spare is a disk that


remains unused until one of the active disks fails. When a failure occurs, the spare is
automatically activated, and the system begins rebuilding the data onto the spare disk.
 Use Case: Provides an extra layer of protection by having a backup disk ready to take
over if one of the main disks fails. It is not a layout itself but rather a disk
configuration in RAID pools.

7. Cache (L2ARC Cache Drive)

 Meaning: A disk or SSD can be added as a Cache drive. This drive is not part of the
main storage but is used to speed up access to frequently read data by storing that data
in a fast cache.
 Use Case: Best for improving read performance in large systems. Typically, an SSD is
used for this purpose.

Summary of Layout Choices:

 Stripe: Maximizes capacity, no redundancy, risky.


 Mirror: High redundancy, halves capacity, safe.
 RAIDZ1: Single parity, tolerates one disk failure, balanced.
 RAIDZ2: Double parity, tolerates two disk failures, safer.
 RAIDZ3: Triple parity, tolerates three disk failures, safest.
 Spare: A backup disk, added protection.
 Cache: Speeds up performance, no storage impact.

You should choose the layout based on how much redundancy and performance you need,
and how much disk space you're willing to sacrifice for data protection.

o Choose RAIDZ (RAIDZ1) to configure the drives for redundancy and storage
optimization.
5. Review Estimated Capacity:
o The Estimated Total Raw Data Capacity will update based on the RAIDZ
layout you choose.

 Once you've selected RAIDZ1, FreeNAS will calculate the estimated total storage
capacity based on the number of disks and the RAIDZ layout.
 For example, with three 20 GiB disks in RAIDZ1, the total usable storage will be slightly
less than 40 GiB, because some space is used for redundancy (parity).

o  You will see this Estimated Total Raw Data Capacity at the bottom of
the screen, so you can review the amount of storage you will have.

6. Create the Pool:


o After verifying your settings, click the "Create" button to finalize the pool
creation.
7. Confirm Disk Erasure:

 When you’re ready to create the pool, click Create.


 A warning will pop up telling you that the disks will be erased during the process.
This means that any data currently on the disks will be permanently deleted to set up
the pool.
 If you're sure that the disks don’t contain anything important, click Confirm to
proceed.

After you follow these steps, FreeNAS will start creating the pool with the selected RAIDZ
layout. Once it's done, the new storage pool will appear under the Storage > Pools section.
-Part 3: Create, Configure and Test NFS and CIFS/SMB Shares :

NFS and CIFS/SMB Shares

NFS (Network File System):

 NFS is a file-sharing protocol commonly used in Unix/Linux environments.


 It allows computers to share files over a network by mounting a remote directory as if
it were a local one.
 With NFS, users can access files on remote systems as if they were part of their local
file system.
 NFS operates best in environments where the devices have a close relationship to
Unix/Linux and can use the same file structure without issues related to permissions or
case sensitivity.

CIFS/SMB (Common Internet File System / Server Message Block):

 SMB, also known as CIFS, is a file-sharing protocol primarily used in Windows


environments.
 It allows users to share files and printers across different machines, and it can also be
used in mixed operating system environments.
 SMB is highly compatible with Windows and provides better support for
authentication, permissions, and resource access in Windows networks.
 While SMB originated with Windows, modern versions of the protocol are supported
on macOS and Linux too.
2. Dataset

 A dataset in FreeNAS (now TrueNAS) is similar to a folder or directory, but with


advanced features.
 Datasets are created within a volume (or storage pool) and allow fine-grained control
over storage, including:
o Compression: You can specify a compression level for the dataset, which
reduces the amount of physical storage space used.
o Quotas: You can set a maximum amount of space that a dataset (or
user/group) can use, preventing a single dataset from consuming all available
space.
o Permissions: Datasets can have different permissions, allowing control over
who can read, write, or execute files inside it.
 Datasets are useful for organizing data logically (e.g., separate datasets for different
types of data or different departments in a company) and for applying different
management policies.

3. Quota

A quota in FreeNAS is a limitation on how much storage space can be used by a dataset,
user, or group.

 Dataset Quota: Limits the amount of space a specific dataset can consume within a
volume. For example, you could restrict a dataset to use only 100GB of a 1TB pool.
 User/Group Quota: You can also limit how much space a specific user or group of
users can consume in a dataset.

Benefits of Quotas:

 Prevents any single user, group, or dataset from consuming all available storage,
which could impact other users or services.
 Useful for managing storage in multi-user environments, ensuring everyone has access
to sufficient resources without overwhelming the system.

Summary:

 NFS is used mainly in Unix/Linux systems for network sharing, while CIFS/SMB is
optimized for Windows environments but can work cross-platform.
 Datasets are like folders with advanced features, including compression, permissions,
and quotas.
 Quotas help limit the storage used by datasets, users, or groups to ensure balanced and
fair usage of storage resources.

1. Create a Dataset for CIFS (Windows) Share:

 Go to Storage on the left column.


 Select the Volume you created earlier.
 Click Create Dataset and configure it as follows:
o Dataset Name: CIFS_Share
o Compression Level: Off
o Share Type: Windows
o Case Sensitivity: Insensitive
 Click Save :
When creating a dataset in FreeNAS (TrueNAS), several options can be configured. Here’s an
overview of each option along with their meanings, potential settings, and use cases:

1. Name

 Description: This is the identifier for your dataset. It should be descriptive enough to
indicate its purpose.
 Example: "Backup_Data", "Media_Files", "CIFS_Share".

2. Comments

 Description: This field allows you to add notes about the dataset, which can help with
identification and organization later.
 Example: "Dataset for storing user backups", "Media files for streaming".

3. Sync

 Options:
o Inherit (standard): Uses the default synchronous write behavior of ZFS. This
provides a balance between performance and data integrity, ensuring data is
written safely.
o Always: Forces synchronous writes, which ensures data is written to disk
before acknowledging the write to the application. This provides the highest
data integrity but can reduce performance.
o Disabled: Turns off synchronous writes, which may improve performance at
the risk of losing data in the event of a crash or power failure. Use this for
datasets where performance is more critical than data integrity (e.g., temporary
files).
4. Compression Level

 Options:
o Inherit (lz4): Uses the LZ4 compression algorithm, which is fast and efficient
for most data types. It is often recommended as it strikes a good balance
between speed and storage efficiency.
o Off: Disables compression, which may be suitable for data types that are
already compressed (like media files).
o Gzip: Offers various levels of compression but can be slower compared to
LZ4. It can be beneficial for text-heavy datasets where storage savings are
more important than speed.
o Zle: Provides block-level compression, which is less common but can be
useful for specific types of datasets.

5. Share Type

 Options:
o Unix: Use this for datasets that will be accessed via NFS (Network File
System) by Unix/Linux systems.
o Windows: Choose this if the dataset will be shared with Windows systems via
SMB (Server Message Block).
o Mac: Select this for sharing with macOS systems. It typically handles file
names and permissions differently than Unix and Windows.

6. Enable atime

 Options:
o Inherit (on): This will update the access time of files whenever they are read.
Useful for tracking file usage but may have a slight performance impact due to
the extra write operations.
o Inherit (off): Disables the updating of access times, which can improve
performance since it avoids additional writes.

7. ZFS Deduplication

 Options:
o Inherit (off): This is typically off by default. Deduplication can save storage
space by storing only unique instances of data but requires significant RAM
and CPU resources. It's not usually recommended unless you have specific
needs for it.
o Inherit (on): Enables deduplication, which can be useful in environments with
a lot of redundant data but can lead to high memory usage.

8. Case Sensitivity

 Options:
o Sensitive: File names are case-sensitive (e.g., "File.txt" and "file.txt" are
considered different). This is typical for Unix-like systems.
o Insensitive: File names are treated as case-insensitive (e.g., "File.txt" and
"file.txt" are the same). This is commonly used in Windows environments.

9. Other Options (Not included in your list)

 Record Size:
o Description: Defines the block size for the dataset. Smaller sizes can improve
performance for small files, while larger sizes are better for large files.
Common sizes include 128K, 256K, 512K, and 1M.
 Quota:
o Description: This sets a limit on the amount of space that can be used by the
dataset. If set, it can help manage disk usage and ensure that one dataset does
not consume all available space.
 Reservation:
o Description: Guarantees a certain amount of space for the dataset. If the
dataset requires this amount of space, it will not be available to other datasets,
even if they have free space.
 Checksum:
o Description: Determines the method for checksumming data to ensure
integrity. Options typically include "SHA256", "SHA512", and "EDONR".
This is usually set to "Inherit".

Summary of Recommendations

 Sync: Use Inherit (standard) for a balance of performance and safety.


 Compression Level: Set to Inherit (lz4) for efficient storage.
 Share Type: Select based on the primary environment (Unix, Windows, Mac).
 Enable atime: Leave as Inherit (on) if you want to track file access times.
 ZFS Deduplication: Keep at Inherit (off) unless you know you need it.
 Case Sensitivity: Choose based on the operating systems you are using (Sensitive for
Unix/Linux, Insensitive for Windows).

These options allow you to tailor the dataset configuration to your specific use case and
operational requirements.

2.Change Dataset Permissions:

 After creating the dataset, go to the dataset (CIFS_Share) in Storage > Volumes >
CIFS_Share.
 Select Change Permissions.
 Set the Owner Group to the group you created earlier (LABGroup).
When configuring permissions for your dataset or share in FreeNAS (TrueNAS), you can set
various options that control access to the data stored in your shares. Here's an explanation of
the fields you mentioned in the edit permission interface:

1. Path

 This indicates the path to the dataset or share whose permissions you're editing. In
your case, it's /mnt/LabPool/CIFS_Share, which is the location of your CIFS share
in the filesystem.

2. ACL Type
 This specifies the type of Access Control List (ACL) being applied to the dataset. You
can choose from:
o Unix: Uses traditional Unix-style permissions (owner, group, others) based on
read, write, and execute permissions.
o Windows: Uses Windows-style ACLs, allowing for more granular permissions
(like read, write, delete, etc.) based on user and group.
o Mac: Similar to Unix, but with additional options for Mac-specific ACLs.

3. Apply User

 This dropdown allows you to select which user will have the specified permissions
applied. In your case, it's set to root, meaning that the root user will have the
permissions specified.

4. Apply Group

 Similar to Apply User, this dropdown allows you to specify a group that will have the
permissions applied. Here, it's set to wheel, which is a group often associated with
administrative privileges in Unix-like systems.

5. Apply Permissions Recursively

 Checking this option applies the selected permissions to all subdirectories and files
within the specified dataset. This is useful if you want to ensure that all contained data
inherits the same permissions as the parent dataset.

Summary of Steps

To edit the permissions effectively:

1. Select the Appropriate ACL Type: Choose Unix if you want simpler permission
management, or Windows for more granular control.
2. Select the User and Group: Ensure that the user and group you select have the
necessary access to the dataset.
3. Check Recursively if Needed: If you have existing files and directories that need to
inherit the same permissions, check the "Apply permissions recursively" option.
4. Apply Changes: After configuring, make sure to save the changes to update the
permissions.

Additional Considerations

 If you plan to share this dataset over SMB (CIFS), ensure that you have the
appropriate Windows ACL settings, as this will impact how users connect and what
they can do.
 Always double-check permissions to ensure that sensitive data is not inadvertently
exposed to unauthorized users.
 Click Save.

3. Create Another Dataset for Unix (NFS) Share:

 Go back to Storage and repeat the process to create a new dataset with the following
settings:
o Dataset Name: NFS_Share
o Compression Level: Off
o Share Type: Unix

-For a Unix (NFS) share, you can adjust the settings as follows:

 Name: You should change it to something like NFS_Share since this is for Unix
(NFS) sharing.
 Comments: Optional. You can add a description if needed (e.g., "NFS Share for Unix
systems").
 Sync: Leave as Inherit (standard). This controls how data is written to disk, and
standard sync ensures safe writing behavior.
 Compression Level: Off is fine unless you specifically need compression.
 Share Type: Select Unix since you're creating a share for Unix/Linux systems.
 Enable atime: Inherit (on) is fine unless you want to disable file access time tracking
for performance reasons.
 ZFS Deduplication: Inherit (off) is a good default unless you need to save space
using deduplication, but note that it can be resource-intensive.
 Case Sensitivity: Sensitive is fine for Unix systems, which are case-sensitive by
default.

Once these settings are confirmed, you can click "Save." This will apply the correct settings
for your Unix NFS share.
4.Change permission for all group members by adding “write” permission :

The purpose of creating both CIFS (SMB) shares for Windows and NFS shares for
Unix/Linux is to allow different operating systems to access shared storage on the FreeNAS
server in a way that is native and optimized for each system. Here's a breakdown of why you
would create each:

1. CIFS (SMB) Share for Windows


 Purpose: CIFS (Common Internet File System) or SMB (Server Message Block)
shares are designed primarily for Windows clients to access shared folders over a
network. SMB is the protocol used by Windows for file and printer sharing.
 Use Case: If you have Windows machines in your environment, setting up a
CIFS/SMB share allows them to access shared data on your FreeNAS system
seamlessly. Windows users can map the network share to a drive (e.g., "Z:"), making
it easy to access and share files.
 Example: Offices with predominantly Windows PCs may use CIFS/SMB shares for
shared access to documents, multimedia, or other data.

2. NFS Share for Unix/Linux

 Purpose: NFS (Network File System) shares are optimized for Unix/Linux-based
clients. NFS is a protocol commonly used in Unix/Linux environments for sharing
directories and files across a network.
 Use Case: If you have Unix/Linux machines in your network (e.g., Ubuntu, CentOS,
macOS), setting up an NFS share makes it easy for these clients to access and manage
shared files on FreeNAS using the native file-sharing protocol.
 Example: Development environments where developers are working on Linux
servers might use NFS to share code repositories, data files, or other resources
between systems.

Why Have Both?

 Compatibility: By creating both a CIFS (SMB) share for Windows and an NFS
share for Unix, you ensure that machines running different operating systems can all
access the same storage server in a way that's most efficient and compatible with their
native protocols.
 Performance & Ease: Each protocol is optimized for its respective operating system,
so using the appropriate protocol (CIFS/SMB for Windows, NFS for Unix/Linux)
improves performance and user experience when accessing files.

Summary

 CIFS Share is for Windows clients.


 NFS Share is for Unix/Linux clients.

Both shares allow users from different platforms to access data on the FreeNAS system in a
way that suits their operating system.

5.To enable the Unix (NFS) Shares on FreeNAS, follow these steps:

1. Go to "Sharing":
o In the FreeNAS WebGUI, look at the left column and click on "Sharing".
2. Select "Unix (NFS) Shares":
o Under the "Sharing" section, click on "Unix (NFS) Shares".
3. Add a New NFS Share:
o Click on "Add" to create a new NFS share.
4. Select the Dataset Path:
o In the "Path" field, select the dataset you created for NFS (in this case,
NFS_Share).
o You can click on the folder icon to browse for the dataset path, which should
be something like /mnt/LabPool/NFS_Share.

For the NFS share path configuration in FreeNAS, the options you're seeing like "All dirs"
and "Read Only" are important for controlling how the share is accessed. Here's what they
mean:

1. All dirs:
o This option allows access to all directories under the shared path. If you
enable this, clients will be able to traverse all the directories within the dataset
path you've specified (e.g., /mnt/LabPool/NFS_Share).
o If you uncheck this, clients will only have access to the specific path you've
defined, and they won't be able to navigate into subdirectories unless they are
shared explicitly.
2. Read Only:
o If you check this option, clients will only have read-only access to the NFS
share, meaning they can view and copy files but cannot modify or delete files
within the share.
o If you leave this unchecked, clients will have read-write access, allowing
them to both view and modify files in the NFS share.
5. Enable NFS Service:
o Once you've set the path, click "Submit".
o After submitting, FreeNAS will ask you if you want to enable the NFS service.
Click "Yes" to enable it.

6. Check Service Status:


o You can confirm that NFS is enabled by going to "Services" in the left
column and making sure the NFS service is running. If it’s not running, click
the toggle switch to start it.

Now, your NFS share should be accessible to Unix/Linux clients in your network. You can
mount this share on a Unix/Linux machine using the appropriate NFS commands.

6. To create and configure a Windows (SMB) share in FreeNAS, follow these steps:

1. Access the SMB Shares Section:


o In the FreeNAS web interface, go to the “Sharing” option in the left column.
o Click on “Windows (SMB) Shares”.
2. Add a New SMB Share:
o Click on “Add” or “Create” to create a new SMB share.
3. Select the Path:
o For the Path, choose the dataset you created earlier (for example,
CIFS_Share).
o Ensure that the path corresponds to the dataset you want to share.
4. Configure SMB Share Settings:
o Fill in any additional settings, such as the Share Name, which will be how the
share is identified on the network.
o You can also add comments or descriptions if desired.

 Use as home share:


 Uncheck this option unless you specifically want this share to serve as home
directories for users. If you're sharing general files or folders, you don't need this.

 Allow Guest Access:

 Uncheck this option to prevent anonymous access. This adds a layer of security,
ensuring that only authenticated users can access the share.

 Periodic Snapshot Task:

 Leave unchecked for now unless you have a specific snapshot schedule in mind. You
can configure snapshots later based on your needs.

5. Enable the Service:


o Once you’ve filled in the necessary details, confirm enabling the service by
clicking “Save” or “Enable”.
6. Verify the SMB Share:
o After saving, ensure that the SMB service is running.
o You can check the SMB Status to ensure it’s active.

7. Test the Share:


o From a Windows machine, access the SMB share by entering \\
<FreeNAS_IP_Address>\<Share_Name> in the file explorer.
o Verify that you can read and write files as expected.

You might also like