LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 05-18-2006, 04:47 AM   #1
brianhall
LQ Newbie
 
Registered: May 2006
Posts: 27

Rep: Reputation: 15
mounting usb hard drive


HI
I have a usb hard drive a got it to work using this command.

cd /mnt
mkdir sda1
chgrp users sda1
chmod g+rwx sda1 (this didnt work)
mount /dev/sda1 /mnt/sda1

This worked fine but when i reboot there is nothing in these folders, is this right if not how do i get it to mount the harddrive at bootup..

Many Thanks
Brian
 
Old 05-18-2006, 05:46 AM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 681Reputation: 681Reputation: 681Reputation: 681Reputation: 681Reputation: 681
If your distro supports hotplugging, the drive may be mounted when you plug in the USB cable.
Otherwise you need to add an entry in your /etc/fstab file.
The chown, chgrp and chmod commands do not work on fat32 partitions. You need to add options to mount to do the same thing on a per partition bases. For example, instead of running chown, use the "uid=" option. Instead of chmod, use either the "umask=" option or the "fmask=" and "dmask=" options.

See the "man mount" manpage for details. There is also an "fstab" man page.
 
Old 05-18-2006, 11:10 AM   #3
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Rep: Reputation: 45
as a starting point, try this in your /etc/fstab:
Code:
/dev/sda1  /mnt/sda1  vfat  users,defaults,umask=002  0  0
This would be for fat32 and would give the permissions -rwxrwxr-x to the files on the drive. Also, try doing 'chown <username>.users /mnt/sda1' prior to mounting the drive. This is the proper way to change ownership of the folder.

regards,
...drkstr
 
Old 05-18-2006, 12:09 PM   #4
brianhall
LQ Newbie
 
Registered: May 2006
Posts: 27

Original Poster
Rep: Reputation: 15
Thanks alot buddy that worked great...
Brian
 
  


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
Mounting usb hard-drive ewingnoah Fedora 2 02-09-2006 12:49 PM
Problem mounting USB hard drive kernelbuster Linux - Enterprise 0 02-14-2005 04:36 PM
Mounting USB Hard Drive in SuSE 9.1 Caboose447 SUSE / openSUSE 4 12-13-2004 10:39 AM
mounting usb hard drive frostedthorns Fedora 4 07-01-2004 10:51 PM
mounting a usb hard drive yocompia Slackware 5 10-19-2003 02:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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