Operations 13 min read

Master Linux File Mounting: From ISO Images to NFS and AutoFS

This guide walks you through Linux file system mounting techniques—including manual mounts for ISO images, USB drives, Windows shares, and NFS—as well as permanent fstab entries and automated mounting with autofs, complete with command examples and configuration tips.

Open Source Linux
Open Source Linux
Open Source Linux
Master Linux File Mounting: From ISO Images to NFS and AutoFS

Hello everyone! In server usage, mounting is one of the most common operations, so this article introduces Linux file mounting.

Manual Mounting

The basic syntax is: mount [-t vfstype] [-o options] device dir Key options: -t vfstype: specify filesystem type (e.g., iso9660, msdos, vfat, ntfs). -o options: mounting options such as loop, ro, rw, iocharset. device: the device to mount. dir: the mount point.

Mounting an ISO Image

# cp /dev/cdrom /home/xiuxiu/mydisk.iso   # or
# dd if=/dev/cdrom of=/home/xiuxiu/mydisk.iso

Create a mount point and mount the image:

mkdir /mnt/vcdrom
mount -o loop -t iso9660 /home/xiuxiu/mydisk.iso /mnt/vcdrom

Mounting a USB Hard Disk

Identify the device (e.g., /dev/sdc1, /dev/sdc5) and create mount points:

mkdir -p /mnt/usbhd1   # mkdir -p /mnt/usbhd2
mount -t ntfs /dev/sdc1 /mnt/usbhd1   # mount -t vfat /dev/sdc5 /mnt/usbhd2

For Chinese filenames, use the charset option:

mount -t ntfs -o iocharset=cp936 /dev/sdc1 /mnt/usbhd1
mount -t vfat -o iocharset=cp936 /dev/sdc5 /mnt/usbhd2

Mounting a USB Flash Drive

mount -t vfat -o iocharset=cp936 /dev/sdd1 /mnt/usb

Mounting a Windows Share (SMB/CIFS)

Install the Samba package if needed, then create a mount point and mount:

mkdir -p /mnt/samba
mount -t smbfs -o username=administrator,password=pas123 //10.140.133.25/c$ /mnt/samba

Mounting a UNIX NFS Share

Create a mount point and mount the NFS export:

mkdir -p /mnt/nfs
mount -t nfs -o rw 10.140.133.10:/export/home/xiuxiu /mnt/nfs

Supplementary Notes

SMB (also known as CIFS) is a Microsoft protocol for file and printer sharing; Samba provides Unix implementations.

For Solaris NFS server configuration, add a share with share -F nfs -o rw /export/home/xiuxiu and start the service.

For Linux NFS server, edit /etc/exports and start portmap and nfs services.

Mounting Optical Discs

mount /dev/cdrom /mnt/cdrom
umount /mnt/cdrom

Permanent Mounts (fstab)

Add entries to /etc/fstab using device names or UUIDs (obtainable via blkid).

Automatic Mounting with autofs

Install autofs: yum install autofs -y Start and enable the service:

systemctl start autofs.service
systemctl enable autofs.service

Configure rule files (e.g., /etc/auto.misc or custom /etc/auto.nfs) and the master map ( /etc/auto.master) to watch a parent directory and apply the rules.

After editing, restart the service: systemctl restart autofs Example NFS rule:

public -fstype=nfs serverb.lab.example.com:/shares/public

Once configured, accessing the watched directory triggers automatic mounting.

Reminder: Use rm -rf with extreme caution on mounted shares and always unmount when finished to avoid data loss.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

LinuxSystem AdministrationNFSFilesystemMountautofs
Open Source Linux
Written by

Open Source Linux

Focused on sharing Linux/Unix content, covering fundamentals, system development, network programming, automation/operations, cloud computing, and related professional knowledge.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.