Mounting a File System on Linux, Red Hat, or CentOS (2024)

  1. Log into the instance where you want to mount the file system.

    See Connecting to an Instance.

    Example:

    ssh user@192.0.2.0
  2. Install the NFS client using this command:

    sudo yum install nfs-utils
  3. Create a directory that will be used as the mount point.

    Replace <yourmountpoint> with a directory name of your choice. Example: /mnt/mountpoint-A

    sudo mkdir -p <yourmountpoint>
  4. Mount the file system.

    Caution

    Omitting the -o nosuid option can allow unprivileged users to escalate their permissions to 'root'. The nosuid option disables set-user-identifier or set-group-identifier bits within the mounted system, which are rarely used.

    Example:

    sudo mount -t nfs -o nfsvers=<version>,nosuid <10.x.x.x>:<fs-export-path> <yourmountpoint>
  5. View the mounted file system.

    df -h
  6. Write a file to the file system.

    Replace <yourmountpoint> with the path to the local mount point and <filename>with your file name.

    sudo touch /mnt/<yourmountpoint>/<filename>
  7. Verify that you can access the file system and view the file.

    Replace yourmountpoint with the path to the local mount point.

    cd <yourmountpoint>ls
  8. Add the file system mount information to the appropriate mount file for your OS.

    So far, the file system is manually mounted to the client. If the client is rebooted, the file system won't automatically mount unless you add it to the mount file (for example the /etc/fstab or /etc/vfstab file).

Mounting a File System on Linux, Red Hat, or CentOS (2024)

FAQs

How to mount a filesystem in CentOS? ›

Mounting a File System on Linux, Red Hat, or CentOS
  1. Log into the instance where you want to mount the file system. ...
  2. Install the NFS client using this command: sudo yum install nfs-utils.
  3. Create a directory that will be used as the mount point. ...
  4. Mount the file system. ...
  5. View the mounted file system.
Nov 21, 2023

What is the mounting file system in Linux? ›

Mounting makes file systems, files, directories, devices, and special files available for use at a particular location. It is the only way a file system is made accessible. The mount command instructs the operating system to attach a file system at a specified directory.

How to mount a filesystem in Linux permanently? ›

You can mount file systems for a single session using the mount command, and permanently by editing /etc/fstab . Mounting needs to be done by an administrator, either by logging in as root or by using the sudo command. There are some cases where mounting is done automatically, like when you insert a USB flash drive.

What file system type is Red Hat Linux? ›

The XFS File System. XFS is a robust and mature 64-bit journaling file system that supports very large files and file systems on a single host. It is the default file system in Red Hat Enterprise Linux 7.

How to install a file in CentOS? ›

  1. For a USB UEFI boot, follow the steps: Mount the volume: mount /root/CentOS-install/images/efiboot.img /mnt/ Edit the file /mnt/EFI/BOOT/grub.cfg : ...
  2. For a CDROM UEFI boot, follow the steps: Edit the file /root/CentOS-install/EFI/BOOT/grub.cfg : Add a new menu entry to the file:

How do I automatically mount a filesystem in Linux? ›

On Linux instances, if you want to automatically mount exported file systems during an instance boot, you need to add the mount information in the /etc/fstab file. Log into the instance where you want the file system mounted. See Connecting to an Instance. Create a mount point, if one hasn't been created.

How to mount a disk in Red Hat? ›

  1. Specifying the File System Type. In most cases, mount detects the file system automatically. ...
  2. Specifying the Mount Options. To specify additional mount options, use the command in the following form: ...
  3. Sharing Mounts. ...
  4. Moving a Mount Point. ...
  5. Setting Read-only Permissions for root.

How to create a filesystem in Linux and mount it? ›

To create a filesystem, there are three steps:
  1. Create partitions using fdisk or Disk Utility. ...
  2. Format the partitions using mkfs or Disk Utility.
  3. Mount the partitions using the mount command or automate it using the /etc/fstab file.

Is Red Hat Linux still used? ›

Red Hat Linux was a widely used commercial open-source Linux distribution created by Red Hat until its discontinuation in 2004. Early releases of Red Hat Linux were called Red Hat Commercial Linux. Red Hat published the first non-beta release in May 1995.

What is the default file system in RedHat Linux? ›

XFS is the default file system in Red Hat Enterprise Linux 7 and Red Hat, and Red Hat recommends you to use XFS unless you have a strong reason to use another file system.

What is the difference between Red Hat Linux and Linux? ›

How is RedHat Enterprise Linux different from Linux? RHEL is an operating system that uses (the) Linux (kernel) as one component, the kernel. But it contains other stuff too, like the actual userspace programs that are necessary to use the kernel in any meaningful way. Plus it packages applications programs.

How to mount XFS filesystem in CentOS 7? ›

Steps to mount a drive with an xfs file system
  1. Login as root. **su - **2. Find the device name using: fdisk -l.
  2. Create a mount point. **mkdir /mnt/mydrive. **4. Mount the drive. Please use the device name you found in step 2 (such as /dev/sdb1). ...
  3. You can navigate to it using **cd /mnt/mydrive **and list files using ls.
Dec 26, 2012

How to mount a new disk in CentOS 7? ›

In this step-by-step guide, we will explain how to add a new disk to Linux CentOS 7 without rebooting.
  1. Step 1: Check the available disks on the system: ...
  2. Step 2: Partition the new disk: ...
  3. Step 3: Format the new partition: ...
  4. Step 4: Create a mount point: ...
  5. Step 5: Mount the new partition:

How to mount NTFS file system in CentOS 8? ›

Mount NTFS Partition with Read-Only Permission
  1. Identify NTFS Partition. Before mounting an NTFS partition, identify it by using the parted command: sudo parted -l.
  2. Create Mount Point and Mount NTFS Partition. ...
  3. Update Package Repositories. ...
  4. Install Fuse and ntfs-3g. ...
  5. Mount NTFS Partition.
Oct 8, 2020

How to mount an external hard disk in CentOS? ›

Step 5:
  1. cp /etc/fstab /etc/fstab.orig (**backup the config file before change to avoid loss of original settings if any)
  2. vi /etc/fstab.
  3. Add this line at the end: /dev/ssd /mntssd ext4 defaults 0 2.
  4. Save the file and exit the editor.
  5. Use “mount -a” command to verify the fstab settings added correctly.

Top Articles
Latest Posts
Article information

Author: Rev. Porsche Oberbrunner

Last Updated:

Views: 6137

Rating: 4.2 / 5 (53 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Rev. Porsche Oberbrunner

Birthday: 1994-06-25

Address: Suite 153 582 Lubowitz Walks, Port Alfredoborough, IN 72879-2838

Phone: +128413562823324

Job: IT Strategist

Hobby: Video gaming, Basketball, Web surfing, Book restoration, Jogging, Shooting, Fishing

Introduction: My name is Rev. Porsche Oberbrunner, I am a zany, graceful, talented, witty, determined, shiny, enchanting person who loves writing and wants to share my knowledge and understanding with you.