LinuxQuestions.org
Visit Jeremy's Blog.
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-27-2004, 05:57 AM   #1
ArthurDent
Member
 
Registered: Feb 2004
Location: London
Distribution: Fedora Core 5, Mandrake 10.0, Gentoo, Suse
Posts: 179

Rep: Reputation: 30
Accessing MSDOS files from Linux


Hi All,

I have a dual-boot Win98 / RedHat Fedora Core Linux system.

I am able to access the files on the Win98 partiton (separate HD actually) by adding the following line to my /etc/fstab file:

/dev/hda1 /mnt/msdos vfat defaults 0 3

I have no idea whether or not this is the approved way of doing things - but it works... Well kind of. The problem is that while I can access the files I can only write to them when logged in as root.

If I look at the permissions I see the following:

[mark@localhost mark]$ ls -l /mnt
total 24
drwxr-xr-x 2 root root 4096 Mar 27 10:01 cdrom
drwxr-xr-x 2 root root 4096 Mar 11 21:08 floppy
drwxr-xr-x 12 root root 16384 Jan 1 1970 msdos

Attempting to change permissions (even as root) I get :

[root@localhost mnt]# chgrp super msdos
chgrp: changing group of `msdos': Operation not permitted

(super is a group I created with my user account as a member)

or

[root@localhost mnt]# chmod g=rwx msdos
chmod: changing permissions of `msdos' (requested: 0775, actual: 0755): Operation not permitted


How do I set things up so that I can read, *write", and execute files on my MSDOS disk from a user account in Linux - but only the user account I specify?

Hoping you can help....

Many thanks and best regards

Mark
 
Old 03-27-2004, 06:51 AM   #2
tk31337
Member
 
Registered: Oct 2003
Location: Tucson, AZ
Distribution: Linux Mint
Posts: 194

Rep: Reputation: 32
Smile

I think you're looking for the "user" option, which will allow your FAT partition to be user-mountable (perms default to whatever user mounted the partition). You might also try out "users", although it's not as secure. If you have your partition setup to be mounted at boot, it should end up being mounted by root. Without using the "users" option, you can use "rw" to allow the partition to be mounted with read/write perms for everyone.

Here's an example fstab entry:
/dev/hda1 /fat vfat user,rw,exec 0 0

I'd suggest checking out "man fstab" (or "man:/fstab" if you have Konqueror), as well as "man mount". If you have a user-friendly distro (i.e Mandrake), I'd also recommend configuring your partitions through its configuration utility. A great distro-independent config util is "linuxconf". It configures /etc/fstab among other things.
 
Old 03-27-2004, 06:52 AM   #3
SciYro
Senior Member
 
Registered: Oct 2003
Location: hopefully not here
Distribution: Gentoo
Posts: 2,038

Rep: Reputation: 51
try
chown mememe:msdos /mnt/msdos
chmod 1770 /mnt/msdos
or
chmod 770 /mnt/msdos
(the 1 only tell it to set the archive bit, something i like to do just for fun, 0770 is normally what most distros would take)

the chown changes the user and group to some other user (make it whatever you want) and the group to msdos (like you said to do)
also you can try
chown :msdos /mnt/msdos
instead, this doesn't change the user, but changes the group owner, try whatever you want

ill assume you know what the chmod command does if not:
770 = the owner of the file gets full access, the group gets full access, and everyone else gets nothing!

Last edited by SciYro; 03-27-2004 at 06:54 AM.
 
Old 03-27-2004, 07:54 AM   #4
darkRoom
Member
 
Registered: Mar 2004
Location: Valencia, espaņa
Distribution: Slack, Gentoo, Custom
Posts: 162

Rep: Reputation: 30
Chmod or related utilities won't work on an already mounted filesystem. Hence use

umount /mnt/msdos

and then apply the suggested changes with chmod/chgrp etc and remount the filesystem.
 
Old 03-27-2004, 09:29 AM   #5
ArthurDent
Member
 
Registered: Feb 2004
Location: London
Distribution: Fedora Core 5, Mandrake 10.0, Gentoo, Suse
Posts: 179

Original Poster
Rep: Reputation: 30
OK guys, you're going to have to go easy on me because I am still a little wet behind the ears when it comes to Linux...

I tried umount and then changing the permissions and it worked!

The trouble is, as soon as I reboot it all gets set back to how it was.

I tried changing the entry in /etc/fstab in a variety of different ways but it always seems to end up as owner=root, group=root when I do ls -l.

Essentially what I want to achieve is this:
The MSDOS drive is mounted at boot-up;
Anyone can have read access to anything in that drive;
Anyone in group "super" can have rwx access;
I have root + my user account in group "super".

What exactly to I have to put into /etc/fstab to achieve this - or is what I am trying to do not possible?

Many Thanks

Mark
 
Old 03-27-2004, 12:18 PM   #6
ArthurDent
Member
 
Registered: Feb 2004
Location: London
Distribution: Fedora Core 5, Mandrake 10.0, Gentoo, Suse
Posts: 179

Original Poster
Rep: Reputation: 30
Quote:
Originally posted by ArthurDent
.... and it worked!
Erm... actually I think it only worked because I was, Ahem, logged in as root... Sorry, I got confused with all the switching back and forth.

It seems that if I umount the dive I can change the permissions of /mnt/msdos, but the act of re-mounting the drive, either manually or by fstab at re-boot, resets the permissions back to root...

Can anyone think of a way of doing waht I want to do?

All the best

Mark
 
Old 03-30-2004, 09:07 AM   #7
SciYro
Senior Member
 
Registered: Oct 2003
Location: hopefully not here
Distribution: Gentoo
Posts: 2,038

Rep: Reputation: 51
ok, it looks like your distro has some weird startup procedure that resets everything then (or did you do a proper shutdown?..lol), so look at the boot scripts in /etc/rc.d (or wherever your distro puts them), and search thru all the files files for the use the "chmod" command
 
  


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
accessing windows files from linux... kb_ganesh Linux - Newbie 2 06-24-2005 04:27 AM
Accessing Linux files from Windows gljubuncic Linux - Software 3 05-14-2005 09:14 PM
accessing linux files from windows shahrahulb Linux - Software 6 09-28-2003 09:27 AM
Accessing files- from both XP and Linux r_jensen11 Linux - Networking 1 09-13-2003 02:22 PM
Accessing windows files from Linux nvalid Linux - General 3 12-17-2002 03:35 AM


All times are GMT -5. The time now is 04:00 AM.

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