LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 03-01-2007, 09:41 AM   #1
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Rep: Reputation: 77
Adding a USB External Drive?


I have a USB external drive that I would like to keep mounted and attached to my Linux box. I think I formated it correctly using FDISK as ext3 however I don't know how I properly mount it to my system was read/write and how this would like properly in /etc/fstab.

Does anyone mind assisting me or providing information that will help me add/mount my USB drive as a writable partition?

Here is what parted shows for drive info:

Screenshot

Here is how my current /etc/fstab is configured:

# This file is edited by fstab-sync - see 'man fstab-sync' for details
LABEL=/ / ext3 defaults 1 1
LABEL=/boot1 /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /dev/shm tmpfs defaults 0 0
LABEL=/home1 /home ext3 defaults 1 2
none /proc proc defaults 0 0
none /sys sysfs defaults 0 0
LABEL=/usr /usr ext3 defaults 1 2
LABEL=/var /var ext3 defaults 1 2
LABEL=SWAP-sda6 swap swap defaults 0 0
/dev/hda /media/cdrecorder auto pamconsole,fscontext=system_u:object_r:removable_t,exec,noauto,managed 0 0
/dev/fd0 /media/floppy auto pamconsole,fscontext=system_u:object_r:removable_t,exec,noauto,managed 0 0
/dev/sde1 /media/handy vfat pamconsole,fscontext=system_u:object_r:removable_t,exec,noauto,managed 0 0


/dev/sde1 is a USB drive I use for music and not the drive in question but I would want the new USB drive to work just like /media/handy. When I plug it in, it auto mounts and I can read and write anything I want to it assuming it has enough capacity.
 
Old 03-01-2007, 11:36 AM   #2
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,987

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
Edit this line:

dev/sde1 /media/handy vfat pamconsole,fscontext=system_ubject_r:removable_t,exec,noauto,managed 0 0

to this:

/dev/sde1 /media/handy ext3 noauto,user,defaults 0 0

You can make the mount point anything you want instead of /media/handy. Actually, check /media and make sure the "handy" directory is there; it may be dynamically generated by udev/pamconsole and removed when you disconnect the drive. If that's the case, just create /media/handy:

# mkdir /media/handy

or use whatever other name you want for the mount point.

The above entry is set to have sde1 not automount on boot(noauto option) but ordinary users can mount the drive, i.e. you don't have to be root(user option). If you want to automount the drive on boot, just delete the noauto and user option from the line. However, if you do that, you will have to have the drive connected and on at boot time or the system may not boot.

Finally, to set the permissions on sde1 giving all users rwx, mount sde1 and run as root:

# chmod -R 777 /media/handy

The above command must be run with sde1 mounted or it won't work.
 
Old 03-01-2007, 01:29 PM   #3
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Original Poster
Rep: Reputation: 77
Thanks - I will follow what you noted above however I think I did not explain that I am not wanting to replace /dev/sde1 which mounts to /media/handy. That was only an example of a working portable usb drive I have. I am wanting to add another drive which I showed you in qtparted and it shows up on my dmesg as "/dev/sdc1" however I think I can follow that info and rather than replace, just add to fstab.
 
Old 03-01-2007, 02:06 PM   #4
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Original Poster
Rep: Reputation: 77
OK - here is now what I have...

Code:
[root@cwilliams usbdisk]# ls
files  linux_commands.txt  lost+found  serverlist.xls
[root@cwilliams usbdisk]# pwd
/media/usbdisk
[root@cwilliams usbdisk]# cat /etc/fstab
# This file is edited by fstab-sync - see 'man fstab-sync' for details
LABEL=/ / ext3 defaults 1 1
LABEL=/boot1 /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /dev/shm tmpfs defaults 0 0
LABEL=/home1 /home ext3 defaults 1 2
none /proc proc defaults 0 0
none /sys sysfs defaults 0 0
LABEL=/usr /usr ext3 defaults 1 2
LABEL=/var /var ext3 defaults 1 2
LABEL=SWAP-sda6 swap swap defaults 0 0
/dev/hda /media/cdrecorder auto pamconsole,fscontext=system_u:object_r:removable_t,exec,noauto,managed 0 0
/dev/fd0 /media/floppy auto pamconsole,fscontext=system_u:object_r:removable_t,exec,noauto,managed 0 0
/dev/sde1 /media/USBDRIVE vfat pamconsole,fscontext=system_u:object_r:removable_t,exec,noauto,managed 0 0
/dev/sdc1 /media/usbdisk ext3 pamconsole,fscontext=system_u:object_r:removable_t,exec,noauto,managed 0 0


Now my last question is that it auto mounts the drive as /media/USBDRIVE and /media/usbdisk and I was wondering how I would edit that to read /media/<whatever>?

Last edited by carlosinfl; 03-01-2007 at 02:15 PM.
 
  


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
Problems adding write privileges to my External USB Drive SibLiant Linux - Newbie 1 01-03-2007 01:12 PM
Problems adding write privileges to my External USB Drive SibLiant Linux - Newbie 2 12-30-2006 02:55 PM
Mounting USB external drive with multiple partitions, USB bluetooth mouse xmeson Slackware 7 12-17-2006 09:00 AM
external enclosure for an internal hard drive vs external USB hard drive powah Linux - Hardware 1 03-10-2006 09:03 AM
XS Drive II external USB hard drive/card reader max74 Linux - Hardware 7 10-21-2003 10:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 05:29 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