Storing Photos on a WD Home Drive (Linux) for a Shared PUBLIC Folder in a Running Ubuntu 20.4 Server

Abstract: Mount a WD Home Drive SMB share on Ubuntu 20.04 for automatic boot access to a shared public photo folder.

Created: 2026-09-28 by
To store photos on a WD Home Drive (a network NAS) for a shared PUBLIC folder in Ubuntu 20.04, you must mount the SMB/CIFS share rather than treating it as a local block device. This process involves installing the cifs-utils package, creating a dedicated directory, and configuring /etc/fstab to ensure the network volume is automatically mounted at boot. By setting appropriate permissions and using the guest or specific user credentials, you allow multiple users or services to access the media files seamlessly through the shared path.

Understanding the Network Storage Architecture

A WD Home Drive operates as a network-attached storage (NAS) device accessible via the SMB/CIFS protocol over your local area network. Unlike a USB hard drive that appears as a physical block device like /dev/sdb1, a network drive exists only when connected to the network stack. Attempting to format or partition it directly from the Linux command line will fail because there is no local filesystem structure exposed to the kernel without first establishing a network connection.

The goal is to create a local mount point on your Ubuntu server that acts as a gateway to this remote storage. When you save a file to this local directory, the operating system transparently sends the data over the network to the WD drive. This approach ensures that your Ubuntu 20.04 server can manage the photos just as if they were stored locally, while retaining the benefits of centralized network storage.

Prerequisites and Initial Setup

Before configuring the mount, ensure your server has network connectivity to the WD Home Drive. You should know the IP address of the WD drive and the name of the specific share containing your photos. If you have not yet established basic connectivity to your Ubuntu server, refer to our guide on Unable to SSH into Ubuntu Server: Log in Locally First to ensure you can access the terminal effectively.

You will need administrative privileges to install software and modify system configuration files. Open your terminal and update your package lists to ensure you have the latest versions of the required tools:

sudo apt update
sudo apt upgrade -y

Next, install the necessary utilities for mounting CIFS shares. The cifs-utils package provides the mount.cifs command-line tool required by Linux to communicate with Windows-style network shares:

sudo apt install cifs-utils -y

Creating the Mount Point and Permissions

Choose a location on your Ubuntu server where the photos will be accessible. A common convention is to use /mnt/wd_photos. Create this directory using the following command:

sudo mkdir -p /mnt/wd_photos

For a PUBLIC shared folder, you typically want all users on the system to be able to read and write to this directory. Set the ownership to the root user initially, but adjust permissions so that others can access it. For example, to allow full access to everyone:

sudo chmod 777 /mnt/wd_photos

Alternatively, if you have a specific group for media management, change the group ownership instead of using world-writable permissions, which is generally less secure for production environments.

Configuring the fstab Entry

The most robust way to handle network mounts is through /etc/fstab. This file tells the system how to mount drives during the boot process. Editing this file incorrectly can prevent your system from booting, so proceed with caution.

Open the fstab file with a text editor:

sudo nano /etc/fstab

Add a new line at the end of the file. The syntax for a CIFS mount is:

//WD_IP_ADDRESS/SHARE_NAME /mnt/wd_photos cifs credentials=/etc/samba/credentials,iocharset=utf8,file_mode=0777,dir_mode=0777,nofail,x-systemd.automount 0 0

Replace WD_IP_ADDRESS with the actual IP of your WD Home Drive and SHARE_NAME with the name of the public folder. The nofail option ensures the system continues to boot even if the network drive is temporarily unavailable. The x-systemd.automount option improves performance by only connecting when the directory is accessed.

If the WD Home Drive requires authentication, create a credentials file:

sudo nano /etc/samba/credentials

Inside this file, add your username and password:

username=your_username
password=your_password

Secure this file so only root can read it:

sudo chmod 600 /etc/samba/credentials

If the share is truly public and allows guest access, you can omit the credentials parameter and instead use guest in the options list. However, many WD drives require at least a generic username for security reasons.

Testing and Verifying the Connection

Once the entry is saved in /etc/fstab, test the configuration without rebooting. Run the following command to attempt mounting all filesystems listed in fstab:

sudo mount -a

If there are no error messages, the mount was successful. Verify that the drive is mounted by checking the disk usage:

df -h | grep wd_photos

You should see the WD Home Drive listed with its available space. Now, try creating a test file in the directory:

touch /mnt/wd_photos/test_photo.jpg

If the file is created successfully, your setup is complete. You can now move your existing photo library to this directory. Ensure that any applications or services accessing these photos are configured to look at /mnt/wd_photos rather than their previous local paths.

Troubleshooting Common Issues

If the mount fails, check the system logs for detailed error messages:

sudo dmesg | tail -n 20

Common issues include incorrect IP addresses, firewall restrictions blocking port 445 (SMB), or mismatched SMB protocol versions. Older WD drives may require specifying the version in the fstab options, such as vers=1.0 or vers=2.0.

Additionally, ensure that your network interface is stable. If your server loses connection randomly, refer to resources on Ubuntu Linux Server Randomly Loses Connection to diagnose underlying network instability that might affect persistent mounts.

Frequently Asked Questions

Can I use NFS instead of CIFS for better performance?

NFS (Network File System) generally offers better performance for Linux-to-Linux sharing, but WD Home Drives typically only support SMB/CIFS out of the box. Unless you have installed third-party firmware on the WD drive that enables NFS, CIFS is the standard and most reliable choice for this hardware.

What happens if the WD Home Drive is turned off?

With the nofail option in /fstab, your Ubuntu server will boot normally even if the drive is offline. However, attempts to access the /mnt/wd_photos directory will result in an error until the drive is powered back on and connected to the network.

How do I change the permissions after mounting?

Permissions set in /etc/fstab using file_mode and dir_mode apply to all newly created files. To change permissions of existing files, use the standard chmod and chown commands on the local mount point, which will propagate changes to the network share.

Is it safe to store sensitive photos on this setup?

SMB traffic is not encrypted by default, meaning data travels across your network in plaintext. For sensitive photos, consider enabling encryption on the WD drive if supported, or use a VPN tunnel between the server and the NAS to encrypt the connection.

Why does my mount disappear after a reboot?

This usually indicates a typo in the /etc/fstab file or a failure in the network connection during boot. Check the syntax carefully, ensure the IP address is static, and verify that the network service starts before the mount attempt by using the x-systemd.automount directive.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More