[ Bloke.com || Linux || JavaScript || Java || Volleyball || Link Me ]
Free: [ Guestbook || MessageBot || Plugins || Counter || AusPrices || Advertise ]
www.bloke.com

Home - Linux - Booting

don't try this yourself.

Information on booting into single user mode: Usually without needing the root password, but need phsyical access to the machine.

LILO:

If you are using the graphic version, press <Ctrl%gt;-x, to get to the text version. When you get to the boot prompt type linux single
boot: linux single
or
boot: linux emergency

GRUB:

Select the kernel you want, and press 'e' Then select the line that looks like:
kernel /vmlinuz-2.4.18-5smp ro root=/dev/hda8
press 'e' again .. then add "single" to the end and hit enter. The line should then look like:
kernel /vmlinuz-2.4.18-5smp ro root=/dev/hda8 single
now press 'b' to boot in single user mode.. done.

When you are done (in either mode), exit the shell to resume the normal startup.

Configuring GRUB to have single user boot option

Watch out! This makes it blindingly obvious how to become root without needing the password. The bottom line is that if someone has physical access to your machine, they can become root. But this makes it too easy!

So, given that you do want to set this up ahead of time, you can an entry into /etc/grub.conf. Just copy the kernel entry you want, change the title, and add the keyword "single" to the end of the line. Here is my /etc/grub.conf file.

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/hda8
#          initrd /initrd-version.img
#boot=/dev/hda
default=0
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz

title Red Hat Linux (2.4.18-5smp)
	root (hd0,0)
	kernel /vmlinuz-2.4.18-5smp ro root=/dev/hda8
	initrd /initrd-2.4.18-5smp.img

title Single User RH (2.4.18-5smp)
	root (hd0,0)
	kernel /vmlinuz-2.4.18-5smp ro root=/dev/hda8 single
	initrd /initrd-2.4.18-5smp.img
So I added the last 4 lines...

For more information check out the redhat link below.

Copy grub to another drive

Lucky me, I installed winblows 7, and centos 5.4, and the boot drive worked out to be my SSD (/dev/hda), rather than the regular drive (/dev/sda). So I don't want it to boot from the ssd.

Solution, make it boot from the other drive. So install grub on that other drive. after a backup ...

grub-install /dev/sda
which then output:
[root@cowp /]# grub-install /dev/sda
Installation finished. No error reported.
This is the contents of the device map /boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.

# this device map was generated by anaconda
(hd0)     /dev/hda
(hd1)     /dev/sda
[root@cowp /]#
so I removed the /dev/hda line and ran grub-install /dev/sda again. Then I changed my bios to have it boot from the other drive.

See Also:

Links:

Last Change: Monday, 11-Jan-2010 00:49:06 EST

Disclaimer

The information provided within these pages is provided AS IS, and without any warranty. Following these directions may (but not limited to) crash your computer, delete all the information on your hard disk, open up security holes or cause your house to burn down. I made these pages to provide some information about the setup that I have done, but I did not proofread it for correctness, and in most cases did not test it. There are commands in these pages that would definately delete or corrupt all the data on your computer (especially the dualboot section). In fact it happened to me.... So you are on your own!


Cameron Gregory