LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Changing run levels in the bootloader (https://www.linuxquestions.org/questions/linux-newbie-8/changing-run-levels-in-the-bootloader-22699/)

IceNineJon 06-05-2002 06:39 PM

Changing run levels in the bootloader
 
I'm using GRUB as my bootloader and I want to add a new item to the menu to allow me to boot into the console and not load X. My grub.conf file shows:
Quote:

title Red Hat Linux (2.4.9-31)
root (hd2,0)
kernel /boot/vmlinuz-2.4.9-31 ro root=/dev/hdd1 hdc=ide-scsi
initrd /boot/initrd-2.4.9-31.img
As the entry for my current boot. However, this defaults to runlevel 5 (X11). How can I add an additional entry to the menu to boot into runlevel 3 (ie. so I can choose between X11 or just the consule)?

Additionally, is there a way when I'm in KDE or X11 to shut it down and change to runlevel 3 without rebooting?

Thanks!,
Jon

trickykid 06-05-2002 07:56 PM

not sure of anyway to specify different runlevels from a list like that but you can usually specify what runlevel you want to startup in at the lilo/grub prompt.

and you can use the command init 3 to get to runlevel 3.

dangel 06-05-2002 08:28 PM

First off. To boot into a specific runlevel, edit the /etc/inittab file. You'll see a line similar to this:
---------------------------------
# 1 - Single user mode
# 2 - Multiuser, without NFS (The same as 3, if you do not have networking)
# 3 - Full multiuser mode
# 4 - unused
# 5 - X11
# 6 - reboot (Do NOT set initdefault to this)
id:5:initdefault:
-----------------------------------
Just change 5 to whatever you want to boot into. In your case 3.
--------
Now for the second question. IF you have booted into runlevel 5 Log out of KDE, switch to a consolde by using cntl - alt - f1,
log in as root
and then type init 3. This will change your runlevels to just console mode.

IceNineJon 06-05-2002 09:05 PM

When I log out of KDE and switch run levels, what happens to the xserver? Does it shut down or does it stay running?

trickykid 06-05-2002 11:33 PM

when you enter runlevel 3 it shouldn't start X, so it should end the process.

linuxcool 06-06-2002 12:11 AM

You would add init=3 to the kernel line. Like this:

title Red Hat Linux (2.4.9-31) Runlevel3
root (hd2,0)
kernel /boot/vmlinuz-2.4.9-31 ro root=/dev/hdd1 hdc=ide-scsi init=3
initrd /boot/initrd-2.4.9-31.img

These four lines would be added to your grub.conf file.


All times are GMT -5. The time now is 09:51 PM.