Mount a File System on Linux

0
4K

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.

 

Cerca
Categorie
Leggi tutto
Music
Top Benefits of Using a Spotify SMM Panel for Growing Your Audience
Growing a loyal fanbase on Spotify is essential for any artist or music creator looking to...
By Spotify Panel 2024-10-23 07:48:39 0 1K
Altre informazioni
The Elegance of 22ct Gold Wedding Rings: A Timeless Symbol of Love
When it comes to wedding jewelry, few items carry as much significance and timeless beauty as...
By A1j Jewelry533 2024-10-03 14:40:24 0 2K
Shopping
Why Should You Buy A 360 Lace Front Wigs
You should have heard about 360 Lace Wig. It doesn't matter if you haven't heard about it....
By Mslynnhair Mslynnhair 2022-11-21 06:42:56 0 3K
Shopping
Why Do People Like Human Hair Wigs With Bangs
Wigs With Bangs Never Go Out Of Fashion And Are More And More Trendy. Do You Know Wigs With Bangs...
By Mslynnhair Mslynnhair 2022-11-17 07:16:47 0 3K
Party
based on a womenswear LV Sale look from fall 2024 ready to wear collection
The brand circumvented this gripe by giving attendees notepads and pens to write their show...
By Katherine West 2024-06-20 07:49:19 0 3K