Mount a File System on Linux

0
4KB

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.

 

Rechercher
Catégories
Lire la suite
Sports
Tigers Get Starkvegas: Mississippi Region Preview
No. 2 LSU Tigers at Mississippi Nation Bulldogs DATESTIMESFriday, March 15 6 p.m. CT who includes...
Par Arkans Razorb 2024-09-11 03:36:45 0 5KB
Jeux
Discover the Winning Formula at Reddy Anna Book – A World of Live Games
Reddy Anna Book has surfaced as one of the most reliable and the most active platform for live...
Par Reddy Anna Book 2024-10-07 06:55:12 0 956
Religion
সিরিয়া সম্পর্কে রাসুলুল্লাহর (সা.) ভবিষ্যদ্বাণী
বর্তমান সিরিয়ার প্রাচীন ও ঐতিহাসিক নাম হলো শাম। বিভিন্ন হাদিসে শাম সম্পর্কিত যেসব বর্ণনা পাওয়া...
Shopping
to take a holistic approach Golden Goose to selecting a fashion school
You can shop an array of the more unconventional knits that are trending like side-slit midis and...
Par Lilliana Haynes 2024-10-21 15:52:52 0 1KB
Shopping
The Heritage and Appeal of the Vintage Harley-Davidson Jacket
  The harley davidson riding jackets​ is more than a fashion piece; it’s a testament...
Par Jesse Lowrie 2024-11-01 06:46:16 0 181