LinuxQuestions.org
Visit Jeremy's Blog.
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 05-20-2011, 05:28 AM   #1
sumeet inani
Member
 
Registered: Oct 2008
Posts: 902
Blog Entries: 26

Rep: Reputation: 49
can't write or delete from sd card


Code:
mount
/dev/sdd1 on /media/E0FD-1813 type vfat (rw,nosuid,nodev,uhelper=udisks,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush)
cp 'Aankhon Aankhon Mein hum tum ho gaye deewane.mp3' /media/E0FD-1813/Music/sumeet/a
cp: cannot create regular file `/media/E0FD-1813/Music/sumeet/a/Aankhon Aankhon Mein hum tum ho gaye deewane.mp3': Read-only file system
The micro sd card mounts & works as fat32 in windows xp just fine.
 
Old 05-20-2011, 07:03 AM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
Look at the ownership and permissions of the mount point.
ls -ld /media/E0FD-1813

I'm wondering if the filesystem might be corrupt, or if you aren't the user with the UID of 1000.
The dmask only allows the owner to enter the directory. The fmask isn't listed.
 
Old 05-20-2011, 10:48 AM   #3
sumeet inani
Member
 
Registered: Oct 2008
Posts: 902
Blog Entries: 26

Original Poster
Rep: Reputation: 49
I was root.
I will try 'fsck.vfat -a /dev/sdd1'
 
Old 05-20-2011, 11:07 AM   #4
Adol
Member
 
Registered: Feb 2011
Location: Osaka, Japan
Distribution: Gentoo, Opensuse
Posts: 264

Rep: Reputation: 5
I had this problem also. What I had to do is as root mount it to a user.

This may help: thanks to spazticclown
Quote:
You can also try mounting the USB drive using the command:
Code:

mount /dev/sdh1 /devices/usb -o uid=nnn

Where "nnn" is your uid (found with 'echo $UID' in console).

This should grant you permission to use the USB drive from that user.

Hope this helps in the short run.
The thread is here:I was having a problem that the device was root but the file was owned by a user. It wasnt letting me copy files over to a memory stick because of it.

Hope it helps

Last edited by Adol; 05-20-2011 at 11:09 AM.
 
Old 05-20-2011, 07:16 PM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
The pendrive was mounted as the user with the UID of 1000, which would be the first regular user.
Post the ls command results. The missing fmask mount option seems abnormal. Your regular user will be able to access the directories however according to the dmask used.

Try reading and writing to the disk as a regular user, as you should be doing.
 
Old 05-21-2011, 09:06 AM   #6
sumeet inani
Member
 
Registered: Oct 2008
Posts: 902
Blog Entries: 26

Original Poster
Rep: Reputation: 49
Code:
$ mount
/dev/sda5 on / type ext3 (rw,errors=remount-ro)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
/dev/sda8 on /sumeet type fuseblk (rw,allow_other,blksize=4096)
/dev/sdb1 on /media/SUMEET type vfat (rw,nosuid,nodev,uhelper=udisks,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush)
/dev/sdc1 on /media/FreeAgent GoFlex Drive type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096,default_permissions)
/dev/sdd1 on /media/E0FD-1813 type vfat (rw,nosuid,nodev,uhelper=udisks,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush)
lxuser@debian:~$ cat > example.txt
copy the file into usb & mobile
lxuser@debian:~$ cp -v example.txt  /media/SUMEET/
`example.txt' -> `/media/SUMEET/example.txt'
lxuser@debian:~$ cp -v example.txt  /media/E0FD-1813/
`example.txt' -> `/media/E0FD-1813/example.txt'
cp: cannot create regular file `/media/E0FD-1813/example.txt': Read-only file system

lxuser@debian:~$ rm  /media/E0FD-1813/radio-001.mp3 
rm:cannot remove 'radio-001.mp3' : read only file system
SUMEET is USB stick which poses no problem in copying.
while E0FD-1813 is SD card with same mount options yet immutable.

Last edited by sumeet inani; 05-21-2011 at 09:14 AM.
 
Old 05-21-2011, 09:09 AM   #7
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852
Some SD-cards have a little switch to make the card read-only, you should have a look at that.
 
Old 05-21-2011, 09:21 AM   #8
sumeet inani
Member
 
Registered: Oct 2008
Posts: 902
Blog Entries: 26

Original Poster
Rep: Reputation: 49
The SD card is simply fitted in mobile slot.
 
Old 05-21-2011, 10:56 AM   #9
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852Reputation: 4852
Quote:
Originally Posted by sumeet inani View Post
The SD card is simply fitted in mobile slot.
And what about the switch?
 
Old 05-21-2011, 04:20 PM   #10
sumeet inani
Member
 
Registered: Oct 2008
Posts: 902
Blog Entries: 26

Original Poster
Rep: Reputation: 49
this is micro sd card of 2GB - a hard plastic piece.Also in mobile slot, it is merely pushed.No switch to turn , rotate or twist
 
Old 05-21-2011, 04:25 PM   #11
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721
Quote:
Originally Posted by sumeet inani View Post
this is micro sd card of 2GB - a hard plastic piece.Also in mobile slot, it is merely pushed.No switch to turn , rotate or twist
We're not talking about how to insert it into the reader. Forget about what you put the card into, see if there's a switch on the card itself.

Here's an image I found online: http://download.windowssecrets.com/i...nga-SDLock.jpg
 
Old 05-22-2011, 12:19 AM   #12
sumeet inani
Member
 
Registered: Oct 2008
Posts: 902
Blog Entries: 26

Original Poster
Rep: Reputation: 49
That image explains your point.
Nothing on card.
It is same as bottom one on http://upload.wikimedia.org/wikipedi...7/SD_Cards.svg

Last edited by sumeet inani; 05-22-2011 at 12:27 AM.
 
Old 05-22-2011, 12:47 AM   #13
sumeet inani
Member
 
Registered: Oct 2008
Posts: 902
Blog Entries: 26

Original Poster
Rep: Reputation: 49
'fsck.vfat -a /dev/sdd1' corrupted the file indexing by samsung OS of mobile by renaming files with non graphical characters.
The mobile manual had initially warned to format the micro SD card only with samsung OS
But I edited file system without heeding to that.
Yet 'read only file system error'.
 
Old 05-22-2011, 01:13 AM   #14
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
Having graphical characters listed for the filenames indicates the either the filesystem is corrupt, or the SD card is going bad.

If fsck didn't fix the problem, you might need to use photorec to recover files on the filesystem before reformatting. If reformatting doesn't help, I'd say the device is going bad.

I had a similar problem yesterday with my kindle. I couldn't save items in Calibre with the same error message. Fsck fixed the problem for me. You may have had more extensive damage to the filesystem.
 
Old 05-23-2011, 09:12 PM   #15
sumeet inani
Member
 
Registered: Oct 2008
Posts: 902
Blog Entries: 26

Original Poster
Rep: Reputation: 49
Turns out the samsung OS in mobile creates file with non-ASCII names , maybe not adhering to FAT specification .
'fsck.vfat' was exhausted (1/2 hour up still working) in renaming those garbled folders.
Also 'find' indicated filesystem loop detected.
Those mobile OS software engineers cover up flaws with patch & label unintended bugs as security features.-Said by Dilbert
That is why they warned against formatting on computer instead mobile OS can do that.
Also it seems files on micro SD card get corrupted soon unlike USB stick.
 
  


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
Is it possible to have write access to a file, but not delete? resetreset Linux - Software 3 03-16-2011 10:01 AM
Get permission to write/delete it-s Linux - Newbie 12 02-16-2005 05:30 AM
NTFS write and delete...... AzuuAz Linux - Software 3 11-26-2004 04:38 AM
samba share with write but not delete Red Squirrel Linux - Software 7 08-29-2004 07:12 PM
How to Read, Write, Execute but not Delete r042wal Linux - Software 6 06-07-2003 12:05 PM

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

All times are GMT -5. The time now is 10:52 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