LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   External hard drive, how do I mount it? (http://www.linuxquestions.org/questions/slackware-14/external-hard-drive-how-do-i-mount-it-747849/)

trainee 08-15-2009 09:23 PM

External hard drive, how do I mount it?
 
This is a newbie question, but I have to ask here cause I have never had a chance to touch an external hard drive before.

I've just got an external hard drive, brand new (never plugged in any Windows machine). How should I mount it? Do I treat it like any USB stick or do I have to add something to the file /etc/fstab to mount it?

Thanks

micxz 08-15-2009 09:52 PM

Plug it in. Watch dmesg to get the device name then you can format it or try to mount it right off. Once you get it mounted the way you like add an entry to fstab then you can mount it easier in the future.

trainee 08-15-2009 10:04 PM

Thank you.

Ilgar 08-16-2009 02:15 AM

File managers using HAL should be able to mount it without using fstab. For example Thunar (of XFCE) will do that, the device should get mounted under /media (this should work on Slack 12.2).

rob.rice 08-16-2009 02:28 AM

do a "cat /etc/mtab"
from slackware-12.2 that I know of running KDE-3.5 just plug it in and IF it has a file system slackware understands watch the magic happen
then do a "cat /etc/mtab" and make note of where /dev/??? is the hard drive will be auto mounted to /media/something

dugan 08-16-2009 02:33 AM

You can also use fdisk -l (as root) to see what the device node is.

/dev/me 08-16-2009 05:25 AM

Quote:

Originally Posted by trainee
How should I mount it? Do I treat it like any USB stick or do I have to add something to the file /etc/fstab to mount it?

Yeah, treat it like a USB stick. It acts the same when it comes to mounting. Adding things to fstab isn't really necessary. It makes life easier, that's true.

When you plug it in a Windows machine, you'll notice Windows puts system files, directories and executables on the device. Windows hides these, but *nix doesn't.

allend 08-16-2009 08:02 AM

Just one thing to watch for based on recent experience with a USB connected external hard drive. This drive was pre-formatted with the NTFS file system, so to write to it requires mounting with the ntfs-3g file system.

vonbiber 08-16-2009 08:22 AM

Quote:

Originally Posted by trainee (Post 3644874)
This is a newbie question, but I have to ask here cause I have never had a chance to touch an external hard drive before.

I've just got an external hard drive, brand new (never plugged in any Windows machine). How should I mount it? Do I treat it like any USB stick or do I have to add something to the file /etc/fstab to mount it?

Thanks

To mount it, it must be already formatted (vfat, ntfs, ...)
Assuming it's formatted

1. find out the device name by typing in a console
cat /proc/partitions

for instance in my machine I get this
cat /proc/partitions
major minor #blocks name

8 0 312571224 sda
8 1 73400953 sda1
.....
8 9 13607023 sda9

Here I don't have an external usb disk plugged in. But if I had
I should see something like

.... .... sdb
.... .... sdb1
.... ............

as you see the last column tells you the device name and
the partition name (in my case if I wanted to mount the first
partition of the first external hard drive
I would use /dev/sdb1 as the partition name)

so, assuming it's ntfs-formatted and I want to mount it read and write
I'll do this (as root)

mkdir -p /mnt/sdb1; ntfs-3g /dev/sdb1 /mnt/sdb1

(mkdir -p /mnt/sdb1 is for just in case /mnt/sdb1 doesn't exist)

if it's vfat-formatted

mount /dev/sdb1 /mnt/sdb1

would mount it read and write

Satchel 08-18-2009 06:08 PM

I am a newbie newbie, only working on Linux for about a week. Anyway, I have been using an external hard drive to transfer data from my Windows computer to my Linux one, since the Linux isn't connected to a network. This hasn't been a problem so far and I haven't had to mount it or anything. I have just been able to copy and paste files from it. Until today. Gah! There is one file on the drive I didn't think I needed but realized today I did, but when I connected the drive to the Linux computer, the drive comes up in the 'Computer' folder, but I can't open it anymore. What is up? I keep checking my permissions but it looks okay. What is the difference?

Nille_kungen 08-18-2009 06:21 PM

Satchel try to mount it manually from an terminal and see if you get any errors also check dmesg for errors.
What filesystem is it on the drive and have you unmounted the drive before you unplug it?

onebuck 08-18-2009 07:36 PM

Hi,

Welcome to LQ!

Quote:

Originally Posted by Satchel (Post 3648660)
I am a newbie newbie, only working on Linux for about a week. Anyway, I have been using an external hard drive to transfer data from my Windows computer to my Linux one, since the Linux isn't connected to a network. This hasn't been a problem so far and I haven't had to mount it or anything. I have just been able to copy and paste files from it. Until today. Gah! There is one file on the drive I didn't think I needed but realized today I did, but when I connected the drive to the Linux computer, the drive comes up in the 'Computer' folder, but I can't open it anymore. What is up? I keep checking my permissions but it looks okay. What is the difference?

It would have been better to create a new thread with your problem rather then hi-jack this one.

Whenever you post a query please try to provide information that will aid the helper to diagnose your problem.

As 'Nille_kungen' posted for some information. I would add; distribution, kernel in use and what did you mean by;

Quote:

This hasn't been a problem so far and I haven't had to mount it or anything. I have just been able to copy and paste files from it.
How did you copy the information when the 'Linux' was up? 'dd' ? Or did you allow the OS to detect via udev&HAL mount. Then do your copy?

I suspect a filesystem corruption on the external hdd.

TSquaredF 08-19-2009 11:38 AM

I have just found halrv. In CLI or WMs that do not mount media for you, it it does a fine job. It even includes a SlackBuild.
Regards,
Bill


All times are GMT -5. The time now is 11:06 PM.