How to mount disks and partitions in Linux (2024)

In Linux, you must mount a disk or partition to a folder, called a mount point, to access its data. This makes the filesystem on the disk available for reading and writing. Mounting is required to use any disk or partition with the system.

How to mount disks and partitions in Linux (1)

You can mount disks and partitions manually as needed or configure them to mount automatically at startup by editing the /etc/fstab file. You can mount using the disk’s device name, label, or UUID.

Knowing how to mount disks in Linux is crucial for accessing and managing your storage devices. This guide explains the process for manual and automatic mounting.

Steps to mount a disk or partition in Linux:

  1. Open the terminal.

  2. Identify the disk or partition you want to mount.

    $ lsblkNAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTloop0 7:0 0 55.4M 1 loop /snap/core18/1944loop1 7:1 0 55.4M 1 loop /snap/core18/1932loop2 7:2 0 217.9M 1 loop /snap/gnome-3-34-1804/60loop3 7:3 0 219M 1 loop /snap/gnome-3-34-1804/66loop4 7:4 0 64.8M 1 loop /snap/gtk-common-themes/1514loop5 7:5 0 51M 1 loop /snap/snap-store/518loop6 7:6 0 62.1M 1 loop /snap/gtk-common-themes/1506loop7 7:7 0 51M 1 loop /snap/snap-store/498loop8 7:8 0 31.1M 1 loop /snap/snapd/10707loop9 7:9 0 31.1M 1 loop /snap/snapd/10492sda 8:0 0 20G 0 disk ├─sda1 8:1 0 1M 0 part ├─sda2 8:2 0 513M 0 part /boot/efi└─sda3 8:3 0 19.5G 0 part /sdb 8:16 0 20G 0 disk └─sdb1 8:17 0 20G 0 part sr0 11:0 1 1024M 0 rom
  3. Determine the filesystem type of the disk or partition.

    $ blkid /dev/sdb1/dev/sdb1: UUID="ccab0f8d-3b5b-4189-9da3-23c49159c318" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="c088a647-01"
  4. Create a directory for the mount point if it does not exist.

    $ mkdir disk
  5. Temporarily mount the disk or partition.

    $ sudo mount -t ext4 /dev/sdb1 disk[sudo] password for user:

    Replace ext4 with the actual filesystem type if different.

  6. Verify that the disk or partition is mounted.

    $ df -hFilesystem Size Used Avail Use% Mounted ontmpfs 391M 1.8M 389M 1% /run/dev/sda3 20G 7.1G 12G 39% /tmpfs 2.0G 0 2.0G 0% /dev/shmtmpfs 5.0M 0 5.0M 0% /run/locktmpfs 4.0M 0 4.0M 0% /sys/fs/cgroup/dev/sda2 512M 7.8M 505M 2% /boot/efitmpfs 391M 112K 391M 1% /run/user/1000/dev/sdb1 20G 45M 19G 1% /home/user/disk
  7. Unmount the previously mounted drive.

    $ sudo umount /dev/sdb1
  8. To mount the disk automatically at startup, edit the /etc/fstab file.

    $ sudo vi /etc/fstab
  9. Add an entry in /etc/fstab for the disk or partition.

    /dev/sdb1 /home/user/disk ext4 defaults 0 0
  10. Apply the changes by mounting all filesystems.

    $ sudo mount -a
  11. Confirm the disk or partition is mounted.

    $ df -hFilesystem Size Used Avail Use% Mounted ontmpfs 391M 1.8M 389M 1% /run/dev/sda3 20G 7.1G 12G 39% /tmpfs 2.0G 0 2.0G 0% /dev/shmtmpfs 5.0M 0 5.0M 0% /run/locktmpfs 4.0M 0 4.0M 0% /sys/fs/cgroup/dev/sda2 512M 7.8M 505M 2% /boot/efitmpfs 391M 112K 391M 1% /run/user/1000/dev/sdb1 20G 45M 19G 1% /home/user/disk

How to mount disks and partitions in Linux (2)

How to mount disks and partitions in Linux (3)

Author: Mohd Shakir Zakaria
Mohd Shakir Zakaria is an experienced cloud architect with a strong development and open-source advocacy background. He boasts multiple certifications in AWS, Red Hat, VMware, ITIL, and Linux, underscoring his expertise in cloud architecture and system administration.

How to mount disks and partitions in Linux (4) How to mount disks and partitions in Linux (5)How to mount disks and partitions in Linux (6) How to mount disks and partitions in Linux (7)

Discuss the article:

Comment anonymously. Login not required.

How to mount disks and partitions in Linux (2024)
Top Articles
Stopping deforestation and illegal logging
Learn the advantages of using performance-based assessments
$4,500,000 - 645 Matanzas CT, Fort Myers Beach, FL, 33931, William Raveis Real Estate, Mortgage, and Insurance
Calvert Er Wait Time
Top 11 Best Bloxburg House Ideas in Roblox - NeuralGamer
Craigslist Warren Michigan Free Stuff
How To Do A Springboard Attack In Wwe 2K22
Celebrity Extra
Erika Kullberg Wikipedia
Unlocking the Enigmatic Tonicamille: A Journey from Small Town to Social Media Stardom
Mivf Mdcalc
Fcs Teamehub
Violent Night Showtimes Near Amc Fashion Valley 18
My Vidant Chart
The Wicked Lady | Rotten Tomatoes
Celsius Energy Drink Wo Kaufen
Mephisto Summoners War
Craigslist Deming
Spartanburg County Detention Facility - Annex I
Colorado mayor, police respond to Trump's claims that Venezuelan gang is 'taking over'
Walmart Double Point Days 2022
Gemita Alvarez Desnuda
Comics Valley In Hindi
1v1.LOL - Play Free Online | Spatial
623-250-6295
Hermitcraft Texture Pack
College Basketball Picks: NCAAB Picks Against The Spread | Pickswise
Marion City Wide Garage Sale 2023
What Time Does Walmart Auto Center Open
Prep Spotlight Tv Mn
Www Pointclickcare Cna Login
Craiglist.nj
Mississippi Craigslist
Bi State Schedule
Texters Wish You Were Here
The Ride | Rotten Tomatoes
Moxfield Deck Builder
Federal Student Aid
Honda Ruckus Fuse Box Diagram
Austin Automotive Buda
Wsbtv Fish And Game Report
Today's Gas Price At Buc-Ee's
Toth Boer Goats
Infinite Campus Parent Portal Hall County
2024-09-13 | Iveda Solutions, Inc. Announces Reverse Stock Split to be Effective September 17, 2024; Publicly Traded Warrant Adjustment | NDAQ:IVDA | Press Release
Hawkview Retreat Pa Cost
What Time Do Papa John's Pizza Close
Lira Galore Age, Wikipedia, Height, Husband, Boyfriend, Family, Biography, Net Worth
Aaca Not Mine
211475039
Latest Posts
Article information

Author: Moshe Kshlerin

Last Updated:

Views: 6563

Rating: 4.7 / 5 (57 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Moshe Kshlerin

Birthday: 1994-01-25

Address: Suite 609 315 Lupita Unions, Ronnieburgh, MI 62697

Phone: +2424755286529

Job: District Education Designer

Hobby: Yoga, Gunsmithing, Singing, 3D printing, Nordic skating, Soapmaking, Juggling

Introduction: My name is Moshe Kshlerin, I am a gleaming, attractive, outstanding, pleasant, delightful, outstanding, famous person who loves writing and wants to share my knowledge and understanding with you.