Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Distribution: RHEL 5.1 on My PC, & SunOS / Sun Solaris, RHEL, SuSe, Debian, FreeBSD and other Linux flavors @ Work
Posts: 400
Rep:
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
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.
Distribution: RHEL 5.1 on My PC, & SunOS / Sun Solaris, RHEL, SuSe, Debian, FreeBSD and other Linux flavors @ Work
Posts: 400
Original Poster
Rep:
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.
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.
Distribution: RHEL 5.1 on My PC, & SunOS / Sun Solaris, RHEL, SuSe, Debian, FreeBSD and other Linux flavors @ Work
Posts: 400
Original Poster
Rep:
Quote:
Originally Posted by MensaWater
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?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.