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 03-01-2010, 01:00 PM   #1
yewint
Member
 
Registered: Dec 2009
Posts: 57

Rep: Reputation: 15
read only file system


Hi geeks ...
I cant remove some files in my USB drive. I got the errors that told me they are the read-only file systems. And even as a root #, I cant change their permissions. How do I do and change to read-write? Help me please ...

Last edited by yewint; 03-01-2010 at 01:02 PM.
 
Old 03-01-2010, 01:19 PM   #2
tom4everitt
Member
 
Registered: Jan 2009
Location: Stockholm
Distribution: Fedora, Ubuntu, Mac OS X
Posts: 78

Rep: Reputation: 23
Usually its as easy as a little switch on the side of the stick, determining whether its read-only or read-write.

Otherwise is

chmod -R 777 <name-of-folder>

the command to use to give everything in a folder full permissions.
 
Old 03-01-2010, 01:19 PM   #3
camorri
LQ Guru
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 14.1, 14.2
Posts: 5,090

Rep: Reputation: 483Reputation: 483Reputation: 483Reputation: 483Reputation: 483
You need to do two things, get root privileges, is the first. You can do that by using the 'su' command, it will prompt you for the root password. Enter the root password.

Now navigate to the directory where the files are, using the 'cd /tothepathofthedirectory'. Once there, use 'chmod 600 nameoffile'. That should change the read only to read and write. You can change the 600 part to allow group and other write, if that is what you want. ie, 660 would allow w/w for owner root, and anyone belonging to the root group. If you want other to be read only, then 664 will do it.
 
Old 03-01-2010, 01:24 PM   #4
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,186

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
Also, check your mount options: You may have actually mounted the USB drive using ro in the option list. (Some distributions will automatically mount /media/... devices as ro unless told otherwise. (The way to "tell otherwise," in those cases, is distribution and window-manager specific.)
 
Old 03-01-2010, 01:39 PM   #5
yewint
Member
 
Registered: Dec 2009
Posts: 57

Original Poster
Rep: Reputation: 15
Yes.I cant even change the permissions.

Quote:
$ su
Password: ........
# chmod 777 file.txt
chmod: changing permissions of `file.txt': Read-only file system
 
Old 03-01-2010, 03:42 PM   #6
devnull10
Member
 
Registered: Jan 2010
Location: Lancashire
Distribution: Slackware Stable
Posts: 548

Rep: Reputation: 116Reputation: 116
As said above, you probably need to ensure you're mounting it with RW permissions. Check your /etc/fstab file.
 
Old 03-02-2010, 05:29 AM   #7
tom4everitt
Member
 
Registered: Jan 2009
Location: Stockholm
Distribution: Fedora, Ubuntu, Mac OS X
Posts: 78

Rep: Reputation: 23
Quote:
Originally Posted by yewint View Post
Yes.I cant even change the permissions.
Are you sure there's no such switch I talked about before?

Cause otherwise usb-sticks are normally mounted as read-write. The exception is when the file system either is not fully supported (such as hfsplus, where for security reasons it is mounted as read-only after a bad unmount) or when the file system itself doesn't support permissions (such as fat32).

Assuming you stick is fat32 which most sticks are, permissions are set widely when mounted. Use

fdisk -l

to determine the name of the device and then check if there is any rule for that in the file /etc/fstab. If you're unsure about how to do this you can post the output of:

fdisk -l
cat /etc/fstab

and I'm sure someone will be able to help you fix the rules.
 
Old 03-02-2010, 06:01 AM   #8
geovg
Member
 
Registered: Mar 2010
Posts: 40

Rep: Reputation: 1
Quote:
Originally Posted by yewint View Post
Hi geeks ...
I cant remove some files in my USB drive. I got the errors that told me they are the read-only file systems. And even as a root #, I cant change their permissions. How do I do and change to read-write? Help me please ...
please paste the output of the following commands.

fdisk -l
mount
cat /etc/fstab
 
Old 03-02-2010, 06:29 AM   #9
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,063

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
You are probably mounting it "ro". If the fs is NTFS you should install ntfs-3g and use that instead. The stock in-kernel ntfs driver doesn't have write support (a proper one anyway).
 
  


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
Read Only File System? Can't read superblock! haughjd Linux - Software 4 01-15-2008 09:27 AM
web server (fedora core 5) became read-only file system after i upload a file nggs8411 Linux - Server 1 03-26-2007 10:23 AM
How to read .chm file in fedora, can't mount ntfs file system ishti_du Linux - Newbie 12 03-06-2007 04:27 AM
'Read-only file system' when untar a tar.bz2 file yinglcs Linux - General 1 02-18-2006 10:12 PM
Change from Read only to Read Write File System? justiceisblind Linux - Newbie 3 03-03-2002 08:23 PM


All times are GMT -5. The time now is 02:11 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration