Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to repaire Linux OS before login into shell?

Posted on 2008-10-10
6
Medium Priority
?
340 Views
Last Modified: 2012-05-05
I have a linux box, but when it startups, a service inform error (Samba share : mount: No route to host...) and It can't run over this error, I press Ctrl + C, but not effect.

I want to access /etc/fstab or other files to delete the startup of service, but how to access these file when can't login into shell?

Thanks in advanced!
0
Comment
Question by:star6868
6 Comments
 
LVL 38

Accepted Solution

by:
wesly_chen earned 1000 total points
ID: 22692903
What kind of Linux distribution do you have? Fedora, SuSE, CentOS or Ubuntu?

Anyway, if your boot loader is Grub, then
1. On boot up menu,  press "E" twice then type "single" at the end of the line start with "kernel..." i.ie.
  kernel /vmlinuz-<version> ro root=... rhgb quiet single    <==== "single" here
2. Then press "Enter" and "b"  to boot into single user mode.
3. Then you can edit /etc/fstab or do whatever.
in single user mode, do
# mount -o remount,rw /
if you can not save your change.
0
 
LVL 12

Expert Comment

by:ibu1
ID: 22692908
log into linux single user mode.Here are the steps
http://www.cyberciti.biz/faq/grub-boot-into-single-user-mode/
At the prompt type
# mount -o remount, rw /    (this will help u to remount the file system into the read/write mode)
# vi /etc/fstab
(Here u can make necessary changes)
# reboot  

Cheere!!!!!
0
 
LVL 19

Expert Comment

by:jools
ID: 22693587
Sounds like it's trying to mount a smb filesystem on another system.

It will eventualy time out but go for the single user mode as mentioned above (note you can also press `a` to append and then type ` 1` and enter to boot) or you could try one of the other terminals (try pressing alt + F2 or alt+F3).

You shouldnt need to mount root rw in single user mode as far as I remember.

Then remove the offending mount from the fstab file (also mentioned above).

Is there a reason that the mount existed in the first place?
0
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

 

Author Comment

by:star6868
ID: 22696285
I have 2 Linux BOX meet this problem, that 's Centos 5.2 and Asianux 2( RHEL4)

I try your sollutions, but It's seem not effect.

Or I miss something?

0
 
LVL 19

Expert Comment

by:jools
ID: 22697656
If it's not working then you need to post more information, logs, errors etc.
0
 

Author Comment

by:star6868
ID: 22720866
@wesly_chen

I run over this error!

I retest and discover my mistake:
Not only add "single", but add "quiet single" if have not "quiet",
and If command have "quite" so only add "single"


0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Fine Tune your automatic Updates for Ubuntu / Debian
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

927 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question