Mount a File System on Linux

0
7KB

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.

 

Search
Nach Verein filtern
Read More
Other
How to Use a Cheap SMM Panel to Boost Your Brand Online
In today's digital world, establishing a strong online presence is key to any business's success....
Von SMM Gen 2025-03-11 11:18:12 0 730
Health
How ErecSurge Can Transform Your Performance
 Introduction In the world of male enhancement supplements, ERECSURGE has gained popularity...
Von ErecSurge ErecSurge 2025-03-08 10:50:31 0 421
Spiele
RS2Hot Tips for Profitable Potion Crafting
As an experienced RuneScape player, I’ve always been on the lookout for efficient and...
Von rs2hot agatha 2024-09-02 01:26:00 0 7KB
Networking
ওয়েবসাইট থেকে আয় করার ৬ উপায়
ওয়েবসাইট তৈরি করে তা থেকে বিভিন্ন উপায়ে আয় করা যায়। ওয়েবসাইট তৈরির পর সেটির মাধ্যমে কীভাবে আয়...
Von Mizanur Rahman 2022-09-24 03:52:09 0 5KB
Other
find the best South Jersey Criminal Defense Attorneys
Introduction to South Jersey Criminal Defense Attorneys Overview of Criminal Defense Attorneys in...
Von Webkey Digital 2025-01-31 06:59:14 0 1KB