A partner of ours asked me today to help him mount storage for backups on his linux backup server

His storage was located on a Windows 2008 Server, and so the question is how to get the Windows storage visible on our White Label Online Backup Server?

Turns out it’s not hard, but it is tricky!

  1. create the share in Windows, and give a specific user read and write rights to that share. Let’s call that user “windowsuser” and the password “windowspassword”.
  2. Next, we go into Ubuntu and create a mount point directory (where the windows share will appear in the Linux system). Let’s call that /jail/home1:
    mkdir /jail/home1
  3. In the Ubuntu system, we may need to install the samba support if it’s not there already:
    apt-get install smbfs
  4. now we will edit the /etc/fstab file to add the line to mount the share. Let’s assume that the windows box has the ip, and the share is called “windowsshare”.
    nano /etc/fstab
  5. In the /etc/fstab, we’re going to insert the following line, then hit CTRL-X and follow the prompts to save the /etc/fstab file. :
    // /jail/home1 cifs credentials=/root/.smbcredentials,uid=nobody,gid=nogroup,iocharset=utf8,codepage=unicode,unicode 0 0(Note: The first bit is the address of the server that’s got the share on Windows, then where we want to mount it, followed by the “cifs:” which tells the system this is a samba mount, and a location for the credentials file (we will get to that in a second) then the user id (UID) and group id (GID), followed by some options for codepage support so characters are mapped the right way between the two machines, and then 0 0 to instruct the Ubuntu machine to skip dumps and filechecks at boot time — we are saying we don’t want any! Note that we chose the root user and “backupusers” group for the uid and gid, respectively. Since the files are in the group backupusers, this will allow users in the backupusers group (in our case the backup accounts are all in this group by default) to read and write files to these folders. Having root as the owner is not going to affect anything: since the whole mount will have one owner and group under linux, this is the best we can do. )
  6. Create a file with the username and password from Windows (see step 1), using the filename specified in the /etc/fstab line from step 5:
    nano /root/.smbcredentials
    and enter these two lines in the file and save changes:
  7. secure the file so only root can get in and access it:
    chown root:root /root/.smbcredentials; chmod 400 /root/.smbcredentials

If you need to get more background info on how to mount samba shares on Ubuntu, try these resources:

Label & Launch Your Backup Software in 5 Mins

Start your all-inclusive, no-risk, free trial today


How Can We Help?

The team at WholesaleBackup is happy to listen and share their backup & recovery expertise spanning over 15 years of business-class backup software solutions for resellers, MSPs, and IT Pros. If you are ready to begin building a more profitable and reliable backup service you’re in the right place.

  • Learn how to get started with labeling & deploying your own backup service
  • See how to schedule, run backups, and restore data
  • Understand how to remotely manage and monitor end-user’s backups
  • Get any questions you have addressed

Take a minute to fill out the form and we’ll follow up with you about your request. For a quicker response start a conversation in the chat.