LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 06-02-2008, 04:53 PM   #1
the_new_z
LQ Newbie
 
Registered: Mar 2006
Location: The Netherlands
Distribution: Ubuntu 6.06 LTS Server
Posts: 22

Rep: Reputation: 15
VFAT Partition Not Working Properly (shows as plugdev)


Hello,

I have a fat partition on my Linux machine (Ubuntu 6.06, Linux 2.6.15-26-server, i686) that I use for sharing stuff with the Windows machines. And it worked fine, but now it doesn't. Here is what looks strange, but I don't know what it means.

Code:
rm: cannot remove `/fat/cancelled.txt': Read-only file system
Code:
drwxrwxrwx  9 root plugdev 32768 1970-01-01 02:00 fat/
Code:
# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
/dev/hdd5       /               ext3    defaults,errors=remount-ro 0       1
/dev/hdd1       /boot           ext2    defaults        0       2
/dev/hdd9       /fat            vfat    defaults,utf8,umask=000,gid=46 0       1
/dev/hdd3       /home           ext3    defaults        0       2
/dev/hdd8       /opt            ext3    defaults        0       2
/dev/hdd6       /usr            ext3    defaults        0       2
/dev/hdd7       /var            ext3    defaults        0       2
/dev/hdd2       none            swap    sw              0       0
/dev/hdc        /media/cdrom0   udf,iso9660 user,noauto     0       0
/dev/fd0        /media/floppy0  auto    rw,user,noauto  0       0
Any clues on how to approach this issue?
 
Old 06-02-2008, 07:28 PM   #2
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
Linux mounts filesystems read-only when they become corrupted. You shouldn't use FAT32 partitions in a Linux-only box, does not make sense. Unmount this partition and run fsck on it, and consider using the Linux native filesystem ASAP.
 
Old 06-03-2008, 04:18 PM   #3
the_new_z
LQ Newbie
 
Registered: Mar 2006
Location: The Netherlands
Distribution: Ubuntu 6.06 LTS Server
Posts: 22

Original Poster
Rep: Reputation: 15
Thanks for the reply. Actually, I didn't manage to unmount it, because it says the device is busy and I don't know how to get around this.

Otherwise, if I use a Linux native FS, what would the Windows guys do? Is there a way to share a any of the Linux file systems with Windows?
 
Old 06-03-2008, 04:32 PM   #4
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
You share over network, using some network filesystem like CIFS. This is absulotely irrelevant what filesystem is used on physical device as long as the OS running in that box can handle it. Thus, I suggest you use a journaled Linux native filesystem instead of that "floppy filesystem FAT32".
Can you reboot this box? If you can comment the relevant line out in fstab and reboot. Otherwise, try "lazy umount", sometimes it helps.
 
Old 06-04-2008, 03:12 PM   #5
the_new_z
LQ Newbie
 
Registered: Mar 2006
Location: The Netherlands
Distribution: Ubuntu 6.06 LTS Server
Posts: 22

Original Poster
Rep: Reputation: 15
Here is the output from fsck:

Code:
sudo fsck /fat
fsck 1.38 (30-Jun-2005)
dosfsck 2.11, 12 Mar 2005, FAT32, LFN
Cluster 469821 out of range (7864320 > 1219386). Setting to EOF.
Cluster 537276 out of range (67646143 > 1219386). Setting to EOF.
Cluster 537277 out of range (7877312 > 1219386). Setting to EOF.
/torrent/the_new_z/Mo' Money.1992.DVDRip/Mo_money.avi
  File size is 721054608 bytes, cluster chain length is 76218368 bytes.
  Truncating file to 76218368 bytes.
Reclaimed 19680 unused clusters (644874240 bytes).
Free cluster summary wrong (519240 vs. really 538919)
1) Correct
2) Don't correct
? 1
Leaving file system unchanged.
/dev/hdd9: 4324 files, 680466/1219385 clusters
So, even after I select Correct it leaves the file system unchanged? Any other option for fixing the issue...or I need to choose a new file system and format?

It seems obvious from what you've said, but would the Windows machines really see the shared network drive if it is formatted with a Linux file system!? I thought that they wouldn't.
 
Old 06-04-2008, 03:26 PM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
The windows machine sees the samba service. The linux machine is doing the actual reading and writing to the disk. It would actually work better for a Windows client on the network if the partition were formatted using ext3 instead of fat32.

Samba maps Linux permissions to Windows permissions. Samba works best if a Windows user is added as a Linux user and if you use the smbpasswd command to create add the windows user in the smbpasswd file (which is similar to /etc/passwd). Now the Windows user can save a file on a publicly writable share, and the file would retain his username and permissions. If you use the fat32 filesystem, these permissions can't be saved on the filesystem so that is impossible.

There is a book that may be supplied with a samba-doc package or from the samba home page. It's called "Samba 3 by Example" and runs through step by step creating several types of Samba configurations.

Last edited by jschiwal; 06-04-2008 at 03:27 PM.
 
Old 06-04-2008, 03:53 PM   #7
the_new_z
LQ Newbie
 
Registered: Mar 2006
Location: The Netherlands
Distribution: Ubuntu 6.06 LTS Server
Posts: 22

Original Poster
Rep: Reputation: 15
Wow, thanks. This really clears things up. What can I use to reformat the fat32 to ext3?
 
Old 06-04-2008, 06:26 PM   #8
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
First make sure that the partition is not mounted. Then as root run "fsck.ext3 /dev/hdd9". Please read the manpage for "fsck.ext3". There are some additional options that you may want to use. Especially the one to set how much space to reserve for the root user. Since this partition isn't a system partition, you could set that to 0 percent.

You can also use the YaST2 partitioner. YaST2 -> System -> Partitioner. Doing it this way you can enable additional features like "user xattr" in a drop down list, or change the ownership & permissions of the mounted directory. The YaST2 partitioner will also create the fstab entry for you. I'd recommend using it, even more if you were to create a win32 partition on a dual booting computer. It will include options such as file name encoding and for memory sticks options like noatime & flush that you may forget about.

If this will be a publicly writeable share, make sure that you set the "sticky" bit on the directory. E.G. "sudo chmod ugo=rwxt /srv/samba/share".

Since the name "fat" probably wouldn't be a very good name, you might as well create the directory (i.e the mount-point) in a more standard place. For SuSE that would be under /srv/samba/. Perhaps use your hosts name or something descriptive such as "podcasts" or "music" if that is what they will be used for.

If a public share is what you want, I had already set up a test share on my laptop, tested it and recommend it in a previous post.

In the [General] section of smb.conf you could use this setting:
Code:
map to guest = Bad User
Then the definition for the share could look like this:
Code:
[wildswede]
        comment = File Sharing on WildSwede
        path = /srv/samba
        read only = No
        guest ok = Yes
You would use change the name, comment and mount point of course. This simple share will allow authenticated uses to save files which retain their permissions, and public users (who don't have Linux accounts & entries in smbpasswd) to save files without having to enter a password. The files for these users will be saved as using the the Linux user "nobody" as the owner. This is a very handy share if you have both Linux users and windows users. Linux users can mount the share with the cifs filesystem and even use acls and file attribs as if this were a local filesystem. Windows users entered with smbpasswd will have files retain ownership and some permissions. Someone not authenticated can save files as well, but in Samba, the owner will be displayed as the "Guest" windows user which is mapped to the "nobody" Linux user. guest & nobody are the standard aliases for "anybody" or anonymous in the respective OSes.

I would also recommend using "security = user". "Security = share" is obsolete. It was used for win95.

I would not recommemd "force user" and "force group". That is what "Map to Guest = Bad User" is for. Allowing authenticated users to retain the permissions on their own files is more flexible and the configuration I gave is a lot easier.

Good Luck!

Last edited by jschiwal; 06-04-2008 at 06:45 PM.
 
Old 06-08-2008, 12:15 PM   #9
the_new_z
LQ Newbie
 
Registered: Mar 2006
Location: The Netherlands
Distribution: Ubuntu 6.06 LTS Server
Posts: 22

Original Poster
Rep: Reputation: 15
Thanks a lot, jschiwal. Your advice worked flawlessly. I finally got rid of the crappy fat32 file system and my samba is working fine.
 
  


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
plugdev & xfce without desktop icons cmk77 Slackware 4 07-23-2007 12:12 PM
Ext3 partition being detected as vfat partition? sylvester_0 Linux - Software 3 03-31-2007 08:48 AM
vfat partition alaios Linux - General 4 02-23-2006 05:08 PM
VFat Partition for dv8r Linux - Hardware 1 10-26-2004 07:52 AM
Linux creating VFAT partitions & them not working properly! Thymox General 4 12-07-2001 03:51 AM

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

All times are GMT -5. The time now is 06:05 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
Open Source Consulting | Domain Registration