LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 03-31-2010, 01:22 PM   #1
d3adpoetic
LQ Newbie
 
Registered: Mar 2010
Posts: 19

Rep: Reputation: 0
Binding USB drive to specific folder


Is it possible to bind a USB drive formatted in NTFS to a specific folder so when i open that folder i see the contents of the drive?

Im using Fedora 12.

Thanks.
 
Old 03-31-2010, 01:57 PM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Do you mean "is it possible to automount an NTFS file system on a USB device on a particular directory"?

If so then the answer is almost certainly "yes".

Which distro are you using, including the version?
 
Old 03-31-2010, 02:24 PM   #3
jkzfixme
Member
 
Registered: Sep 2006
Location: Orange County, NY
Distribution: Ubuntu, Solaris, Android
Posts: 329
Blog Entries: 21

Rep: Reputation: 52
you would mount the sub hard drive or thumb drive as such

Quote:
mkdir /mnt/usbdrive
mount /dev/sda1 /mnt/usbdrive
You would then want to automount by adding the following to your /etc/fstab

Quote:
/dev/sda1 /mnt/usbdrive ntfs defaults 0 0
BTW you can edit the usbdrive variable to anything you would like

Regards,
JKZfixme

Last edited by jkzfixme; 03-31-2010 at 02:27 PM.
 
Old 03-31-2010, 03:33 PM   #4
d3adpoetic
LQ Newbie
 
Registered: Mar 2010
Posts: 19

Original Poster
Rep: Reputation: 0
Thanks for the replies. I'll try when i have the time to sit and concentrate on it.

Does it have to be set to /mnt/usbdrive or can it be a folder in my home dir? (ex. /home/user/USB_Drive)

What if i wanted more than one usb hard drive connected? They would be mounted to different folders, but would they be /dev/sda1 and /dev/sda2? Seems like a dumb question, but just making sure.
 
Old 03-31-2010, 04:45 PM   #5
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,330

Rep: Reputation: 227Reputation: 227Reputation: 227
Use mount.
Type man mount for syntax info.
Or in simple terms mount /dev/sda1 /<directory>.
It will be sda2 if you have a sata harddrive.
 
Old 03-31-2010, 05:16 PM   #6
d3adpoetic
LQ Newbie
 
Registered: Mar 2010
Posts: 19

Original Poster
Rep: Reputation: 0
I do have a sata drive, but it's my main internal drive. My question is if my first external usb drive is /dev/sda1, what would a second one be if i connected it?
 
Old 03-31-2010, 05:47 PM   #7
jefro
Moderator
 
Registered: Mar 2008
Posts: 15,383

Rep: Reputation: 2199Reputation: 2199Reputation: 2199Reputation: 2199Reputation: 2199Reputation: 2199Reputation: 2199Reputation: 2199Reputation: 2199Reputation: 2199Reputation: 2199
You have to be careful on the naming of removable devices. It could be that the order might change due to how they are connected in back or order of connection. It would most likely be sdb1.
 
Old 04-01-2010, 12:02 AM   #8
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Quote:
Originally Posted by d3adpoetic View Post
I do have a sata drive, but it's my main internal drive. My question is if my first external usb drive is /dev/sda1, what would a second one be if i connected it?
  1. Using /dev/sda1 as an exaample
  2. "sd" denotes SCSI disk but the SCSI is meaningless because so many disk types are treated as virtual SCSI disks.
  3. "a" denotes the first one. Subsequent ones would be "b", ""c, "d" ...
  4. "1" denotes the first primary partition on the disk. Logical partitions are 5 and upwards.
Thus your internal drive should be /dev/sda and your externals should be /dev/sdb, sdc, sdd in the order they are plugged in.
 
Old 04-01-2010, 12:05 AM   #9
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Quote:
Originally Posted by d3adpoetic View Post
Does it have to be set to /mnt/usbdrive or can it be a folder in my home dir? (ex. /home/user/USB_Drive)

What if i wanted more than one usb hard drive connected? They would be mounted to different folders, but would they be /dev/sda1 and /dev/sda2? Seems like a dumb question, but just making sure.
You can use any directory (= folder) as a mount point.

If each external drive had only one partition then those partitions would be /dev/sdb1, /dev/sdc1, /dev/sdd1 ...
 
Old 04-01-2010, 12:07 AM   #10
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Quote:
Originally Posted by catkin View Post
Do you mean "is it possible to automount an NTFS file system on a USB device on a particular directory"?

Which distro are you using, including the version?
Do you want these file systems on external drives automatically mounted or are you OK with running the mount commands manually?
 
Old 04-01-2010, 07:39 AM   #11
d3adpoetic
LQ Newbie
 
Registered: Mar 2010
Posts: 19

Original Poster
Rep: Reputation: 0
thanks for all the replies.

automount would be good, jkzfixme gave the instructions on how to do that earlier. still havent given this a try, havent had time... ill try to get on it tonight though.
 
Old 04-01-2010, 09:22 AM   #12
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,331
Blog Entries: 55

Rep: Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530Reputation: 3530
...and wrt naming of (removable) devices have a look at /dev/disk/by-*. As long as partitions on the device have unique names there shouldn't be any problems referencing them in /etc/fstab, HAL scripts or anywhere else.
 
Old 04-02-2010, 07:35 AM   #13
jkzfixme
Member
 
Registered: Sep 2006
Location: Orange County, NY
Distribution: Ubuntu, Solaris, Android
Posts: 329
Blog Entries: 21

Rep: Reputation: 52
as to listing available usb devices you might want to check out lsusb
 
  


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
Way to make autofs mount to specific USB flash drive to specific folder? utahnix Linux - Software 2 11-24-2010 06:27 PM
Usb drive, how to locate it, how to move folder from Usb drive to usr directory eeguy02 Linux - Newbie 5 03-01-2010 12:23 AM
problem with specific USB drive in new distributions seedsgrow Linux - Hardware 10 02-09-2009 09:57 PM
binding to one specific IP polemon Linux - Networking 3 04-13-2008 05:04 PM
Q: Binding applications to a specific cpu Lazy Linux - Software 1 03-02-2006 08:42 AM


All times are GMT -5. The time now is 12:41 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration