LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   turn off maching? (https://www.linuxquestions.org/questions/linux-software-2/turn-off-maching-129235/)

Computergirl24 12-27-2003 08:15 AM

turn off maching?
 
ok, i have an old computer with a noisy fan, so i turn it off every night. when i'm running windows this is easy, start, shutdown. in linux, i'm not quite sure what i'm doing. here's what i did, i don't know if it's right. i had been logged in as root, trying to setup a user account. i went to single user mode, then typed in telinit 0 to go to runlevel 0. this stopped a bunch of stuff and made my hard drive stop spinning. i then turned my maching off, is this ok, or are there other things i have to do before cutting the power to my machine?
thanks in advance,
E

druuna 12-27-2003 08:27 AM

You don't need to go to runlevel 1 first, an init 0 from any terminal is enough. You do need to be root to do this.

tyg 12-27-2003 08:46 AM

The easiest way is to shutdown or reboot the computer is by doing "halt" or "reboot" as root

Computergirl24 12-28-2003 08:02 AM

ok, but reboot does what it says, it reboots the machine. during a reboot, when is it safe to turn off the power to the machine with out hurting anything?

druuna 12-28-2003 08:15 AM

You should not turn of your box when you run a 'bare' reboot.

A few possibilities to turn off your box:
- init 0
- halt
- shutdown -h now
There are more, but these will do.

Please check the manpage (man reboot and/or man shutdown and/or man init).

You should never ever turn of your box when it is running! Only when linux tells you it is safe to turn-off your box you can do so. Ok, that's a bit strong, but you can damage your partitions if you do so.

Computergirl24 12-28-2003 08:04 PM

i know that. i've been running init 0 or telinit 0 to shut it down, but linux never tells me its ok to shut my machine down. i just shut it down after it seems like the system isnt doing anything.

doralsoral 12-28-2003 10:48 PM

just type shutdown -h now as root

Computergirl24 12-29-2003 05:50 PM

ok

Computergirl24 01-05-2004 07:37 AM

that works, but at what point like during boot is it safe to cut the power to a machine?

DrOzz 01-05-2004 08:35 AM

i would say for percautionary reasons, probably before you make a selection at your grub or lilo boot selection ... so basically that is saying when your computer is still in its POST, that that would be the only real safe time when you could hit the power button... after the selection at your grub/lilo menu you have started the initialization, and i would have to say cuttin power within that, would be the same as cuttin power when its complete, if not more harmful....
so the long and short of all this is, i would say there is no safe time, if you already started the boot process ... wait until the boot process is complete and then issue shutdown -h now ... never cut power during boot..

Computergirl24 01-05-2004 07:41 PM

ok, thanks, that's exactly what i was looking for
:)
E

Tinkster 01-05-2004 08:02 PM

How old is the machine, does it support APM?
If so, all you probably need to do is to recompile
your kernel with built-in APM support, then a
halt or init 0 will actually switch the bugger off,
too ;)


Cheers,
Tink

Doomhammer 01-05-2004 10:05 PM

Just do halt -p


All times are GMT -5. The time now is 07:32 PM.