Linux 101: What is the mount command and how do you use it?

Jack Wallen introduces new Linux users to the mount command and how to use it to mount an external drive to the internal file system.

linuxhero3.jpg

Image: Jack Wallen

Linux is capable of doing all sorts of amazing things, some of which no other operating system on the planet can do. 

It’s also capable of handling some very basic tasks. One such task is mounting file systems (such as external drives) to the filesystem. This is a crucial feature, otherwise, you wouldn’t be able to either expand your storage or attach external data drives. 

SEE: 5 Linux server distributions you should be using (TechRepublic Premium)

If you’re working with a distribution of Linux that includes a desktop GUI, adding external drives is pretty simple. But what if you’re using a GUI-less server? For that, you’ll need to make use of the mount command. Mount does exactly what you think it does, it mounts an external drive to your internal filesystem. 

But it’s not exactly that simple. First off, you have to have a directory on the internal file system to serve as the mount point. You can’t simply mount, say, /dev/sdb to the root file system. 

You could, however, create a new directory, say data with the command sudo mkdir /data. You would then want to make sure whatever user or group that would need to use the directory has access using the chown command (as in sudo chown -R :writers /data) and then give the group write access with the chmod command (as in sudo chmod -R g+w /data). 

SEE: Linux 101: How to execute commands from within the nano text editor (TechRepublic) 

Once you’ve done that, you have a mount point that can house the external drive. You then need to find out where the drive is located, which can be done with the command lsblk. Find the drive name associated with the disk and mount it with the command sudo mount NAME /data (Where NAME is the name associated with the drive, such as /dev/sdb). 

At this point, everything housed in your external drive will appear in /data. 

And that, my friends, is the basics for using the mount command. To find out more details on this helpful tool, make sure to read the man page with man mount. 

Subscribe to TechRepublic’s How To Make Tech Work on YouTube for all the latest tech advice for business pros from Jack Wallen.

Also see

Stay connected with us on social media platform for instant update click here to join our  Twitter, & Facebook

We are now on Telegram. Click here to join our channel (@TechiUpdate) and stay updated with the latest Technology headlines.

For all the latest Technology News Click Here 

 For the latest news and updates, follow us on Google News

Read original article here

Denial of responsibility! TechiLive.in is an automatic aggregator around the global media. All the content are available free on Internet. We have just arranged it in one platform for educational purpose only. In each content, the hyperlink to the primary source is specified. All trademarks belong to their rightful owners, all materials to their authors. If you are the owner of the content and do not want us to publish your materials on our website, please contact us by email – [email protected]. The content will be deleted within 24 hours.