# [RESOLVED] Can't boot after electricity failure

## phoenix_me

My PC was hibernated. (hibernate-ram). During the hibernation there was an electricity failure (shortage). Right now when I am trying to boot the kernel is booting and then I have the following message:

```
sh: cannot set terminal process group (-1): Inappropriate ioctl for device

sh: no job control in this shell

sh-4.2# _
```

I have no idea what to do and what's wrong ! Please help.

----------

## Hu

We need more information.  What kernel version are you running?  What else is shown on screen before that?  Do you use a custom initramfs or was it generated for you?  Were you hibernating or sleeping?  You say hibernate, but then you say you used the command that puts the system into a suspend-to-RAM ("sleep") state.  Was the power failure while the system was entering sleep mode or while it was sleeping?

----------

## NeddySeagoon

phoenix_me,

Your system died with files open, as hibernate preserves the system state in RAM, so it can be resumed.

Boot with a liveCD. Do not mount any of your filesystems.

Run fsck on your root partition but do not allow fsck to 'fix' anything.

Just report the problems it finds.

fsck can often make matters worse.

What happens next, and if it can be recovered in place depends on the errors any your filesystem type.

Having a disk image or a full backup is a really good idea.

You really need an undo facility before you allow fsck to change your damaged filesystem.

Its safe to attempt mount -o ro /dev/sda3 /mnt/gentoo  so you can have a look around and copy files off.

----------

## phoenix_me

 *Hu wrote:*   

> We need more information.  What kernel version are you running?  What else is shown on screen before that?  Do you use a custom initramfs or was it generated for you?  Were you hibernating or sleeping?  You say hibernate, but then you say you used the command that puts the system into a suspend-to-RAM ("sleep") state.  Was the power failure while the system was entering sleep mode or while it was sleeping?

 

It was sleep mode (hibernate-ram). The system was in sleep mode for some time and then there was a power failure.

Last lines from dmesg

```
....

VFS: Mounted root (ext3 filesystem) readonly on device 8:2

Freeing unused kernel memory: 492 freed

Write protecting the kernel read-only data: 8192k

Freeing unused kernel memory: 884k freed

Freeing unused kernel memory: 468k freed
```

Seems like no INIT process starts. I found also that I don't have /etc/inittab file !

----------

## phoenix_me

I found the issue!

There was TWO issues at the time.

The first was electricity failure and I thought that it was main reason but it wasn't.

Seems like during the hibernate-ram system was doing emerge ! And is seems like the old sysvinit package was deleted and new one was not deployed yet. Then the hibernate-ram happened. There should be everything ok when resumed from sleep state but unfortunately there was a power issue and my system left without a sysvinit package. 

Now I already reinstalled it and everything is working like a charm. 

thanks...

----------

## billium

I'm going to be honest here and admit doing something slightly silly   :Embarassed: 

Just did a world update and there was a block with sysvinit, so I thought I would unmerge the current sysvinit, then re-emerge.

Sadly I forgot to re-emerge sysvinit and got this error.

Fortunately I had another Gentoo with the sysvinit tarball.

All working now though.

----------

## alegioit

 *billium wrote:*   

> I'm going to be honest here and admit doing something slightly silly  
> 
> Just did a world update and there was a block with sysvinit, so I thought I would unmerge the current sysvinit, then re-emerge.
> 
> Sadly I forgot to re-emerge sysvinit and got this error.
> ...

 

Same here guys! You've saved me about 2 hours of searching and ranting! Thanks!

----------

## enzake

 *billium wrote:*   

> I'm going to be honest here and admit doing something slightly silly  
> 
> Just did a world update and there was a block with sysvinit, so I thought I would unmerge the current sysvinit, then re-emerge.
> 
> Sadly I forgot to re-emerge sysvinit and got this error.
> ...

 

Hello,

I have the same problem, my system don't want to boot anymore and i remember that i've uninstalled something that was blocking something else with a name like sysinit etc when i was emerge world. So when the power went down the problem is here.  :Smile:  how can i reinstall that sysvinit again or what i must do to make my gentoo work/boot again without this error?

thanks

----------

## Freeky

1) Boot from any LiveCD.

1a) Check your partitions (fsck, for example)2) Chroot to your system.

3) Reemerge sysvinit.

4) Exit from chroot.

5) Reboot to your system from hdd.

----------

## enzake

 *Freeky wrote:*   

> 1) Boot from any LiveCD.
> 
> 1a) Check your partitions (fsck, for example)2) Chroot to your system.
> 
> 3) Reemerge sysvinit.
> ...

 

hello,

i found another thing:

/sbin/rc sysinit

/sbin/rc boot

/sbin/rc default

/sbin/agetty 38400 tty1 linux

it worked to enter on my system and from there i was able to emerge again sysvinit

thanks!  :Smile: 

----------

