Find the answer to your Linux question:
Results 1 to 7 of 7
Hi, I comment out some vol group in fstab accidentally. But I cannot edit /remove it back by using vi /etc/fstab again in init 1 and init 6 . The ...
  1. #1
    Just Joined!
    Join Date
    Aug 2009
    Posts
    44

    edit/write the /etc/fstab file

    Hi,
    I comment out some vol group in fstab accidentally.
    But I cannot edit /remove it back by using vi /etc/fstab again in init 1 and init 6 .
    The file system /etc/fstab is read -only . I cannot chmod .....
    What can I do in order to recover it
    Please advice ....

    I paste the console screen in here .
    Attached Images Attached Images

  2. #2
    Just Joined!
    Join Date
    Feb 2010
    Posts
    5
    Try chattr first. It should give an error message saying that the file is immutable when you try to save it. This is the default in RHEL, i believe.

  3. #3
    Just Joined!
    Join Date
    Feb 2010
    Posts
    1
    As the system goes in maintenace mode so the file system is in read only mode .So you first mount / parttioin in read-write mode.You can do this by using following command
    # mount -o remount,rw /
    now your / partiton is in read-write mode
    open your /etc/fstab file and correct it and save it then restart your system.

    Mike Orton
    Server Admin
    Last edited by devils casper; 02-25-2010 at 12:32 AM. Reason: removed spam link

  4. #4
    Trusted Penguin jayd512's Avatar
    Join Date
    Feb 2008
    Location
    Kentucky
    Posts
    4,071
    So you commented it out it out in fstab and can't get it back?
    Un-comment it, would be first thought.
    I wasn't really clear on the rest of your post...
    What's the issue?
    Jay

    New users, read this first.
    New Member FAQ
    Registered Linux User #463940
    I do not respond to Private Messages asking for Linux help. Please, keep it on the public boards.

  5. #5
    Linux Enthusiast Mudgen's Avatar
    Join Date
    Feb 2007
    Location
    Virginia
    Posts
    623
    Mike_Linux has you on the right track. If it won't remount as rw in maintenance mode, though, try booting rescue mode from your install CD/DVD. At the Boot: prompt,
    linux rescue
    Accept its offer to mount your system read/write, then "cd /mnt/sysimage/etc" and vi your fstab.

  6. #6
    Linux Newbie unlimitedscolobb's Avatar
    Join Date
    Jan 2008
    Posts
    120
    I agree with jayd512. chuikingman, could you please provide more details?

    Also, doesn't RedHat have sudo or su?.. One would usually do
    Code:
    sudo vi /etc/fstab
    or
    Code:
    su -c 'vi /etc/fstab'
    to edit fstab on other distros.

    If you cannot boot into your system, then you could try a LiveCD and change fstab from there. The answers may become better if you provide more information

  7. #7
    Linux Enthusiast Mudgen's Avatar
    Join Date
    Feb 2007
    Location
    Virginia
    Posts
    623
    My inference from the OP's description and screenshots is that he's in maintenance mode as root, but that the filesystem is mounted readonly. Clearly he knew how to edit the fstab file as root to get the spurious "#" in front of the root filesystem line. I don't think sudo/su is the issue.

    Further feedback from the OP could prove me wrong, but could also result in one or more of us helping him further with whatever the issue is.

Posting Permissions

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