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 01-28-2009, 07:06 AM   #1
varaahan
Member
 
Registered: Jul 2005
Location: chennai, india
Distribution: Puppy, Arch Linux,Absolute Linux
Posts: 83

Rep: Reputation: 15
Changing read only file /etc/fstab


I accidentally edited the /etc/fstab file which has made my arch box unbootable. Now I want to edit it but the editor says "read-only" file. Tried chmod but no use. How to release the "sticky bit" of the file ?
 
Old 01-28-2009, 07:13 AM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,527

Rep: Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898
boot from a live cd, and mount the partition rw
 
Old 01-28-2009, 07:29 AM   #3
varaahan
Member
 
Registered: Jul 2005
Location: chennai, india
Distribution: Puppy, Arch Linux,Absolute Linux
Posts: 83

Original Poster
Rep: Reputation: 15
I don't have the CD now! Any other way ?
 
Old 01-28-2009, 08:08 AM   #4
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
If you do not have the cd of the same distro you installed you could try using any live distro to edit the files.
 
Old 01-28-2009, 08:13 AM   #5
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
If you can't boot the Arch system, where are you using your editor? And where did you try chmod?

You should be able to edit as root. ("su" to become root) (and you would also need to run chmod as root)

I've never seen the sticky bit used on /etc/fstab
 
Old 01-28-2009, 08:19 AM   #6
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,527

Rep: Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898
Quote:
I've never seen the sticky bit used on /etc/fstab
Seems to me he changed fstab to mount / ro
 
Old 01-28-2009, 09:24 AM   #7
varaahan
Member
 
Registered: Jul 2005
Location: chennai, india
Distribution: Puppy, Arch Linux,Absolute Linux
Posts: 83

Original Poster
Rep: Reputation: 15
The system boots thro HAL and I could login but all files are read-only. Even I could not run pppoe-start and connect to internet.

What I did was to edit the fstab file and commented out the lines having / and swap partitions.

My CD drive is out of order and so having a live CD is of no use.

Last edited by varaahan; 01-28-2009 at 09:27 AM.
 
Old 01-28-2009, 09:26 AM   #8
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,527

Rep: Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898
download puppy , burn it to cd and boot from it
 
Old 02-01-2009, 05:34 AM   #9
varaahan
Member
 
Registered: Jul 2005
Location: chennai, india
Distribution: Puppy, Arch Linux,Absolute Linux
Posts: 83

Original Poster
Rep: Reputation: 15
Tried using arch (older version 0.8) but again the partition / file is mounted as read-only .
I could login as root but I could not chnage the file permissions. Tried chmod u+rwx, chown , umask command but in vain.

mount and remount commands didn't work since they rely on /etc/fstab which is read-only.
 
Old 02-01-2009, 05:36 AM   #10
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,527

Rep: Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898
Quote:
Tried using arch (older version 0.8) but again the partition / file is mounted as read-only .
Did you booted from a live cd ?
 
Old 02-01-2009, 09:51 AM   #11
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,120

Rep: Reputation: 97
Isn't the following possible?

Launch the operating system up into single user mode, do umount on the partition containing /etc/fstab then do mount -rw on the partition that contains /etc/fstab and this should restore the ability to write to /etc/fstab...? I don't get why people go around roundabout methods of having to download things to try and fix things when the tools already exist their to fix them o.O?

Last edited by r3sistance; 02-01-2009 at 09:53 AM.
 
Old 02-01-2009, 12:04 PM   #12
saagar
Member
 
Registered: Jul 2008
Location: Chennai, India
Distribution: RHEL5, Ubuntu
Posts: 191

Rep: Reputation: 37
I think this might work, but take a better advise before tryint it..
mount -o rw,remount / and try to edit the /etc/fstab file.
 
Old 02-01-2009, 09:06 PM   #13
varaahan
Member
 
Registered: Jul 2005
Location: chennai, india
Distribution: Puppy, Arch Linux,Absolute Linux
Posts: 83

Original Poster
Rep: Reputation: 15
The entire OS is one single partition and so I am afraid to try umount.
The command mount -o remount,rw didn't work with error msg not found in /etc/fstab or mtab.
Tried puppy in live mode but it threw some error msg and didn't boot at all. (Perhaps some problem with my new SATA Moser BAer DVD writer !)

Last edited by varaahan; 02-01-2009 at 09:08 PM.
 
Old 02-02-2009, 12:43 AM   #14
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
Look at what is mounted and where the current root (/) directory is. If you couldn't boot your system root directory, you may still be running with the system directory in ram (the initrd filesystem) and can try remounting the root system as rw. The system may have bailed out into a root shell before performing the pivot to the system directory (your normal /) and remounting as r/w.

What change did you make to /etc/fstab before rebooting? Was it for you root filesystem partition or another one?

Another possibility is that there was a problem with the filesystem detected and so it was mounted ro as a result. This could have been that you made a mistake editing the root filesystem's fstab entry, or an actual problem was detected. The the boot processes launches fsck, the filesystem isn't mounted r/w yet.

Last edited by jschiwal; 02-02-2009 at 12:45 AM.
 
Old 02-02-2009, 08:13 AM   #15
varaahan
Member
 
Registered: Jul 2005
Location: chennai, india
Distribution: Puppy, Arch Linux,Absolute Linux
Posts: 83

Original Poster
Rep: Reputation: 15
I did the following originally :

When working as a normal user , I sudoed and edited the /etc/fstab file and commented out the lines starting with UUID.... representing the / and swap file systems. Upon restart the system took a long while to boot throwing out a lot of error messages.And finally hanging for a long time at HAL I was logged into a shell . Since I had to edit the fstab file I logged in as root but found the fstab file mounted as read-only. Since I could not edit the file the problem persisted .

Now I have edited the fstab file by using Nimblex live Cd and I Could boot Arch the normal way. Yet my problem of making the file attribute of fstab file as rw from read-only remains unsolved.
I would have been happier if I had edited the file within Arch.

Anyhow thanks to all of you friends for your help and support.
 
  


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
changing /tmp mount on fstab file with noexc emymcse Linux - Newbie 1 12-16-2007 06:54 PM
changing fstab tizwaz Linux - Newbie 3 09-11-2007 11:57 AM
Please read my fstab and then help please! Stevetgn Linux - Newbie 9 06-27-2006 10:24 AM
re-read fstab the-chains Linux - Newbie 2 11-13-2004 03:49 PM
fstab file to allow all users to read ntfs jza Linux - General 1 01-29-2004 03:05 PM


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