Find out how to completely mount a drive in Linux (and why it is best to)


Morsa Pictures/Getty Pictures

I at the moment have 4 arduous drives inside my System76 Thelio desktop. The first drive serves as my working system and the others are strictly for housing several types of information. I’ve one drive for digital machines, one for music, and one for miscellaneous information. By laying out my system this manner, even when the working system fails, my information remains to be accessible.

I’ve these secondary drives arrange such that they’re mechanically accessible always. Within the Linux-verse, that is known as “automounting” and it is an essential job you may need to perceive.

Additionally: Open supply and Linux expertise are nonetheless in demand in a darkish economic system

Automounting is a factor as a result of when you could have secondary drives hooked up to a machine, they are not mechanically accessible to you upon boot of the machine. Sure, you may open your desktop file supervisor, navigate to the drive, and mount it by clicking the entry. Nevertheless, this may be problematic when you neglect to try this and also you both have a backup configured to mechanically save information to that drive otherwise you merely go to avoid wasting a file to that drive from an utility. If the drive is not mounted, the app (or backup) will not have the ability to entry the drive.

And that is why we at all times need to configure these drives for automounting.

Let me present you the way it’s accomplished.

Find out how to automount a drive in Linux

What you may want: To make this work, you may want a working occasion of Linux, a secondary drive plugged into your machine, and a consumer with sudo privileges. I am going to reveal with Pop!_OS Linux however the course of must be the identical, no matter which distribution you utilize. I may also assume the drive has been formatted. I at all times format my secondary Linux drives with the ext4 format. Should you’re utilizing an NTFS drive (a Home windows drive), you may want to put in the ntfs-3g software program with a command like sudo apt-get set up ntfs-3g.

Within the output of that command, it is best to see entries like this:

sda             8:0    0 931.5G  0 disk  
└─sda1          8:1    0 931.5G  0 half

Plug the drive in and run the command once more and you will see a brand new entry like:

sdb             8:16   0 931.5G  0 disk  
└─sdb1          8:17   0 931.5G  0 half

If you cannot simply unplug the secondary disk, simply run the lsblk command. Should you see two drives, sda and sdb, likelihood is excellent your secondary drive is sdb. For the aim of exhibiting this course of, we’ll assume the title of your drive is /dev/sdb.

The mount level would be the listing in your main drive that may function a location you’ll entry the secondary drive from. 

Additionally: An important cause you need to be utilizing Linux at house

This does not copy or transfer the information from one to the opposite however, quite, creates a spot for the working system to “mount” the secondary drive. Let’s create a mount level known as /information with the command:

Subsequent, change the possession of the brand new listing to your consumer with the command:

sudo chown -R $USER:$USER /information

The -R choice makes certain all baby folders have the identical possession.

The /and so forth/fstab is the file accountable for mapping the secondary drive to the mount level. 

Additionally: 8 issues you are able to do with Linux that you may’t do with MacOS or Home windows 

Assuming the title of your secondary drive is /dev/sdb, we’ll tack on a 1 to the top (as a result of /dev/sdb1 is the primary usable partition). Open the fstab file for enhancing with the command:

On the backside of that file, add an entry like this:

/dev/sdb1 /information    ext4    defaults        0       0

Here is a proof:

  • /dev/sdb1 — the secondary drive
  • /information — the mount level
  • ext4 — the secondary drive file system sort. If that is an NTFS drive, substitute with ntfs-3g
  • defaults — makes use of the default choices
  • 0 0 — these fields are for dump and fsck. Simply depart them each as zeros

Save and shut the file with Ctrl-X.

Testing the mount

All you could do to check the mount is concern the command:

Should you obtain no suggestions, all the things is sweet. Now you can reboot your machine and the secondary drive will likely be mechanically mounted so you may entry the information from /information.

Additionally: How to decide on the fitting Linux desktop distribution for you

Congratulations, you’ve got simply efficiently arrange a secondary drive automount on Linux.





Source link

Related articles

Hangzhou, house to DeepSeek and Alibaba, has grow to be a hub for Chinese language AI startups, with the suburb Liangzhu rising as a...

Featured Podcasts Lenny's Podcast: Solo founder, $80M exit, 6 months: The Base44 bootstrapped startup success story | Maor Shlomo Interviews with world-class product leaders and progress consultants to uncover actionable recommendation that will help you construct,...

Jack Dorsey Unveils Decentralized Bluetooth Mesh Community Bitchat

Block CEO and Twitter co-founder Jack Dorsey has launched the beta model of a brand new decentralized peer-to-peer messaging service that runs completely over Bluetooth. Jack Dorsey mentioned his weekend was spent studying about...

At the least 36 new tech unicorns had been minted in 2025 to date

With AI igniting an investor frenzy, each month, extra startups get hold of unicorn standing. Utilizing information from Crunchbase and PitchBook, TechCrunch tracked down the VC-backed startups that turned unicorns to date this yr....

Slippage & Unfold Shock: The Again-Check Killers No One Reveals You – My Buying and selling – 6 July 2025

Your EA wins 92 % of trades in Technique Tester… then a single reside place erases a complete month of revenue. The silent...

Perenco Vietnam indicators new manufacturing sharing contract for Block 15-1

Perenco Vietnam and its companions in Block 15-1 have signed a brand new Manufacturing Sharing Contract (PSC) with the Socialist Republic of Vietnam, marking the start of a brand new 25-year chapter for...
spot_img

Latest articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

WP2Social Auto Publish Powered By : XYZScripts.com