LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 07-15-2010, 09:45 PM   #1
osix
LQ Newbie
 
Registered: Mar 2004
Posts: 2

Rep: Reputation: 0
/var partition turned to read only


hi,

i am having trouble on my linux machine running in centos 5. my machine restarted and after booting my /var partition changes to read-only.

i tried to create a file on /var but i get error.
Code:
[root@server ~]# touch /var/test
touch: cannot touch `/var/test': Read-only file system
i command mount to see my file system.
Code:
[root@server ~]# mount
/dev/hda2 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/hda6 on /home type ext3 (rw)
/dev/hda5 on /var type ext3 (ro)
/dev/hda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
i did a fsck on /dev/hda5 and it seems to be ok.
Code:
[root@server ~]# fsck /dev/hda5
fsck 1.39 (29-May-2006)
e2fsck 1.39 (29-May-2006)
/dev/hda5 is mounted.  

WARNING!!!  Running e2fsck on a mounted filesystem may cause
SEVERE filesystem damage.

Do you really want to continue (y/n)? yes

/var: clean, 2130/12812288 files, 4801684/12799780 blocks
i also try to remount.
Code:
[root@server ~]# mount -o remount /var
mount: block device /dev/hda5 is write-protected, mounting read-only
is there is any way to make my /var to RW?

thanks in advance.
 
Old 07-15-2010, 10:27 PM   #2
Kenny_Strawn
Senior Member
 
Registered: Feb 2010
Location: /usa/ca/orange_county/lake_forest
Distribution: ArchBang, Google Android 2.1 + Motoblur (on Motortola Flipside), Google Chrome OS (on Cr-48)
Posts: 1,791
Blog Entries: 62

Rep: Reputation: 56
Code:
sudo chmod -R 777 /var
 
Old 07-16-2010, 03:38 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,043

Rep: Reputation: 1914Reputation: 1914Reputation: 1914Reputation: 1914Reputation: 1914Reputation: 1914Reputation: 1914Reputation: 1914Reputation: 1914Reputation: 1914Reputation: 1914
That isn't going to do anything if it's mounted read-only.
Code:
mount -o remount,rw /var
 
Old 09-24-2014, 12:28 AM   #4
cheema143
LQ Newbie
 
Registered: Sep 2012
Posts: 1

Rep: Reputation: Disabled
Not working ..............i try this
 
Old 09-24-2014, 02:02 PM   #5
JeremyBoden
Senior Member
 
Registered: Nov 2011
Distribution: Debian
Posts: 1,023

Rep: Reputation: 203Reputation: 203Reputation: 203
Change your /etc/fstab file so that /var gets mounted as rw instead of ro.
 
Old 09-24-2014, 07:06 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,043

Rep: Reputation: 1914Reputation: 1914Reputation: 1914Reputation: 1914Reputation: 1914Reputation: 1914Reputation: 1914Reputation: 1914Reputation: 1914Reputation: 1914Reputation: 1914
Extremely unlikely fstab has ro - logs wouldn't work. More likely it has remount-ro for /var.
The mount command needs to be run as root, but really it probably needs a fsck.
 
  


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
[SOLVED] ext4 partition turned into Unknown according to gparted dimm0k Linux - Newbie 6 07-09-2010 05:28 AM
/var partition is read only in CentOS 5.x chownuseradd Linux - Newbie 3 01-21-2008 06:50 AM
Partition problems: half of my hard drive turned useless Executor21 Linux - Newbie 12 10-30-2007 07:13 PM
VAR Read-Only ~ How do I change it? philgarcia Linux - General 4 02-01-2006 03:54 PM
Why my disk turned to be read-only ? naihe2010 Linux - Enterprise 1 11-07-2005 10:53 AM


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