🖥️Data Storage and Backup Solutions
🖥️Introduction
Enterprise storage solutions like SAN (Storage Area Network) and NAS (Network Attached Storage) are pivotal in managing and accessing large volumes of data efficiently. This technical blog dives into the practical aspects, commands, and troubleshooting tips crucial for storage and backup engineers.
📁Block Diagram NAS vs SAN
Connections NAS:
Clients connect to the Ethernet Switch.
Ethernet Switch connects to the NAS Server.
NAS Server connects to the Storage.
NAS Server is part of the Local Area Network.
Connections SAN:
Clients connect to the FC Switch.
FC Switch connects to the SAN Servers and SAN Storage.
SAN Servers connect to the Ethernet Switch.
SAN Servers manage the Storage Arrays.
SAN operates within the Fibre Channel Network.
📁Flowchart NAS and SAN
🖥️NAS: Network Attached Storage
NAS is akin to a central repository accessible from any authorized device on your network. It functions as a dedicated storage appliance equipped with its own OS and file system, connecting seamlessly via Ethernet.
📁Key Features:
File-level storage
Easier setup and management compared to SAN
Uses NFS or SMB/CIFS protocols
Ideal for small to medium-sized businesses (SMBs)
📁Practical Example:
A design firm uses a NAS to store all their design projects, enabling seamless collaboration and file access for multiple designers.
📁Troubleshooting Tip:
- Access Issues: Verify network connectivity for both the NAS device and your computer. Check network configurations and firewall settings if necessary.
📁Common Commands:
While most NAS devices offer user-friendly web interfaces, some tasks may require command-line tools.
# Creating a Directory
#Creates a directory named 'mydirectory' under /mnt.
mkdir /mnt/mydirectory
# Copying Files
# Copies the file or directory from /path/to/source to /mnt/destination.
cp /path/to/source /mnt/destination
# Moving Files
# Moves the file or directory from /path/to/source to /mnt/destination.
mv /path/to/source /mnt/destination
# Deleting Files (use with caution!)
# Deletes the file 'myfile' located in the /mnt directory.
rm /mnt/myfile
🖥️NFS: Configuration and Commands
NFS allows a user on a client computer to access files over a network in a manner similar to how local storage is accessed.
📁Configuring NFS on Linux:
Installation and configuration steps for the NFS server,
##### Install NFS Server on Debian/Ubuntu #####
# Installs the NFS server package on a Debian-based system.
sudo apt-get install nfs-kernel-server
##### Install NFS Server on RHEL/CentOS #####
# Installs the NFS server package on a Red Hat-based system.
sudo yum install nfs-utils
##### Configure Exports in /etc/exports ####
# This allows the directory /srv/nfs to be shared with all devices in the
# 192.168.1.0/24 network, granting read-write access with synchronous writes
# and disabling subtree checking for improved performance.
echo "/srv/nfs 192.168.1.0/24(rw,sync,no_subtree_check)" | sudo tee -a /etc/exports
##### Start NFS Server on Debian/Ubuntu #####
# Starts the NFS server service on a Debian-based system.
sudo systemctl start nfs-kernel-server
# Start NFS Server on RHEL/CentOS
# Starts the NFS server service on a Red Hat-based system.
sudo systemctl start nfs-server
📁Common NFS Client Commands:
Configuring NFS Client,
##### Mount an NFS share ######
# Mounts an NFS share from a server to a local directory on the client machine,
# allowing access to the remote files as if they were on the local file system.
mount -t nfs <server>:/path/to/share /mnt/mountpoint
# -t nfs: Specifies the filesystem type as NFS.
# <server>:/path/to/share: The NFS server and the path to the shared directory.
# /mnt/mountpoint: The local directory where the NFS share will be mounted.
##### Show NFS mounts ######
# Displays the list of shared directories from the specified NFS server.
# <server>: The NFS server from which to display the shared directories.
showmount -e <server>
##### Unmount NFS share #####
# Unmounts the specified NFS share from the local directory.
# /mnt/mountpoint: The local directory where the NFS share was mounted.
umount /mnt/mountpoint
##### Check mounted NFS shares #####
# Displays a report on the file system disk space usage, including mounted NFS '
# shares.
df -h -t nfs
🖥️SMB/CIFS: Configuration and Commands
📁Configuring SMB/CIFS on Linux:
#### Installation #####
# Install Samba on Debian/Ubuntu
# Installs the Samba package on a Debian-based system.
sudo apt-get install samba
# Install Samba on RHEL/CentOS
# Installs the Samba package on a Red Hat-based system.
sudo yum install samba
##### Configure Samba in /etc/samba/smb.conf ####
# Configures a shared directory in the Samba configuration file.
cat <<EOL >> /etc/samba/smb.conf
[shared]
path = /srv/samba
read only = no
browsable = yes
EOL
# OR
echo -e "[shared]\npath = /srv/samba\nread only = no\nbrowsable = yes" | sudo tee -a /etc/samba/smb.conf
# [shared]: The name of the shared directory.
# path: The path to the shared directory.
# read only: Set to 'no' to allow write access.
# browsable: Set to 'yes' to make the share visible in the network.
##### Start Samba services #####
# Starts the Samba services to make the shared directory available.
sudo systemctl start smbd
sudo systemctl start nmbd
# smbd: Samba daemon that provides file sharing and printing services.
# nmbd: NetBIOS name server daemon that helps in name resolution and browsing.
🖥️SAN: Storage Area Network
SAN is a dedicated network for storage devices, often utilizing high-speed Fibre Channel connections. It offers granular control by interacting directly with storage blocks.
📁Key Features:
Block-level storage
High performance and low latency
Scalability
Uses Fiber Channel (FC) or iSCSI protocols
📁Practical Example:
A large hospital uses a SAN to store critical patient medical records, ensuring high speed and reliability for rapid access to vital information.
📁Troubleshooting Tip:
- Performance Issues: Investigate potential bottlenecks within your network infrastructure. Ensure proper functioning of Fibre Channel connections and consider upgrading switches or cables if necessary.
🖥️SAN Components and Commands:
📁Fibre Channel (FC):
Used in large enterprise environments where high performance, low latency, and dedicated storage networks are critical
Infrastructure: Switches, HBAs (Host Bus Adapters), and cabling.
Key Commands:
WWN (World Wide Name):
This is the unique identifier assigned to each FC device, similar to a MAC address in Ethernet networks.
FCID (Fibre Channel ID): This is a unique identifier assigned to each FC port on a device within a Fibre Channel fabric.
FC Ports:
N_port (Node port)
F_port (Fabric port)
E_port (Expansion port)
G_port (Generic port)
fcping <WWN or FCID> # The command sends ping-like packets over the FC network to the # specified device and measures the round-trip time (latency) and # packet loss.
📁iSCSI:
More commonly used in small to medium-sized businesses or environments where cost savings and leveraging existing Ethernet infrastructure are important.
Leverages existing Ethernet infrastructure, making it more affordable to deploy and scale.
Standard Port: 3260 (TCP)
Discovery Port: 860 (TCP)
🖥️Conclusion
Choosing between NAS and SAN depends on your specific needs:
NAS is ideal for SMBs, file sharing, and general-purpose storage.
SAN is suited for large organizations, mission-critical applications, and high-performance environments.
A hybrid approach using both NAS and SAN can leverage the strengths of each technology, creating a well-rounded storage strategy.
Subscribe to my newsletter
Read articles from AJEET GUPTA directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
AJEET GUPTA
AJEET GUPTA
Hi there! I’m Ajeet, a System Administrator with three years of experience in managing both on-premises and cloud infrastructures. I’m all about using ITIL practices to automate tasks, solve problems, and keep systems running smoothly.