VFAT Partition Not Working Properly (shows as plugdev)
Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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.
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.