LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-21-2005, 08:58 AM   #1
aje
Member
 
Registered: Oct 2004
Location: Internet
Distribution: Slackware 10.1
Posts: 177

Rep: Reputation: 30
Mounting USB NTFS drive.


I'm sorry for the ignorance of this question but I have absolutely no Idea where to start with this ...

I want to mount a USB drive I have. It is an NTFS partition. Where should I look to?
 
Old 03-21-2005, 09:51 AM   #2
Namaseit
Member
 
Registered: Dec 2003
Distribution: Slackware
Posts: 325

Rep: Reputation: 30
You mean how to mount it?

Well typing the command 'dmesg' in a console will tell you wether the device has been recognized properly.
Then you can do 'mount /dev/sda<partition#> /mnt/hd'

so something like 'mount /dev/sda1 /mnt/hd'

but that's assuming you have ntfs filesystem support compiled into you kernel. If you're using the default kernel 2.4.29 or whatever it is then I believe it should be in there.
 
Old 03-21-2005, 03:25 PM   #3
aje
Member
 
Registered: Oct 2004
Location: Internet
Distribution: Slackware 10.1
Posts: 177

Original Poster
Rep: Reputation: 30
Thank you very much.

Do I need to edit my /etc/fstab to access the drive as a regular user and not root?
 
Old 03-21-2005, 03:28 PM   #4
Namaseit
Member
 
Registered: Dec 2003
Distribution: Slackware
Posts: 325

Rep: Reputation: 30
I shouldn't think so.
 
Old 03-21-2005, 06:38 PM   #5
aje
Member
 
Registered: Oct 2004
Location: Internet
Distribution: Slackware 10.1
Posts: 177

Original Poster
Rep: Reputation: 30
Then how would I go about doing so? Your directions worked perfectly for root and i copied them exactly. The same does not apply to my regular user account.
 
Old 03-21-2005, 07:31 PM   #6
Namaseit
Member
 
Registered: Dec 2003
Distribution: Slackware
Posts: 325

Rep: Reputation: 30
I suppose then you should edit your fstab and allow all users to access it that way.
 
Old 03-21-2005, 10:10 PM   #7
MMYoung
Member
 
Registered: Apr 2004
Location: Arkansas
Distribution: Ubuntu 8.10
Posts: 365

Rep: Reputation: 30
I hope you're not going to be writting to the NTFS drive. Writing to NTFS is a hit and miss proposition in Linux, and it's mostly MISS. The ONLY type of write access to NTFS, via the standard kernel options, is overwritting of the same file as long as it is also the SAME FILE LENGTH/SIZE.

From the kernel "help" file:
Quote:
The only supported operation is overwriting existing files, without changing the file length. No file or directory creation, deletion or renaming is possible. Note only non-resident files can be written to so you may find that some very small files (<500 bytes or so) cannot be written to.
I don't even enable it in my kernel configs for now. You're best bet, IMHO, would be to back up the files that are on the drive and format it to FAT32 and use it that way.

Just my opinion,
MMYoung
 
Old 03-21-2005, 11:28 PM   #8
aje
Member
 
Registered: Oct 2004
Location: Internet
Distribution: Slackware 10.1
Posts: 177

Original Poster
Rep: Reputation: 30
I don't plan on trying to write to this drive, I just want to be able to read it as a user. I already learned my lesson when I fried my 76 gigs of unreplaceable data that was more important to me than I can describe by accidentally adding it to my fstab as rw.
 
Old 03-21-2005, 11:35 PM   #9
MMYoung
Member
 
Registered: Apr 2004
Location: Arkansas
Distribution: Ubuntu 8.10
Posts: 365

Rep: Reputation: 30
Quote:
Originally posted by aje
I don't plan on trying to write to this drive, I just want to be able to read it as a user. I already learned my lesson when I fried my 76 gigs of unreplaceable data that was more important to me than I can describe by accidentally adding it to my fstab as rw.
Then all you have to do is add something like this to your /etc/fstab and you should be good to go.
Code:
/dev/sda1 /mnt/ntfs ntfs noauto,users,ro 0 0
That way it's only mounted when you want it mounted (noauto), any user can mout/unmount it (users), and it will only be mounted as read-only (ro). This is assuming that the /dev node is sda1 and you can call the directory in /mnt anything you want.

But then maybe you've already figured this one out.

HTH,
MMYoung
 
Old 03-21-2005, 11:48 PM   #10
aje
Member
 
Registered: Oct 2004
Location: Internet
Distribution: Slackware 10.1
Posts: 177

Original Poster
Rep: Reputation: 30
When I try to mount it using "mount /dev/sda1 /mnt/drive" I get the message "only root can do that". When I run this as root, I get "mount point /mnt/drive does not exist".

What may be the cause of my error?
 
Old 03-22-2005, 05:41 AM   #11
MMYoung
Member
 
Registered: Apr 2004
Location: Arkansas
Distribution: Ubuntu 8.10
Posts: 365

Rep: Reputation: 30
Quote:
Originally posted by aje
When I try to mount it using "mount /dev/sda1 /mnt/drive" I get the message "only root can do that".
That's because only root can mount a filesystem on a device node, just like the error message states.
Quote:
Originally posted by aje
When I run this as root, I get "mount point /mnt/drive does not exist".
It's obvious that you did not create the mount point "/mnt/drive".
Log in as root and create the mount point by:
Code:
mkdir /mnt/drive
drive can be anything that you want it to be, up to you.

Next make sure you have a line for it in your /etc/fstab similar to the one that I posted above. If it ain't there, again as root, edit the file and add it, making sure of the /dev node for the device.

Now log out as root and mount the filesystem by:
Code:
mount /mnt/drive
Don't put the /dev node in the mount command and you *should* be able to mount the filesystem.

For example, I have an external USB hard drive. It is recognised by the system as /dev/sda1 (for Slackware /dev/sda is pretty much the norm) and I have a udev rule written so that a symlink is created in /dev called usbhd1 pointing to sda1. I also have an entry for it in my fstab:
Code:
/dev/usbhd1 /mnt/xhd vfat noauto,users,rw 0 0
Now when I want to mount it all I have to do is type in:
Code:
mount /mnt/xhd
HTH,
MMYoung
 
Old 03-22-2005, 06:01 AM   #12
MMYoung
Member
 
Registered: Apr 2004
Location: Arkansas
Distribution: Ubuntu 8.10
Posts: 365

Rep: Reputation: 30
Thought I would give the above suggestions a try on my PC, as I have a NTFS partition on my first HD for Windows XP. So I opened a terminal, logged in as root, and added the following to my fstab:
Code:
/dev/hda1 /mnt/win_c noauto,users,ro 1 0
Then I created the directory
Code:
mkdir /mnt/win_c
Logged out as root and mounted the filesystem as a user:
Code:
mount /mnt/win_c
An icon for win_c "popped" up on my desktop, I clicked on it and was told that I did not have "permission" to view the files on that mount point. In the terminal I typed in:
Code:
dir /mnt/win_c
Message "Permission Denied".

It's an NTFS thing, IMHO, which is why I don't use it in Linux.

Later,
MMYoung
 
Old 03-22-2005, 06:18 PM   #13
aje
Member
 
Registered: Oct 2004
Location: Internet
Distribution: Slackware 10.1
Posts: 177

Original Poster
Rep: Reputation: 30
Thanks a lot for your help
 
Old 03-23-2005, 03:51 AM   #14
MMYoung
Member
 
Registered: Apr 2004
Location: Arkansas
Distribution: Ubuntu 8.10
Posts: 365

Rep: Reputation: 30
I just found out what will let you read that drive (I believe anyway). In your fstab add umask=000 to it like so:
noauto,users,umask=000,ro

I just added it to my fstab and now I have permission to read the files on that partition.

Later,
MMYoung
 
  


Reply



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
mounting usb pen drive; ntfs problem ShamitSoneji Fedora 20 12-01-2004 02:19 AM
slackware 9.1 mounting problems (cd drive, cd writer drive, win partition (ntfs)) mr.gizm0 Slackware 8 05-11-2004 06:23 PM
Mounting an NTFS drive e_cubed99 Linux - Newbie 11 11-01-2003 02:05 PM
Mounting a ntfs drive? mpooley Linux - Hardware 12 12-11-2002 12:32 AM
mounting ntfs(xp) drive elpresidente Linux - Hardware 7 07-01-2002 09:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:44 AM.

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