Index


Overview

This document describes the process required to mount a shared Windows directory on your Statseeker server for the purpose utilizing the Windows directory as the designated Statseeker backup repository.

[top]

Create and Mount the Share

Note: all commands will need to be run as the root user.

The mount point is the directory on your Statseeker server that will be connected to your windows share. It will display the contents of the share and be used as the backup location. You can create this directory anywhere on your Statseeker server as long as it is not in your statseeker user directory, i.e. it cannot be under /home/statseeker/.

In our example, we will create the directory (ssBackups) at the root level of the Statseeker server.

To create the mount point run the command:

# mkdir /ssBackups

Next, we will change the ownership to the statseeker user so it can write and delete files in that directory.

# chown statseeker:statseeker /ssBackups

Create and share the Windows folder, making a note of the share path, typically this will look like //SERVERNAME/sharedfolder.

Note: the servername is specified in all capitals.

Run the command to mount the shared Windows directory, linking it to the Statseeker server backup directory.

# mount_smbfs -I xxx.xxx.xxx.xxx //User@SERVERNAME/sharedfolder /backup
Key Description
mount_smbfs Command to mount a Samba share
-I xxx.xxx.xxx.xxx Dash, capital i, followed by IP address of the Windows machine
User The Windows account username required to access the shared directory (local user account, not Active Directory credentials)
SERVERNAME/sharedfolder Windows directory share-path, servername in all caps
/backup The Statseeker server backup directory that will be linked to the Windows shared directory.

E.g. /ssBackups

E.g.

# mount_smbfs -I 10.2.8.44 //Admin@DATASTORE2/StatseekerBkup /ssBackups

When you run this command, you will be asked to enter a password, this is the password for the Windows account specified in the mount command.

If the mount request fails you will be notified, if it succeeds, you will be returned to the command prompt. You can confirm that the mount has succeeded via the output from:

# df -h

Once you have confirmed that the configuration is working as intended you can configure your Statseeker backups to point to the mounted share via the Administration Tool, see Backup and Restoration Process for details.

[top]


Automate Mount during Boot Sequence

For convenience, we can make the mount happen automatically during boot of the Statseeker server. To do this we will edit two files:

  • /etc/nsmb.conf
  • /etc/fstab

If you’re comfortable using VI (FreeBSD’s default text editor) you can use it to edit the files, otherwise, you can use the echo command to insert the required lines into the files.

Editing /etc/fstab
# echo "//User@SERVERNAME/sharedfolder /backup smbfs rw,-N,-Ixxx.xxx.xxx.xxx 0 0" >> /etc/fstab
Key Description
echo Command to insert the text
User The Windows account username required to access the shared directory (local user account, not Active Directory credentials)
SERVERNAME/sharedfolder Windows directory share-path, servername in all caps
/backup The Statseeker server backup directory that will be linked to the Windows shared directory.

E.g. /ssBackups
rw Add read and write permissions
-N Look for the password in /etc/nsmb.conf
-I xxx.xxx.xxx.xxx Dash, capital i, followed by IP address of the Windows machine
0 Specifies not to backup the files
0 Specifies to not check the file system when mounting
>> /etc/fstab Destination for the inserted text

E.g.

# echo "//Admin@DATASTORE2/StatseekerBkup /ssBackups smbfs rw,-N,-I 10.2.8.44 0 0" >> /etc/fstab

Editing /etc/nsmb.conf

This file will contain the authentication details required to mount the share on boot. The password can be supplied in clear-text or it can be encrypted using thesmbutil crypt command.

Note: this encryption method is very weak and is only intended to mask clear text passwords.

To encrypt the password for the Windows account run:

# smbutil crypt password123

, where password123 is the password you wish to encrypt.
This will return an encrypted password, e.g.:

# smbutil crypt passwd1234
# $$178465324252d5844b0a4

Insert the credentials into /etc/nsmb.conf:

# echo "[SERVERNAME:USER]" >> /etc/nsmb.conf

, where:

  • SERVERNAME is the Windows machine name
  • USER is the name of Windows user account with access to edit the shared directory
Note: that both the servername and username must be supplied in all capitals.
# echo 'password:your_password' >> /etc/nsmb.conf

, where:

  • your_password is the Windows user account password in clear-text, or encrypted, format
Note: when using an encrypted password, you must encapsulate the data in single-quotes ().
Confirm the Configuration

You can confirm the configuration by ensuring that the shared directory is not currently mounted by reviewing the output from:

# df -h

If the shared directory is currently mounted, unmount it with:

# umount /your_statseeker_mountpoint

E.g.

# umount /ssBackups

Then mount the share via the newly created scripts and check the outcome with:

# mount -a
# df -h

Once you have confirmed that the configuration is working as intended you can configure your Statseeker backups to point to the mounted share via the Administration Tool, see Backup and Restoration Process for details.

[top]