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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
02-22-2017, 02:07 PM
|
#1
|
LQ Newbie
Registered: Feb 2017
Posts: 1
Rep:
|
How to mount an external drive to linux computer?
Hi,
How to mount an external drive to linux computer?
zhen
Yale University
|
|
|
02-22-2017, 02:11 PM
|
#2
|
LQ 5k Club
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,299
|
|
|
|
02-22-2017, 02:42 PM
|
#3
|
LQ Guru
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342
|
Code:
su
passwd
mount /dev/sdx /mnt
Quote:
mount /source /destination
|
|
|
|
02-22-2017, 03:17 PM
|
#4
|
Senior Member
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,209
|
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.
|
|
|
02-22-2017, 03:31 PM
|
#5
|
Member
Registered: May 2007
Posts: 123
Rep:
|
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.
|
|
|
02-22-2017, 05:00 PM
|
#6
|
Moderator
Registered: Mar 2008
Posts: 22,130
|
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.
|
|
|
02-22-2017, 05:04 PM
|
#7
|
LQ Guru
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,861
|
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.
|
|
|
02-22-2017, 10:35 PM
|
#8
|
Senior Member
Registered: Feb 2003
Distribution: debian
Posts: 4,137
|
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.
|
|
|
All times are GMT -5. The time now is 06:01 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|