LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 11-04-2006, 11:48 PM   #1
kernel sanders
LQ Newbie
 
Registered: Jul 2006
Location: Ann Arbor, MI
Distribution: Ubuntu 7.04
Posts: 3

Rep: Reputation: 0
FAT32 partition is read-only; tried everything I could find


I can't make my FAT32 partition on /dev/hdb6 writeable. I have tried many solutions from many online forums, including this one, but none has worked so far.

/dev/hdb6 mounts to /mnt/FAT32. Debian is on /dev/hdb1, so I think the drive works fine. The drive is readable and writeable by Windows XP, on /dev/hda.

The directory should be writeable by root:
Code:
# ls -l /mnt
total 76
drwxr-xr-x  2 root root  4096 2006-11-04 17:29 cdrom
drwxr-xr-x  8 root root 65536 1969-12-31 19:00 FAT32
drwxr-xr-x  2 root root  4096 2006-09-01 23:27 flash
drwxr-xr-x  2 root root  4096 2006-08-10 18:08 ntfs
/etc/fstab looks like this:
Code:
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
/dev/hdb1       /               ext3    defaults,errors=remount-ro 0       1
/dev/hdb5       none            swap    sw              0       0
/dev/hdc        /media/cdrom0   iso9660 ro,user,noauto  0       0
/dev/fd0        /media/floppy0  auto    rw,user,noauto  0       0
/dev/hdb6       /mnt/FAT32      vfat    rw,users,umask=0000 0 0
/dev/hda1       /mnt/ntfs       ntfs    ro,user,auto,nls=utf8   0       0
/dev/sda1       /mnt/flash      vfat    rw,user,noauto,nls=utf8 0       0
I have changed the /dev/hdb6 line of /etc/fstab many times and none of them worked.

I logged in to Gnome as root user to see if I could do anything about it, to no avail. When I right-click on any directory or file under /mnt/FAT32 and choose Properties... and go to the Permissions tab, it says root has read, write, and execute privileges but others have read and execute privileges. Dragging and dropping a file to /mnt/FAT32 is impossible because it gives me an error saying "The destination disk is read-only." Doing mkdir or any other write command also returns an error message that the disk is read-only.

I can open all the files under /mnt/FAT32 just fine. I think I've written to my USB flash drive mounted at /mnt/flash before. Maybe.

Thanks for any insight. I hope it isn't a physical problem of some kind.
 
Old 11-05-2006, 04:13 AM   #2
FredGSanford
Member
 
Registered: Nov 2005
Location: USA
Distribution: Mageia Cauldron & Salix 14
Posts: 943
Blog Entries: 5

Rep: Reputation: 88
Check out this thread! Maybe it will help and let us know.
 
Old 11-05-2006, 05:40 AM   #3
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu
Posts: 1,439

Rep: Reputation: 103Reputation: 103
/dev/hdb6 /mnt/FAT3 vfat rw,noauto,user 0 0

did u try this version too? thats the way my box works. there is a significant difference between user and users.
hope that helps, good luck
j.
 
Old 11-05-2006, 05:45 AM   #4
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655
I prefer changing the ownership in the mount command (or fstab file) using the uid= and gid= options.
 
Old 11-05-2006, 10:00 AM   #5
kernel sanders
LQ Newbie
 
Registered: Jul 2006
Location: Ann Arbor, MI
Distribution: Ubuntu 7.04
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
I prefer changing the ownership in the mount command (or fstab file) using the uid= and gid= options.
Yes, I tried adding uid=1,gid=1 to the fstab line, but that doesn't work. User 1 is the root user, so it seems like that should be right. I guess I could try it in the mount command. What is the syntax of that?

Quote:
/dev/hdb6 /mnt/FAT3 vfat rw,noauto,user 0 0
Yeah, I've had rw or not, user or users, umask or not, probably some other things. Different combinations. I just tried it again exactly like you wrote it, but it's still read-only. I even had it auto-mount upon startup just to see if that changed anything, but no.

Quote:
Check out this thread! Maybe it will help and let us know.
I looked at the contents of /var/log/messages, and there were several errors like this that make me think there's a physical problem with the drive (I don't know why that would make it read-only, though):
Code:
Nov  5 09:44:14 localhost kernel: hdb: dma_intr: status=0x51 { DriveReady SeekCo mplete Error }
Nov  5 09:44:14 localhost kernel: hdb: dma_intr: error=0x40 { UncorrectableError  }, LBAsect=16601855, sector=32
Nov  5 09:44:14 localhost kernel: end_request: I/O error, dev 03:46 (hdb), secto r 32
Nov  5 09:44:14 localhost kernel: bread in fat_access failed
Nov  5 09:44:14 localhost kernel: Directory 1: bad FAT
Nov  5 09:44:15 localhost kernel: hdb: dma_intr: status=0x51 { DriveReady SeekCo mplete Error }
Nov  5 09:44:15 localhost kernel: hdb: dma_intr: error=0x40 { UncorrectableError  }, LBAsect=16601855, sector=32
Nov  5 09:44:15 localhost kernel: end_request: I/O error, dev 03:46 (hdb), secto r 32
Nov  5 09:44:15 localhost kernel: bread in fat_access failed
Nov  5 09:44:15 localhost kernel: Filesystem panic (dev 03:46).
Nov  5 09:44:15 localhost kernel:   FAT error
Nov  5 09:44:15 localhost kernel:   File system has been set read-only
Maybe I'll try the fschk utility mentioned in the thread FredGSandord recommended, which I've already looked at. I was hesitant to use it because I thought it could damage or erase all of the data in a partition.
 
Old 11-05-2006, 10:48 AM   #6
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu
Posts: 1,439

Rep: Reputation: 103Reputation: 103
the mount command is
mount -t vfat /dev/hdb6 /mnt/FAT3
as superuser
 
Old 11-05-2006, 03:05 PM   #7
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: Tupelo, MS
Distribution: Gentoo
Posts: 6,926

Rep: Reputation: 124Reputation: 124
This is a proper line for /etc/fstab:
Code:
/dev/sda2        /Shared          vfat        users,umask=1000,rw,auto  1   0
Code:
mingdao@silas:/server2/kernel_source$ ls -alh /Shared/
total 3.4G
drwxrwxrwx 20 root root  16K 1970-01-01 07:00 ./
drwxr-xr-x 28 root root  664 2006-11-05 23:58 ../
-rwxrwxrwx  1 root root 3.0M 2005-12-22 17:15 2006-Jan-Feb.pdf*
-rwxrwxrwx  1 root root 5.9M 2006-02-02 10:34 AMD64\ ESCAPE!\ Screensaver.zip*
-rwxrwxrwx  1 root root 690K 2006-02-13 10:32 AMD_cooling_guide4.pdf*
-rwxrwxrwx  1 root root 892K 2006-01-06 09:48 AR_05_NovDec.pdf*
-rwxrwxrwx  1 root root   87 2006-01-23 10:16 Adobe_Online_Training_key.txt*
-rwxrwxrwx  1 root root 216K 2006-01-23 10:17 Adobe_online_training_enrollment_instructions.pdf*
Read "man mount" and "man fstab" ...

The difference between user and users is this: user means only
the user that mounted the drive may unmount it; users means any
user may unmount it, whether that user mounted it or not. Since
these Windows partitions can only be mounted by root, it does
not matter which one you select.

You see that I can write to that drive as a normal user.
Code:
mingdao@silas:/Shared$ pico facts
mingdao@silas:/Shared$ ls -lh facts
-rwxrwxrwx 1 root root 29 2006-11-06 04:01 facts*
mingdao@silas:/Shared$ cat facts
Let's get down to the facts.
If that doesn't work for you, your distro is busted.

Last edited by Bruce Hill; 11-05-2006 at 03:20 PM.
 
Old 11-06-2006, 07:21 PM   #8
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655
When I use the uid= and gid= options, I use my username. It will take either an integer UID/GID or the username/group name respectively.
For example:
/dev/hdb2 /mnt/shared vfat defaults,uid=brucehill,gid=users,fmask=0111,dmask=0000 0 0

I prefer using a separate fmask/dmask instead of umask to enable clearing the "x" bit for files. The "x" bit for directories is needed however.

Your device implies that this is a permanent drive and not a usb drive or SD card, so I didn't use the noauto option. This will mount the drive when you boot up. Using uid= and gid= options allow you to have exclusive permissions ( while in linux ) on the partition if that is what you want. ( ex: uid=brucehill,fmask=0177,dmask=0077 ).
 
Old 11-07-2006, 07:07 PM   #9
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: Tupelo, MS
Distribution: Gentoo
Posts: 6,926

Rep: Reputation: 124Reputation: 124
kernel sanders,

Sorry for not directly addressing your first post. Change your line to:
Code:
 /dev/hdb6       /mnt/FAT32          vfat        users,umask=1000,rw,auto  1   0
and /mnt/FAT32 will mount when you boot, and it will be writable, even by normal users.

 
Old 11-09-2006, 06:52 PM   #10
vinster
LQ Newbie
 
Registered: Apr 2005
Location: Manchester, UK
Distribution: Fedora & Salckware
Posts: 25

Rep: Reputation: 15
At the risk of sounding stupid (I do it all to often LOL)
have you tried setting the selinux policy to permissive mode? I'm just a noob but I had loads of bother just seeing my ntfs drive and on my searches came across your thread.
 
  


Reply

Tags
fat32, readonly


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
Mounted read-write Fat32 partition suddenly becomes read-only?? hohead Linux - General 8 04-05-2007 01:17 PM
I can mount but cannot read a Win95 FAT32 partition wuqso Linux - Hardware 2 12-31-2004 01:39 AM
QPartedt FAT32 partition could not be read by W2K GAZ082 Linux - General 2 12-30-2004 09:41 PM
can't even read from fat32 partition...except sometimes!? Sinope Linux - General 3 08-19-2004 03:59 PM
FAT32 Partition Read-only rhawi Linux - Newbie 5 07-23-2004 01:56 PM


All times are GMT -5. The time now is 09:16 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration