|
Home | Switchboard | Unix Administration | Red Hat | TCP/IP Networks | Neoliberalism | Toxic Managers |
(slightly skeptical) Educational society promoting "Back to basics" movement against IT overcomplexity and bastardization of classic Unix |
News | /etc/fstab/ | Recommended Links | Ext2-Ext3-Ext4 Attributes | Filesystem mount options |
Troubleshooting Errors in /etc/fstab | Linux Logical Volume Snapshots | tmpfs | Humor | Etc |
|
Sometimes if there are errors in /etc/fstab the system can't boot properly and come in rescue mode. In this mode the only drive (root) is mounted as read-only. that's why many monitoring system such as HP Operation manager (former OpenView) typically have probes that monitor content of /etc/fstab and report about problem before server rebooted.
To remount the root volume as RW, to make changes you can use the command:
mount -o remount,rw /
|
Than means that it is important to check if /etc/fstab entries are correct for new partitions by first un-mounting them them and then trying to mount using
mount -a
Remember that the mount point must already exist, otherwise the entry will not mount on the filesystem
Again, system with incorrect /etc/fstab usually boot to safe mode with root filesystem mounted as read only.
There can be other reasons. For example if NAS storage goes south, or NAS server spontaneously rebooted. In this case NAS partition is the culprit, not the errors in /etc/fstab.
In this case the best option is to have "last good" configuration to compare.
Some useful information can be recovered from dmesg. The dmesg command is used to write the kernel messages in Linux and other Unix-like operating systems to standard output (which by default is the display screen). Here is some recommendation on how to use it (How to use the dmesg command -- by The Linux Information Project (LINFO) ):
The dmesg command is used to write the kernel messages in Linux and other Unix-like operating systems to standard output (which by default is the display screen).
A kernel is the core of an operating system. It is the first part of the operating system that is loaded into memory when a computer boots up (i.e., starts up), and it controls virtually everything on a system. The numerous messages generated by the kernel that appear on the display screen as a computer boots up show the hardware devices that the kernel detects and indicate whether it is able to configure them.
dmesg obtains its data by reading the kernel ring buffer. A buffer is a portion of a computer's memory that is set aside as a temporary holding place for data that is being sent to or received from an external device, such as a hard disk drive (HDD), printer or keyboard. A ring buffer is a buffer of fixed size for which any new data added to it overwrites the oldest data in it.
dmesg can be very useful when troubleshooting or just trying to obtain information about the hardware on a system. Its basic syntax is
dmesg [options]
Invoking dmesg without any of its options (which are rarely used) causes it to write all the kernel messages to standard output. This usually produces far too many lines to fit into the display screen all at once, and thus only the final messages are visible. However, the output can be redirected to the less command through the use of a pipe (designated by the vertical bar character), thereby allowing the startup messages to be viewed one screenful at a time:
dmesg | less
less allows the output to be moved forward one screenful at a time by pressing the SPACE bar, backward by pressing the b key and removed by pressing the q key. (The more command could have been used here instead of the less command; however, less is newer than more and has additional functions, including the ability to return to previous pages of the output.)
When a user encounters a problem with the system, it can be convenient to write the output of dmesg to a file and then send that file by e-mail to a system administrator or other knowledgeable person for assistance. For example, the output could be redirected to a file named boot_messages using the output redirection operator (designated by a rightward facing angle bracket) as follows:
dmesg > boot_messages
Because of the length of the output of dmesg, it can be convenient to pipe its output to grep, a filter which searches for any lines that contain the string (i.e., sequence of characters) following it. The -i option can be used to tell grep to ignore the case (i.e., lower case or upper case) of the letters in the string. For example, the following command lists all references to USB (universal serial bus) devices in the kernel messages:
dmesg | grep -i usb
And the following tells dmesg to show all serial ports (which are represented by the string tty):
dmesg | grep -i tty
The dmesg and grep combination can also be used to show how much physical memory (i.e., RAM) is available on the system:
dmesg | grep -i memory
The following command checks to confirm that the HDD(s) is running in DMA (direct memory access) mode:
dmesg | grep -i dma
The output of dmesg is maintained in the log file /var/log/dmesg, and it can thus also be easily viewed by reading that file with a text editor, such as vi or gedit, or with a command such as cat, e.g.,
cat /var/log/dmesg | less
Availability of the baseline of the configuration, even in the simplest form of tarball for /etc/directory done each your login from ~/.profile script is also very helpful. In this case you can exactly pinpoint what changes were made to /etc/fstab and do not need to guess. You can just diff the "last good" configuration with the current and see what changes were made. This is especially important if there are many cooks on the same kitchen or when you need to troubleshoot a server for which primary sysadmin is on vacation and you have only cursory knowledge what this server is for and how filesystems are used.
See also
|
Switchboard | ||||
Latest | |||||
Past week | |||||
Past month |
It's telling you that you can't write, because the filesystem was mounted read-only. Logically, you want to remount it with writes enabled, if you want to write.
mount -o remount,rw <your_root_partition such as /dev/sda#> /
To just give my feedback, I wanted to use the vi editor to change the fstab file but I couldn't, because of the read only problem.
I tried to remount the volume, but there was something wrong about what I did. No luck either to copy my fstab.bak file back to fstab. The read only curse.
So, I tried the following and it actualy worked much better than I hoped: During the GRUB listing I pressed "e" for editing the commands before booting and I changed the "ro" argument for the drive to rw. Then, I pressed ctrl-x to boot.
I expected to confront the same "waiting to mount" error, but I didn't. The system started as normally did.
I sudo gedit-ed the fstab file back to the original with a smile from one ear to another and rebooted.
The GRUB file was back to the original "ro" (read only) argument and I just came to register to the forum to write about it, since I 've read about your solution by my phone.
I should say I am using karmic koala with GRUB 1.97
Idea #18468: Be able to boot into recovery mode and fix malformed /etc/fstab
- Description
- Report duplicate
- Help promote this idea!