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.

 

Search
Categories
Read More
Film
সামাজিক যোগাযোগমাধ্যমে আবেদনময় ছবি দেওয়া বন্ধ করবেন না এই অভিনেত্রী
চলতি বছর নারী অধিকার নিয়ে অনেকবারই সোচ্চার হতে দেখা গেছে মডেল ও অভিনেত্রী এমিলি...
By Faria Afrin 2022-10-23 09:26:43 0 3K
Party
Tigers popularity 8 tiny leaguers towards Arizona Drop League roster
The Arizona Tumble League will purchase underway upon Oct 2, and the Tigers will be properly...
By Camerons Camerons 2024-07-16 08:02:44 0 9K
Other
একটা ছোট গল্প...
এক শুক্রবার সকালে স্ত্রী বললো,"চলো, আজ ডিনারটা বাইরে করি।" বাইরে অর্থাৎ রেস্টুরেন্টে...
By ছোট গল্প 2024-05-20 10:45:42 0 3K
Other
ঢাকায় আসছেন রাশিয়ার পররাষ্ট্রমন্ত্রী
ইন্ডিয়ান ওশান রিম অ্যাসোসিয়েশনের (আইওআরএ) আয়োজনে এক বৈঠকে অংশ নেওয়ার জন্য রাশিয়ার...
By RTV News 2022-11-07 06:10:57 0 4K
Networking
Embracing the Circular Economy: How the Oil Industry is Reducing Waste
The concept of a circular economy has gained significant traction in recent years, challenging...
By Chavan Consulting Inc 2024-05-25 06:05:40 0 5K