LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
LinkBack Search this Thread
Old 02-07-2012, 06:24 AM   #1
devUnix
Member
 
Registered: Oct 2010
Location: Bengaluru, India
Distribution: RHEL 5.1 on My PC, & SunOS / Sun Solaris, RHEL, SuSe, Debian, FreeBSD and other Linux flavors @ Work
Posts: 400

Rep: Reputation: 41
Playing with /etc/fstab


--->
(Gurus and Experienced users can ignore this disclaimer)

DISCLAIMER: DO NOT DO THESE ACTIVITIES ON A PRODUCTION OR DEVELOPMENT SYSTEM. TRY THEM, IF YOU WISH TO, ON A TEST MACHINE THAT YOU CAN REPLACE WITH SOME OTHER ONE OR BUILD A NEW ONE IF IT DIES WHILE PLAYING WITH IT.

--->

Problem Statements go here:

I am running CentOS Linux 6.0 on a VM under VirtualBox.

[1] Problem#1

Just for fun, as it is my test machine, I commented out the "/" mount/partion in "/etc/fstab" and rebooted the machine. to my surprise, it rebooted without any complains. How comes it? Is that an expected outcome? Without mounting "/" how can a Linux Box boot or present log-in screen or prompt?


[2] Problem#2

I then commented out "/boot" and it did what I expected it to. So, I entered Single User Mode and also did "chroot" to edit the file "/etc/fstab" but it (vi, here) keeps reporting that it can't save the changes as the file is "read-only" however it "root" is having "read/write" permissions to it as it would anyhow.

Well, now I am not able to boot the system normally. I wanted to do it. Now I want to figure out how to get it up again.

Note: Did you ever do such experiments? Would you like to share yours too?

Last edited by devUnix; 02-07-2012 at 11:42 AM. Reason: Added the Disclaimer
 
Old 02-07-2012, 09:27 AM   #2
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 5,195

Rep: Reputation: 469Reputation: 469Reputation: 469Reputation: 469Reputation: 469
When all else fails the system will attempt to mount "/" - this is what allows you to boot into single user even when many things are failing.

Are you sure the / is mounted read/write? Have you tried doing "mount -o remount,rw /" to remount it as read/write? Often if it can't be sure the filesystem is OK it will mount read only to prevent corruption and the remount will let you change it to read/write.
 
Old 02-07-2012, 10:00 AM   #3
fritz001
Member
 
Registered: Aug 2004
Posts: 100

Rep: Reputation: 18
in case of "major" FS problem, system is rebooted in single mode and / is mounted as read-only

to do any changes, u have to remount as RW:: mount -o remount,rw /
 
Old 02-07-2012, 11:33 AM   #4
devUnix
Member
 
Registered: Oct 2010
Location: Bengaluru, India
Distribution: RHEL 5.1 on My PC, & SunOS / Sun Solaris, RHEL, SuSe, Debian, FreeBSD and other Linux flavors @ Work
Posts: 400

Original Poster
Rep: Reputation: 41
Remounting "/" as r/w is also not working- the command is failing in the single user mode:


Code:
[root@localhost /]# mount -o remount,rw /
mount: can't find / in /etc/fstab or /etc/mtab

[root@localhost /]# chroot /

sh-4.1# mount -o remount,rw /
mount: can't find / in /etc/fstab or /etc/mtab
 
Old 02-07-2012, 11:38 AM   #5
devUnix
Member
 
Registered: Oct 2010
Location: Bengaluru, India
Distribution: RHEL 5.1 on My PC, & SunOS / Sun Solaris, RHEL, SuSe, Debian, FreeBSD and other Linux flavors @ Work
Posts: 400

Original Poster
Rep: Reputation: 41
There used to be a time when I would delete some system files such as grub.conf and would build them from the scratch in single user mode. I mean I knew every word and line found in the said file, for example. Playing with boot loaders etc. I used to love doing those activities. Ever since I got into development role, I forgot them. I just recalled something this and it worked:

Code:
sh-4.1# mount -t ext4 /dev/sda1 / -o remount,rw
Only saying "mount /" would not work as "something somewhere" needs to be taken care of.

Last edited by devUnix; 02-07-2012 at 11:45 AM.
 
1 members found this post helpful.
Old 02-07-2012, 03:16 PM   #6
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 5,195

Rep: Reputation: 469Reputation: 469Reputation: 469Reputation: 469Reputation: 469
Right - if you say mount / without specifying device or filesystem type it tries to get the information from /etc/fstab. Your latter syntax specified these so didn't need /etc/fstab. I had thought your issue was just a missing /boot in /etc/fstab and hadn't realized / was also missing from the file (or the entire file was missing).

If your issues is resolved please go to thread tools and mark it solved. It helps others with similar problems find solutions more quickly in web searches.
 
Old 02-08-2012, 01:46 AM   #7
devUnix
Member
 
Registered: Oct 2010
Location: Bengaluru, India
Distribution: RHEL 5.1 on My PC, & SunOS / Sun Solaris, RHEL, SuSe, Debian, FreeBSD and other Linux flavors @ Work
Posts: 400

Original Poster
Rep: Reputation: 41
Quote:
Originally Posted by MensaWater View Post
If your issues is resolved please go to thread tools and mark it solved. It helps others with similar problems find solutions more quickly in web searches.
Thanks!


But the question still remains: How comes it that "/" partition is not available then the system is still booting up without any complains and letting users log-in successfully too? If this behavior which is a normal behavior continues then we may not know that there is something wrong with the "/" system in "/etc/fstab/" and how do we identify it?
 
Old 02-08-2012, 05:18 AM   #8
Reuti
Member
 
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 11.4
Posts: 970

Rep: Reputation: 184Reputation: 184
The root partition is for grub defined in /boot/grub/menu.lst AFAIK.
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Suse won't boot after fstab changes - fstab not editable baking-a-77 Linux - Newbie 10 06-02-2007 10:51 AM
fstab problem: mount: can't find dvd in /etc/fstab or /etc/mtab Nikon01 Slackware 5 11-17-2006 06:15 AM
fstab? audio filse not playing on cdrom bvknapp Fedora 1 03-02-2005 07:42 AM
samba and fstab not playing nice kc8tbe Linux - General 3 03-07-2003 03:13 PM


All times are GMT -5. The time now is 06:15 AM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration