LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   mounting usb hard drive (https://www.linuxquestions.org/questions/linux-newbie-8/mounting-usb-hard-drive-445998/)

brianhall 05-18-2006 04:47 AM

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

jschiwal 05-18-2006 05:46 AM

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.

drkstr 05-18-2006 11:10 AM

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

brianhall 05-18-2006 12:09 PM

Thanks alot buddy that worked great...
Brian


All times are GMT -5. The time now is 10:14 AM.