LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   help! I have very bad feeling about this... (http://www.linuxquestions.org/questions/linux-newbie-8/help-i-have-very-bad-feeling-about-this-4175444361/)

yaximik 01-06-2013 08:25 AM

help! I have very bad feeling about this...
 
I use two usb drives attached to my RHEL58 box for data and database storage, which I mounted manually (using mount) to two directories /media/A and /media/B. After mounting they showed up on desktop and automounted upon reboot just fine. Bot occasionally upon reboot, while both drives show up on desktop as usual, are mounted to new directories created by system in /mount. This results in broken links and references for programs that used them.

The obvious solution was to modify /etc/fstab to stop this from happening, which I did referring for correct entries to a textbook. I did this remotely logged as root over VNC and then rebooted the system. Now I cannot connect to the server over VNC, ssh, or even ping it.

I am afraid that somehow I inadvertently messed up some important part of fstab and the box cannot complete booting. The original fstab is still there as /etc/fstab~, but how I can return to it if the machine cannot boot? I am going to the office to confirm that and try to fix the problem - please advise what can and needs to be done.

goumba 01-06-2013 08:43 AM

Do you remember what device the root fs is on? You could probably get away with passing root=device to the grub/lilo line at boot and get in that way if all else fails. Then you can get access to /etc assuming it's on the same device as root (I always do in practice), and fix fstab or copy fstab~ to fstab.

TB0ne 01-06-2013 09:37 AM

Quote:

Originally Posted by yaximik (Post 4863912)
I use two usb drives attached to my RHEL58 box for data and database storage, which I mounted manually (using mount) to two directories /media/A and /media/B. After mounting they showed up on desktop and automounted upon reboot just fine. Bot occasionally upon reboot, while both drives show up on desktop as usual, are mounted to new directories created by system in /mount. This results in broken links and references for programs that used them.

The obvious solution was to modify /etc/fstab to stop this from happening, which I did referring for correct entries to a textbook. I did this remotely logged as root over VNC and then rebooted the system. Now I cannot connect to the server over VNC, ssh, or even ping it.

I am afraid that somehow I inadvertently messed up some important part of fstab and the box cannot complete booting. The original fstab is still there as /etc/fstab~, but how I can return to it if the machine cannot boot? I am going to the office to confirm that and try to fix the problem - please advise what can and needs to be done.

You unplug the USB drives, boot from CD/DVD into rescue mode, mount your system drive manually, and undo the fstab changes. That's the easiest way to do it, in my opinion. And what does Red Hat support say about this? Since you're using RHEL, you are paying for it, right?

yaximik 01-06-2013 03:35 PM

[SOLVED]help- I have bad feeling about this...
 
Ouch! It was not that bad, but the system could not complete boot as one of USB drives (ext2) for some reason had a bad superblock, so boot was aborted and dropped in shell. When I get to the office and logged in as root it moved into the filesystem recovery mode. All vital systems checked clean by fsck, except this USB drive with ext2. I had to
Code:

mount -o remount,rw /
to restore read/write access and then I could replace the offending fstab with its backup copy. The box booted normally.
Then I fixed the offending disk (unmounted) with
Code:

fsck /dev/sdc1
and also replaced the ext2 with ext3 and replaced its UUID, just in case
Code:

tune2fs -j -U time /dev/sdc1
Then I updated the corresponding line in /etc/fstab and rebooted - all worked fine.


All times are GMT -5. The time now is 02:49 AM.