Please help: Can't write/delete FAT (even with SuperUser)

I’ve been trying to write/delete to my FAT partition for about 2 weeks now and can’t. Usually I use Konqueror, but I’ve also used SuperUser Dolphin, I’ve even opened a new Root account… but nothing allows me to write/delete to my FAT partition, nor can I even change permissions either (though I have read/write privileges as a user, though the OTHER group has only READ privileges).

What is frustrating is that I think I was able to write/delete in my FAT partition when I installed openSUSE 11. But now I can’t. I’m sure I messed up somewhere… but I’m not linux proficient enough to figure it out.

I’ve been forum/google search like crazy but it seems that no one really has this problem or haven’t reported it’s solution that I know of.

I use openSUSE 11 with a dual boot of Windows XP Home. My FAT partition is about 4.5 GB. I use KDE3.5 (though I also have KDE4 installed). My fstab details are:

/dev/disk/by-id/scsi-SATA_TOSHIBA_MK8032G_56SN0413T-part6 swap swap defaults 0 0
/dev/disk/by-id/scsi-SATA_TOSHIBA_MK8032G_56SN0413T-part7 / ext3 acl,user_xattr 1 1
/dev/disk/by-id/scsi-SATA_TOSHIBA_MK8032G_56SN0413T-part8 /home ext3 acl,user_xattr 1 2
/dev/disk/by-id/scsi-SATA_TOSHIBA_MK8032G_56SN0413T-part1 /windows/C ntfs-3g users,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8 0 0
/dev/disk/by-id/scsi-SATA_TOSHIBA_MK8032G_56SN0413T-part2 /windows/D ntfs-3g users,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8 0 0
/dev/disk/by-id/scsi-SATA_TOSHIBA_MK8032G_56SN0413T-part5 /windows/E vfat user,users,gid=users,umask=0002,utf8=true 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs noauto 0 0
debugfs /sys/kernel/debug debugfs noauto 0 0
devpts /dev/pts devpts mode=0620,gid=5 0 0

I don’t mind having only read privileges for my NTFS drive (though it would be nice to write). But I really need to be able to write to the FAT (vfat) partition.

Please, please, do help. Thanks… in anticipation.

It looks correct in fstab

Have you tried super user, then go to folder where drive is mounted
right click - properties
in permissions tab - drop down boxes, set all to read write

Well i agree it is very strange that root cannot delete any file. So try to perform a scandisk in windows or in linux fsck’vfat on the partition.

Try replacing this:

/dev/disk/by-id/scsi-SATA_TOSHIBA_MK8032G_56SN0413T-part5 /windows/E vfat user,users,gid=users,umask=0002,utf8=true 0 0

by this:

/dev/sda5 /windows/E vfat users,gid=users,umask=0002,utf8=true 0 0

So do that first then do this:
The directory “E” in /windows/E. I suggest you change it’s owner to root:users. Here’s the routine to do that without getting at odds with the mounted drive:

  • Open a terminal and assume root privileges with command: su

  • Unmount the partition with command: umount /dev/sda5

  • Change ownership with command: chown -R root:users /windows/E

  • Change permissions with command:** chmod 775 /windows/E**

  • remount it with this command: mount -a

To Swerdna: Hey thank you so much for taking the time to reply. Your great reputation precedes you!

I did what you said, (it does look neater), but it didn’t work.

I think my E drive was anyway owned by root… But I still followed those steps… but it’s just the same… doesn’t work, whether I use super user file manager or just plain browser.

Any other suggestions??? (if you have the time)

Thanks for this suggestion… but when I went to the terminal and typed fsck’vfat all it did was change the command prompt to > and then I couldn’t do anything else, even exit (I had to manually close). Am I missing a step?

Thanks for your comment caf4926. I have tried super user and go to the mounted (windows/E for me)… and then try the permission tab.

These are the settings of permissions:

Owner: can view & Modify contents
Group: can view & Modify contents
Others: can view contents

Owner is root
and Group is user. (my login is part of group user).

And when I try to change the settings to allow even “others” to view & modify contents it says:

Cannot change permissions for windows/E

Similarly it says cannot delete file… when I try to delete any file.

Hope that gives you the appropriate details. Thanks again.

Press Alt and F2

Type
kdesu kwrite
and press ENTER

Browse to your /etc/fstab

Click on file-> Save as and save it as fstab.old

Again click on file->Open and browse to /etc/fstab

Delete everything and Paste this

/dev/disk/by-id/scsi-SATA_TOSHIBA_MK8032G_56SN0413T-part6 swap swap defaults 0 0
/dev/disk/by-id/scsi-SATA_TOSHIBA_MK8032G_56SN0413T-part7 / ext3 acl,user_xattr 1 1
/dev/disk/by-id/scsi-SATA_TOSHIBA_MK8032G_56SN0413T-part8 /home ext3 acl,user_xattr 1 2
/dev/disk/by-id/scsi-SATA_TOSHIBA_MK8032G_56SN0413T-part1 /windows/C ntfs-3g user,users,gid=users,umask=0002,locale=en_US.U TF-8 0 0
/dev/disk/by-id/scsi-SATA_TOSHIBA_MK8032G_56SN0413T-part2 /windows/D ntfs-3g user,users,gid=users,umask=0002,locale=en_US.U TF-8 0 0
/dev/disk/by-id/scsi-SATA_TOSHIBA_MK8032G_56SN0413T-part5 /windows/E vfat user,users,gid=users,umask=0002,utf8=true 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs noauto 0 0
debugfs /sys/kernel/debug debugfs noauto 0 0
devpts /dev/pts devpts mode=0620,gid=5 0 0

Reboot

You should be now able to read and write to /windows C, D and E as a normal user.

Just a tip: If you want to change the ownership of a directory that is the mount point for a partition, it will generally be ineffective unless you umount the partition first, and even then the final result when you mount it again depends on the options you choose for it in fstab, and different filesystems react differently to this tactic. It’s all a bit confusing :confused:

Be careful here, maybe a typo. I think for this alphanumeric string:

user,users,gid=users,umask=0002,locale=en_US.U TF-8 0 0

you should close the gap between US.U and TF-8, so it’s like this: US.UTF-8.
And that’s for both the lines with NTFS. Then I think doctorjohn2’s ntfs mounts would work for partitions 2 and 5.

Thankyou for the kind words. Incidentally, and please don’t feel pressured, but I’m building a wading pool for the grandchildren – I’ll email you the bank details http://www.swerdna.net.au/forumpics/smiley/laugh.gif

I’ve just checked how 11.0 behaves for fat32 partitions by making a fat32 partition in windows and then mounting it in Suse using the GUI partitioner in Yast, using its defaults, imposing no changes. It automatically picks these for mount options in fstab:

/dev/disk/by-id/scsi-SATA_Maxtor_6B160P0_B42H1WJH-part3 /windows/E vfat users,gid=users,umask=0002,utf8=true 0 0

It created the directory “E” with ownership root:users and with permissions mode 775 (drwxrwxr-x).
And it’s immediately writeable for normal users.

So the advice you’ve received here should work, but we must be missing something else. So lets look at a snapshot of the current situation. Can you please enter the following commands in a terminal/console and post the results back here so we can check your current situation:

  • cat /etc/fstab
  • sudo mount
  • sudo /sbin/fdisk -l

And the drive looks to be an internal drive plugged to the motherboard – is that right or is it an external usb drive? And is it a PATA or a SATA drive?

Thank you so much, doctorjohn, but I tried it and it didn’t work. ie. It did mount to the FAT drive (I was able to read it), but no luck in being able to write to it.

And yes, Swerdna, I lost the NTFS mount. Which I guess I can fix with your corrected line (though my concern is with the FAT partition).

Also, Swerdna, I did try the unmounting and then changing permissions. It did allow me to change, but the moment I mounted, it reverted back to previous settings, as you probably expected.

Here’s the details you asked for:

cat /etc/fstab
/dev/disk/by-id/scsi-SATA_TOSHIBA_MK8032G_56SN0413T-part6 swap swap defaults 0 0
/dev/disk/by-id/scsi-SATA_TOSHIBA_MK8032G_56SN0413T-part7 / ext3 acl,user_xattr 1 1
/dev/disk/by-id/scsi-SATA_TOSHIBA_MK8032G_56SN0413T-part8 /home ext3 acl,user_xattr 1 2
/dev/disk/by-id/scsi-SATA_TOSHIBA_MK8032G_56SN0413T-part1 /windows/C ntfs-3g user,users,gid=users,umask=0002,locale=en_US.U TF-8 0 0
/dev/disk/by-id/scsi-SATA_TOSHIBA_MK8032G_56SN0413T-part2 /windows/D ntfs-3g user,users,gid=users,umask=0002,locale=en_US.U TF-8 0 0
/dev/disk/by-id/scsi-SATA_TOSHIBA_MK8032G_56SN0413T-part5 /windows/E vfat user,users,gid=users,umask=0002,utf8=true 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs noauto 0 0
debugfs /sys/kernel/debug debugfs noauto 0 0
devpts /dev/pts devpts mode=0620,gid=5 0 0

sudo mount
/dev/sda7 on / type ext3 (rw,acl,user_xattr)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
debugfs on /sys/kernel/debug type debugfs (rw)
udev on /dev type tmpfs (rw)
devpts on /dev/pts type devpts (rw,mode=0620,gid=5)
/dev/sda8 on /home type ext3 (rw,acl,user_xattr)
/dev/sda5 on /windows/E type vfat (rw,noexec,nosuid,nodev,gid=100,umask=0002,utf8=true)
securityfs on /sys/kernel/security type securityfs (rw)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)

sudo /sbin/fdisk -l
Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xcccdcccd

Device Boot Start End Blocks Id System
/dev/sda1 * 1 5133 41230791 7 HPFS/NTFS
/dev/sda2 5134 7045 15358140 7 HPFS/NTFS
/dev/sda3 7046 9152 16924414+ f W95 Ext’d (LBA)
/dev/sda4 9153 9729 4634280 12 Compaq diagnostics
/dev/sda5 8515 9152 5124735 b W95 FAT32
/dev/sda6 7046 7110 521986+ 82 Linux swap / Solaris
/dev/sda7 7111 7964 6859723+ 83 Linux
/dev/sda8 7965 8514 4417843+ 83 Linux

Partition table entries are not in disk order

And for your last question, it is an internal drive, SATA I think, because of the SDA, but I’m not sure.

ps. just to let you know that I have written to the FAT drive in openSUSE 11 only a few weeks ago… but now I’m not able to do so. don’t know whether something changed in my Windows or openSUSE.

(another ps. I’m in India… so the current time is 3:48am… it’s time to sleep… so I’ll get back to this only tomorrow (today) morning. That will hopefully explain why I’m not responding immediately after this post. Thanks for taking your time to do all this. Best wishes for your grandchildren’s pool)

Well, of course, that was a joke about the grandchildren, but thanks for the thought.

I notice the software for the forum is making typographical errors, writing “U TF” for doctorrjohn2 and now the same in your post, plus it’s writing a space in “tr ue”. We should be careful of those.

I can’t find a thing wrong in the data that you supplied. This behaviour is not normal. It’s difficult to advise you what else to do.

Maybe try this: destroy and then remake the fat32 partition.

Umount (as root) the drive /dev/sda5
Delete the directories “/windows/E” and “/windows”
Remove vfat line from fstab (so booting to Suse during the next steps won’t dismay Suse).

Boot to windows and take the data/files off sda5 and store them temporarily on an ntfs partition. Use the windows partitioner to delete the fat partition. Reboot to windows (not sure why – just intuition) and recreate and reformat the partition and put the data back onto it.

Reboot to Suse and use the Yast partitioner to remount the FAT32 partition in/windows/E (or wherever you like). The partitioner software will create the directory that you put into the mount option, using permissions that it deems appropriate.

What you see here is a complete recreation of the filesystem which should remove whatever hidden bug is stopping the mount from working properly.

Wow, that seems a little drastic. And the only reason why I hesitate is that I am not able to write to my NTFS partition either… regardless of NTFS-3G and it could be the same “bug” applying to that as well.

But if the reformat of the FAT drive works, that would give us some direction… will do that later today and see.

Ooops :o I just thought that the linux sage that you are known to be… a grandfatherly age seemed appropriate. :slight_smile:

Very young at heart, and mentally too, so many say.

Sorry it was a typo. The correct commands are: umount /windows/E then fsck.vfat /dev/sda5. Give it a try before destroying the partition. Otherwise boot windows and perform scandisk checking the ‘correct dila system errors’.

Wow, it’s worked! And this is how it happened.

  1. I made a backup of my vfat partition.

  2. Then in openSUSE I followed the above instructions… namely
    umount /windows/E

2b. which was followed by several attempts at doing
fsck.vfat /dev/sda5

These kept failing until I realised I needed to do it in “su”, and then it worked…

  1. …enough to tell me that there was an error in bootsector of the partition and asked whether I wanted to copy from the original to the backup or back to the original. I tried both, but I wasn’t able to fix anything “no files changed” message came up, saying that there was some error in certain files (it thankfully named the files).

  2. I therefore went to Windows and deleted those files. And scheduled a boot-time scandisk.

  3. Upon completion of the Windows scandisk I reverted to openSUSE and tried to delete a file from my FAT drive…

  4. and yes… IT WORKED!!!

Better still, I went to the NTFS partition through ROOT (ie FileManager Super User) and found that I could even write/delete to/from NTFS files.

Joy, happiness… and many thanks to all those who took the time to help out. Thank you so so much.

Excellent – it’s a good thing bcrisciotti came with the solution just in time, before you tried the drastic surgery. Ended well.

Well! i’m happy to know it is solved. And excuse me for all the typing errors. But you have to know that the most of my posts are made with my cellphone (i am at work the most of the time), and you know T9 sometimes fails!