LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-22-2017, 02:07 PM   #1
zhuangyale
LQ Newbie
 
Registered: Feb 2017
Posts: 1

Rep: Reputation: Disabled
How to mount an external drive to linux computer?


Hi,

How to mount an external drive to linux computer?

zhen
Yale University
 
Old 02-22-2017, 02:11 PM   #2
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 14.1, 14.2, current, slackware-arm-currnet
Posts: 5,763

Rep: Reputation: 705Reputation: 705Reputation: 705Reputation: 705Reputation: 705Reputation: 705Reputation: 705
Welcome to the forum.

See this link. -->https://www.cyberciti.biz/faq/mount-...-ubuntu-linux/
 
Old 02-22-2017, 02:42 PM   #3
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (current), FreeBSD, Win10, It varies
Posts: 9,952

Rep: Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148
Code:
su
passwd
mount /dev/sdx /mnt
Quote:
mount /source /destination
 
Old 02-22-2017, 03:17 PM   #4
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora 33
Posts: 3,573

Rep: Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006
Usually the tricky part is figuring out the name of the block device you want to mount. Especially when you have multiple hard drives. The easiest command is "lsblk" which will list all the drives and partitions.
 
Old 02-22-2017, 03:31 PM   #5
stanvan
Member
 
Registered: May 2007
Posts: 123

Rep: Reputation: 50
Plug it in. Wait a minute, and it will probably auto-mount. Or at least it will probably appear in your file manager so you can right-click on it, and choose mount.
 
Old 02-22-2017, 05:00 PM   #6
jefro
Moderator
 
Registered: Mar 2008
Posts: 20,847

Rep: Reputation: 3383Reputation: 3383Reputation: 3383Reputation: 3383Reputation: 3383Reputation: 3383Reputation: 3383Reputation: 3383Reputation: 3383Reputation: 3383Reputation: 3383
Hello and welcome to LQ.

Not really enough information to tell.
Some distributions of linux let users with enough permissions the ability to simply plug in. Some require you to use command line while others may be restricting users to this ability.

Knowing the distro and maybe user permissions may help us answer.
 
Old 02-22-2017, 05:04 PM   #7
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 9,148
Blog Entries: 4

Rep: Reputation: 3232Reputation: 3232Reputation: 3232Reputation: 3232Reputation: 3232Reputation: 3232Reputation: 3232Reputation: 3232Reputation: 3232Reputation: 3232Reputation: 3232
At the very least, the so-called hotplug system service ought to detect that "a USB/Firewire device has just been inserted," and it should probably also be able to realize that "it is 'a disk-drive of some sort,'" and therefore to present it to you as a "/dev/sdsomethingorother"" entry.

"Beyond that," methinks, "it's really up to you, now," because, from this point forward, you really need to start making some discretionary decisions. "The device has been recognized and made available to you, more-or-less automagically." (Woo, hoo!) Now, it's up to you to take over: to decide where you might wish to mount it within your system's file-system structure.

Mind you ... if you find that you can, indeed, predict where the disk will turn up in /dev, the next step might be very easy indeed: just add an entry to /etc/mtab. So that you can easily mount the drive into an agreed-upon location.

Last edited by sundialsvcs; 02-22-2017 at 05:09 PM.
 
Old 02-22-2017, 10:35 PM   #8
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873
Before plugging it in.

$ cat /proc/partitions

And after plugging it in.

$ cat /proc/partitions

The contents should change, the drive you need to mount is what changed. Probably in the output of dmesg as well. Assuming that autofs isn't a default for your distro, or overridden (defaults,noauto) in /etc/fstab. Otherwise mount, which requires root perms if the entry is not in /etc/fstab that allows a user to mount it.

$ sudo mount /dev/sdX /mnt/aspecialbutterfly

As hinted to previously by other(s).

$ mount /dev/sdX

If listed in /etc/fstab which helps fill in the blanks for a much shorter command. Or enjoy autofs which is default for a lot of non-minimal install methods for many distros.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] External hard drive for Linux o/s computer TKARANG Linux - Newbie 16 01-09-2016 07:21 AM
[SOLVED] mount Iomega external hard drive on debian squeeze, how to use mount command Foxbat1155 Linux - Hardware 15 02-21-2012 04:55 PM
Unable to mount USB external hard drive on Linux Lionlinux Linux - Newbie 15 09-30-2011 11:43 AM
udev rules to mount external hard drive at mount point akamikeym Gentoo 3 03-31-2010 01:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration