Skip to content

Click on each book below to review & buy on Amazon.

As an Amazon Associate, I earn from qualifying purchases.


CompTIA Linux+ XK0-005 - 1.3 - Storage Area Network (SAN)/Network-Attached Storage (NAS)

Storage Area Network (SAN) and Network-Attached Storage (NAS) are two different approaches to centralized storage in a network environment. In this guide, we will explore the concepts and tools related to SAN and NAS, including multipathd, Network File System (NFS), and Server Message Block (SMB)/Common Internet File System (CIFS).

multipathd

multipathd is a daemon that manages multipath devices in a SAN environment. It allows you to configure and monitor multipath devices, which are logical devices that provide redundancy and load balancing across multiple physical paths to storage devices. The following are some common commands used with multipathd:

  • multipath -ll: Lists all the available multipath devices and their current state.
  • multipath -v2: Provides detailed information about the configured multipath devices.
  • multipath -r: Reloads the multipath configuration without restarting the daemon.

Example:

$ multipath -ll
mpath0 (360060e801054b200d4a5e5b2d4f55311) dm-0 DELL,MD3000i
size=100G features='0' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=1 status=active
| `- 1:0:0:0 sda 8:0 active ready running
`-+- policy='round-robin 0' prio=1 status=enabled
  `- 2:0:0:0 sdb 8:16 active ready running

Network File System (NFS)

Network File System (NFS) is a network protocol that allows remote file systems to be mounted over a network. It enables file sharing between systems in a client-server model. The NFS server exports directories, which can be mounted by NFS clients. The following commands are commonly used with NFS:

  • showmount -e: Displays the NFS shares exported by a server.
  • mount -t nfs: Mounts an NFS share on a client system.
  • exportfs: Manages the list of directories and options exported by the NFS server.

Example:

$ showmount -e nfs-server
Export list for nfs-server:
/nfs/share      client1,client2

$ mount -t nfs nfs-server:/nfs/share /mnt/nfs

$ exportfs -v
/nfs/share      client1(rw,wdelay,no_root_squash,no_subtree_check)
                client2(rw,wdelay,no_root_squash,no_subtree_check)

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

Server Message Block (SMB) and Common Internet File System (CIFS) are protocols used for file sharing in Windows-based environments. They allow for accessing and sharing files, printers, and other resources over a network. In Linux, the smbclient command-line tool is commonly used to interact with SMB/CIFS shares.

Example:

$ smbclient -L //smb-server -U username
Enter username's password:
Domain=[WORKGROUP] OS=[Windows Server 2016 Standard 14393] Server=[Windows Server 2016 Standard 6.3]

        Sharename       Type      Comment
        ---------       ----      -------
        public          Disk      Public Share
        documents       Disk      User Documents

$ smbclient //smb-server/public -U username
Enter username's password:
Domain=[WORKGROUP] OS=[Windows Server 2016 Standard 14393] Server=[Windows Server 2016.3]

smb: \> ls
  .                                   D        0  Tue Sep 21 12:34:56 2021
  ..                                  D        0  Wed Aug 18 10:22:12 2021
  file1.txt                           A     1024  Wed Aug 18 10:22:12 2021
  file2.txt                           A      512  Tue Sep 21 12:34:56 2021

smb: \> get file1.txt
getting file \file1.txt of size 1024 as file1.txt (0.5 KiloBytes/sec) (average 0.5 KiloBytes/sec)

In the above example, we first list the available shares on the SMB server using the smbclient -L command. Then, we connect to the public share using the smbclient command with the specified username. Once connected, we can use various commands such as ls to list the files in the share and get to download a file from the share to the local system.

Conclusion

In this guide, we have explored the concepts and tools related to Storage Area Network (SAN) and Network-Attached Storage (NAS). We covered multipathd for managing multipath devices in a SAN environment. We also discussed Network File System (NFS), which allows for remote file system mounting, and Server Message Block (SMB)/Common Internet File System (CIFS) for file sharing in Windows-based environments.


Support DTV Linux

Click on each book below to review & buy on Amazon. As an Amazon Associate, I earn from qualifying purchases.

NordVPN ®: Elevate your online privacy and security. Grab our Special Offer to safeguard your data on public Wi-Fi and secure your devices. I may earn a commission on purchases made through this link.