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 11-25-2003, 06:21 PM   #1
class_struggle
Member
 
Registered: Nov 2003
Location: where rock meets hard place
Distribution: 1- Knoppix 2-Gentoo
Posts: 121

Rep: Reputation: 15
FAT32 write


Hi,

I've managed to mount a FAT32 in my two Linux (Redhat 7.2 and Knoppix 3.3), but haven't found a way to write to it yet.

In the beginning, I thought it might require another special MOUNT switch, but somewhere in MAN, it said that MOUNT's default is to try and make it writeable, if at all possible.

OK, I'm not too well acquainted with file attributes, who "owns" it and stuff, but I was wondering if someone could explain to me how to make a FAT32 writeable, at least for an ordinary text file. Obviously, I'd prefer to write all sorts of files to the FAT32 Partition, so any other advice on how other people manage this sort of operation would be very welcome.

Further to this, I'd like to know how to copy files over to a FAT32, using let's say Konqueror, as it hasn't quite worked for me yet.

Note that I did do a search for this topic, and didn't come up with much exception for some guy who wanted to write to NTFS (well known to be not-advisable), and was told to convert it all to FAT32, but the thread petered out with out explaining how to write to FAT32.

Thanks in advance/ CS.
 
Old 11-25-2003, 07:13 PM   #2
aaa
LQ Guru
 
Registered: Jul 2003
Location: VA
Distribution: Slack 10.1
Posts: 2,194

Rep: Reputation: 46
Regualar users may not be able to write to FAT32 until you include a certain option, 'umask=0'. Some man pages don't mention this, I like to search the 'Net for more detailed ones. Also take a look at 'man fstab'.
 
Old 11-26-2003, 05:03 AM   #3
class_struggle
Member
 
Registered: Nov 2003
Location: where rock meets hard place
Distribution: 1- Knoppix 2-Gentoo
Posts: 121

Original Poster
Rep: Reputation: 15
using "cp"

Thanks for the answer, aaa, maybe a bit on the brief side, but helpful nonetheless. OK, I'll check out use of umask and fstab.

In the meantime, I did try some experimentation, and something did come good: the use of the "cp" command from the command line in superuser mode. I include it here just in case other newbies find themselves in a similar situation.

I have FAT32 as hda1, and then Linux 7.2 as EXT3. From root console, and cd'ing to the directory where the files-to-copy are found, I simple type

cp *pdf /mnt/hda1.

This copies all the PDF files in my linux home directory (only) to the C: directory (as it's called in MSWindle). If you think about it, it's not a trivial task, hardcoding a file straight into a foreign filesystem like that.

Then you test, by leaving linux, getting back on to MSWindle, and seeing if you can read the files. As it happened, I could, so must now become the way I write to FAT32.

Now, I'm not sure if this is all conícidental, because the attributes on these files, just happened to be appropriate for the operation. I' also want to write copying a linux application file, (say kwrite) to FAT32 and back, to see if any corruption takes place.

/ cs.
 
Old 11-26-2003, 08:20 AM   #4
yapp
Member
 
Registered: Apr 2003
Location: Netherlands
Distribution: SuSE (before: Gentoo, Slackware)
Posts: 613

Rep: Reputation: 30
By default, the mount point may be restricted to the root user only. This is simply because fat32 doesn't have any Linux-kind of permissions; by default you'll have no permission, and you can grand users to write to the drive (in contract to allowing everything, and restricting later .. the first one is more secure)

imho this is the best way to be less restrictive against writing the fat partition.
* create a new user-group, for users who may access the drive. (or you could allow the default 'users' group. but I like to be more restrictive)
* open /etc/groups and add the permitted users to this group. Also write down the group-id, you'll need it.
* open /etc/fstab, and change the options of the mount point.

For example:
Code:
/dev/hda8  /mnt/games  vfat  auto,owner,rw,uid=0,gid=306,umask=0022,noexec  0  0
The following options are used:
the uid=0 sets the user-id to root, and gid=306 sets the group-id to 306 (which is my group). The umask opens the permissions a little. In fact, an umask is the inverse of a file mask.

The numbers of the umask represent these settings:
0 = allow everything
1 = deny executing, or entering a directory
2 = deny write
3 = 1 + 2 = deny write+execute.
4 = read
7 = 4 + 2 + 1 = deny read,write,execute.

the umask has 4 digits, which are used for:
first: special field
second: applies to the file owner/user.
third: applies to the file group (the one you've just set with gid=...)
fourth: applies to all other users. It's better to restrict this one.
 
  


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
Write to FAT32 Partition ok? ziphem Linux - Newbie 8 01-25-2005 07:39 PM
Write to FAT32 cause error! welson_sun Linux - Software 5 09-07-2004 03:41 PM
Write to Fat32 kurt_angle Linux - Newbie 6 04-12-2004 03:30 AM
Getting write access to FAT32 wgself Red Hat 1 01-16-2004 09:48 AM
it's fat32 why cant I write to it? ampex189 Linux - Newbie 2 10-12-2003 02:43 AM

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

All times are GMT -5. The time now is 08:42 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration