Find the answer to your Linux question:
Results 1 to 5 of 5
This morning I found that my /var and /usr file systems are Read Only. What could couse this? And How can I fix it. Here are some data: [root@btellnx02 ~]# ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2006
    Posts
    4

    problem with Read-Only File System


    This morning I found that my /var and /usr file systems are Read Only.

    What could couse this?

    And How can I fix it.

    Here are some data:

    [root@btellnx02 ~]# more /etc/mtab
    /dev/hda5 / ext3 rw 0 0
    proc /proc proc rw 0 0
    sysfs /sys sysfs rw 0 0
    devpts /dev/pts devpts rw,gid=5,mode=620 0 0
    /dev/hda1 /boot ext3 rw 0 0
    tmpfs /dev/shm tmpfs rw 0 0
    /dev/hda8 /home ext3 rw 0 0
    /dev/hda6 /tmp ext3 rw 0 0
    /dev/hda3 /usr ext3 rw 0 0
    /dev/hda2 /var ext3 rw 0 0
    none /proc/sys/fs/binfmt_misc binfmt_misc rw 0 0
    sunrpc /var/lib/nfs/rpc_pipefs rpc_pipefs rw 0 0
    automount(pid1706) /net autofs rw,fd=4,pgrp=1706,minproto=2,maxproto=4 0 0


    [root@btellnx02 ~]# more /etc/fstab
    LABEL=/ / ext3 defaults 1 1
    LABEL=/boot /boot ext3 defaults 1 2
    devpts /dev/pts devpts gid=5,mode=620 0 0
    tmpfs /dev/shm tmpfs defaults 0 0
    LABEL=/home1 /home ext3 defaults 1 2
    proc /proc proc defaults 0 0
    sysfs /sys sysfs defaults 0 0
    LABEL=/tmp1 /tmp ext3 defaults 1 2
    LABEL=/usr1 /usr ext3 defaults 1 2
    LABEL=/var1 /var ext3 defaults 1 2
    LABEL=SWAP-hda7 swap swap defaults 0 0



    [root@btellnx02 ~]# fdisk -l

    Disk /dev/hda: 41.1 GB, 41110142976 bytes
    255 heads, 63 sectors/track, 4998 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

    Device Boot Start End Blocks Id System
    /dev/hda1 * 1 65 522081 83 Linux
    /dev/hda2 66 702 5116702+ 83 Linux
    /dev/hda3 703 1339 5116702+ 83 Linux
    /dev/hda4 1340 4998 29390917+ 5 Extended
    /dev/hda5 1340 1658 2562336 83 Linux
    /dev/hda6 1659 1785 1020096 83 Linux
    /dev/hda7 1786 1850 522081 82 Linux swap / Solaris
    /dev/hda8 1851 4998 25286278+ 83 Linux



    Thanks in advance.

    Rene

  2. #2
    Administrator MikeTbob's Avatar
    Join Date
    Apr 2006
    Location
    Texas
    Posts
    7,864
    they are mounted rw (read/write) according to mtab
    But I think the fstab file overrides those settings when you use the "defaults" option. example: LABEL=/var1 /var ext3 defaults 1 2
    And thats why it is read only, I think.
    only root can modify the contents of these directories anyways.
    I do not respond to private messages asking for Linux help, Please keep it on the forums only.
    All new users please read this.** Forum FAQS. ** Adopt an unanswered post.

    I'd rather be lost at the lake than found at home.

  3. #3
    Just Joined!
    Join Date
    Jul 2006
    Posts
    4
    well, after trying fsck e2fsck and remuving some journals, I got 2 Filesuystems oK, but I have one with problems (/home)
    The error I get after runing fsck -f /dev/hda7 is
    ---
    Attempt to read block from filesystem resulted in short read while trying open /dev/hda7
    Could this be a zero-length partition?
    ---

    I used the e2fsck -b <blockNumber> /dev/hda7 and still the same

    Any more Ideas?

    Thanks
    Rene

  4. #4
    Just Joined!
    Join Date
    Apr 2005
    Posts
    44
    check the actual permissions on all the directories, maybe they have the wrong ones. if so, just chmod it and you should be fine

  5. #5
    Just Joined!
    Join Date
    Jul 2006
    Posts
    4
    Hi all,

    Well, at last its working again...

    It was a FileSystem crash, I have to use fsck and other utilities to fix it.

    There were 3 FS with error /usr, /var, and /home

    /usr was fixed with the fsck -f /dev/hda3 (it was the easy part)
    /var was a litle more complicated.
    fsck didn't work, so I use e2fsck -f -v -c and after that another e2fsck -f -y

    for /home I have to delete the journal :
    tune2fs -f -O ^has_journal /dev/hda8

    and fsck with the block option

    e2fsck -b <blockNumber> -f -y /dev/hda8

    and the FS was fixed, but, the journal was gone.
    in my /etc/fstab was declared as ext3 type, so at boot time it was not possible tu mount the /home FS, so I mounted with
    mount -t ext2 /dev/hda8 /home
    and its working as nothing was happened.

    if I can't recover the journal for /home, I will have to modify my /etc/fstab on /home


    Hope this helps some one else...

    Rene

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •