Mounting in Linux

tazmius

Junior Member
Dec 2, 2003
18
0
0
I'm mounting a 2nd hard drive and a Windows XP share on Fedora logged on with my user account. Both shares are mounting as read only though. Here's how I'm mounting them:
XP Share: mount -t smbfs -o username=xxx,password=xxx //xpshare/folder /mnt/xpshare
2nd hd : mount /dev/hdc1 /mnt/hd

I'm doing this through terminal as root because if I try to do it as myself it says I must be root.

I'm thinking the problem is that my user account doesn't have the correct rights because if I log on to the pc as root and do this, I can r/w to both mount points.

I have added myself to both root and wheel groups.....should I do something else??

Thanks for any and all suggestions!! This is driving me crazy!!!

Taz
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Generally only root has the ability to mount partitions. This is because mounting and umounting stuff can have disasterous results if you let users do it all willy-nilly.

I am not sure about the windows share but for the 2nd harddrive is easy.

You have to make a entry in your /etc/fstab file.
/etc/fstab is the configuration file that the OS uses to know which partition is which.

The the man file for details. (command is: man fstab)

add something like the line:
/dev/hdc1 /mnt/hd auto defaults,noauto,user 0 0

(normally the files have much bigger spaces between the words, but the forums remove extra spaces and squishes everything )

/dev/hda1 = your partition
/mnt/hd = the mount point
auto = the file system type. You can specify ntfs or vfat. Remember that linux can only do read ntfs for right now. Write ability is dangerous.
defaults.noauto,user = different options. Default means to use default options, noauto means that you don't want it mounted automaticly at bootup, and user lets any normal user to mount the partition (which will allow your normal user to mount partitions)

When using vfat the person who mounted it own it and all the files in it.


With /etc/fstab set up correctly all you have to do as a normal user is to go:
mount /mnt/hd

And that's it! You can do with same with cdroms and floppys if not already set up. Remember to use the "user" option if you want to let normal users mount that device.

I am also about 80-95% sure that it will work with SMB mounts, too.
Never done it myself, though.

Maybe it would be easier to try to make a mount directory in your home directory instead. Like:
mkdir /home/tazmius/xpshare
and then try

mount -t smbfs -o username=xxx,password=xxx //xpshare/folder /home/tazmius/xpshare


Remember the man files!
man fstab

Also make a backup of any config files you mess with, so that you can undo everything if you get loss or accidently delete half of the file or something.
 

tazmius

Junior Member
Dec 2, 2003
18
0
0
Got the hd mounted with full rights now. Thanks. Still working on the XP share..not having as much luck....
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Use 'smbmount' to mount the share as your user account, as long as the smbmnt executable is setuid root (I believe it is by default) any user can mount smb shares to directories he owns.

umask can be used to adjust the rights on filesystems that lack access controls, read 'man mount' for a pretty complete list of mount options for available filesystems in Linux.
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
You have to goto the WinXP box and click on 'Allow other people to modify my files..." or something like that. Its on the dialog where you enabled the sharing.
 

silverpig

Lifer
Jul 29, 2001
27,709
11
81
Originally posted by: tazmius
Originally posted by: silverpig
Try adding a umask line to your /etc/fstab

What does umask do?

It basically just sets permissions like chmod does. Adding a umask=xxxx line in your fstab basically is the same as mount && chmod
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
It basically just sets permissions like chmod does. Adding a umask=xxxx line in your fstab basically is the same as mount && chmod

Except:

A) umask is backwards, it's the permissions to remove
B) it affects the entire partition, since FAT has no access controls Linux has to emulate them and the uid,gid and umask options let you control how it's emulated.

The 'mount' man page details all the options available.
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
I always just used the "user" option in /etc/fstab for Fat partitions.

Since FAT can't handle posix stuff then "user" sets the defualt behavior were whoever mounted the filesystem automaticly becomes owner of all the files on that filing system.

At least I'm pretty sure thats how it works. Otherwise you would have to become su just to transfer files to a fat partition.
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |