chroot failure

Issues related to software problems.
dichar
Posts: 10
Joined: 2014/07/14 01:24:21

chroot failure

Post by dichar » 2014/07/14 01:44:22

Hello guys,

I hope you can help me. I m a newbei in this area.
The Asteriks system was dead on a running centos 5.4 server. I v reboted the system and centos cannot start any more. After trying to scan the system it stops at 4.5% and asks to run fsck manually after loging in as a admin. But the password was forgotten. So
Using a rescue disk I wanted to change the passwod. The following steps were followed:

mkdir /root/myhdd

mount /dev/sda0 /root/myhdd

changing my root directory

chroot /root/myhdd

After this last command, the next error was issued, Cannot execute /bin/sh: no such file or directory

Please tell me how to recover go further.

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: chroot failure

Post by gerald_clark » 2014/07/14 02:20:27

1. You are likely not running CentOS but an unsupported clone.
2. 5.4 is ancient.
3. CentOS has no "admin" login.
4. Boot the DVD in rescue mode, Read the onscreen instructions. You should run fsck on the filesystems.

User avatar
TrevorH
Site Admin
Posts: 33215
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: chroot failure

Post by TrevorH » 2014/07/14 03:16:08

I doubt very much if there is such a thing as /dev/sda0
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

dichar
Posts: 10
Joined: 2014/07/14 01:24:21

Re: chroot failure

Post by dichar » 2014/07/14 11:31:16

Thank you very much guys for your repaly.

I will try to replay to your interactions guys.

1- The linux operating system is a centos one. The number of version can be a little bit different but I m sure it is not a clone. It has been running for more then 4 years.
and my telecom system was running on it. And you are right, it is an old version.

2-With admin login, I ve ment root, as I m not a professional in linux

3- Running linux rescue mode by use if a DVD that was the only way I could enter the partitions to try to use the fsck, but the command was not recognized like I said.

Trevorti

You are right it was a typo. it should be a sda1 instead of sda0.

Hier bellow I will add a printscreen of the failure.
centos.jpg
centos.jpg (31.47 KiB) Viewed 8732 times

User avatar
TrevorH
Site Admin
Posts: 33215
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: chroot failure

Post by TrevorH » 2014/07/14 11:54:36

Boot from the rescue disk and do not mount the installed system's filesystems - it asks if it should, say no. Once that has booted, drop to a command shell and run fsck -f manually from the rescue prompt. Fix the issue that way then boot normally, become root and change the root password.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: chroot failure

Post by gerald_clark » 2014/07/14 13:02:18

Don't chroot or even mount the filesystems. If you do you will not be able to run fsck on them.

dichar
Posts: 10
Joined: 2014/07/14 01:24:21

Re: chroot failure

Post by dichar » 2014/07/14 13:26:40

I ve used the rescue mode using the linux rescue DVD.
I ve chosed the skiped option when using the rescue mode.
then I ve made a directory and tried to make as root. But I ve got that error that mentions that the command is not known.

User avatar
TrevorH
Site Admin
Posts: 33215
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: chroot failure

Post by TrevorH » 2014/07/14 13:27:40

You need to run fsck from the rescue environment not mount the filesystem.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

dichar
Posts: 10
Joined: 2014/07/14 01:24:21

Re: chroot failure

Post by dichar » 2014/07/14 13:48:10

From the rescue enviroment; you mean using thse Continue or skip option when using the rescue DVD.

User avatar
TrevorH
Site Admin
Posts: 33215
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: chroot failure

Post by TrevorH » 2014/07/14 13:57:06

Yes, from the rescue environment: that is what it's for! Do not mount the installed system, tell it to skip that step. Once booted, drop to the rescue command prompt and run fsck -f from there. You may also need to run lvm vgchange -a y to activate the logical volumes so that you can see them in order to fsck them.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply