Mount a File System on Linux

0
5K

Mounting or unmounting a file system on Linux is usually straightforward, except when it isn’t. This article teaches you how to mount and unmount file systems, as well as list available and currently mounted file systems. It also explains how to handle the case where file systems won’t unmount because they are in use.

 

On a Linux system, you can list the currently available file system types from the command line with:

cat /proc/filesystems


The result looks something like this list, which is from an Ubuntu 22.04 LTS Linode:



You can list the currently mounted file systems from a Linux command line with a simple mount command.

mount


The following is on an Ubuntu 22.04 LTS, logged in as root:

linux

You can list the static file system information by displaying /etc/fstab.

cat /etc/fstab

You can also list and search for file systems using the findmnt command.

findmnt

You can restrict the output various ways, as described in man findmnt, to show only specific devices, mount points, or file system types, such as:

findmnt -t ext4

 

If you’re only interested in block devices, you can list them with lsblk command:

lsblk

How to Mount File Systems on Linux

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. Here are a few examples using the mount command, plus the preparatory mkdir command to create the mount point.


Mount a Windows Floppy Disk

    This command is only necessary if the /mnt/floppy directory doesn’t already exist.

mkdir /mnt/floopy

 Use mount with the -t flag (short for “type”) to specify MSDOS as the file system.

mount -t msdos /dev/fd0 /mnt/floopy

The contents of the floppy disk in /dev/fd0 should now be accessible from /mnt/floppy.

 

Căutare
Categorii
Citeste mai mult
Film
আলিয়া ভাট থেকে নেহা ধুপিয়া, বিয়ের আগেই অন্তঃসত্ত্বা হয়েছিলেন যাঁরা
চলতি বছরের ১৪ এপ্রিল বিয়ে করেন রণবীর কাপুর ও আলিয়া ভাট। এর দুই মাসের মধ্যে আলিয়া দেন...
By Prothom Alo 2022-11-08 01:34:18 0 3K
Sports
Banchero, Harris guide Magic in direction of 126-120 acquire around Pacers
ORLANDO, Fla.Paolo Banchero scored 23 info and Garry Harris built all 6 of his 3-reality photos...
By Dever Ngets 2024-11-01 07:38:56 0 963
Shopping
Why Do Black Women Wear 360 Wigs Today
When we talk about women wearing 360 Wigs today, there are lots of factors which play...
By Mslynnhair Mslynnhair 2022-11-30 07:25:53 0 3K
Shopping
How Can the Comme des Garçons x Eric Emanuel Hoodie Elevate Your Everyday Look?
  The fashion world has been buzzing with collaborations that blur the lines...
By Stussy Apperal 2024-11-10 09:04:44 0 4K
Alte
How To Install and Configure Postfix as a Send-Only SMTP Server on Ubuntu 22.04
Introduction Postfix is a mail transfer agent (MTA), an application used to send and receive...
By Linux Help BD 2024-10-05 08:23:44 0 2K