Revision [2362]
Last edited on 2009-07-04 03:12:01 by WikiAdminAdditions:
==[[LinuxGrub2 Grub2]]==
Revision [2305]
Edited on 2009-05-24 22:42:05 by WikiAdminAdditions:
ref http://www.tuxation.com/mbr-tricks-with-linux.html
Revision [2276]
Edited on 2009-04-14 01:51:47 by WikiAdminAdditions:
===Backup MBR===
The first 512b contains partition table and the MBR. First 448b contains the MBR only.
dd if=/dev/sda of=mbr.img bs=448 count=1
The first 512b contains partition table and the MBR. First 448b contains the MBR only.
dd if=/dev/sda of=mbr.img bs=448 count=1
Revision [2207]
Edited on 2009-02-16 01:23:34 by WikiAdminAdditions:
mkbootdisk --device /rescue.iso --verbose --iso 2.6.28.1
Deletions:
Revision [2206]
Edited on 2009-02-16 01:21:41 by WikiAdminAdditions:
===Rescue / emergency boot disc===
It is a good idea to make such a boot disc especially when you have custom kernel with extra filesystem and storage controllers enabled. On your running system, run the following to create an iso, which can then be cut to a cd disc:
mkbootdisk --device /rescue.iso --verbose --iso --kernelargs "init=/bin/bash" 2.6.28.1
It is a good idea to make such a boot disc especially when you have custom kernel with extra filesystem and storage controllers enabled. On your running system, run the following to create an iso, which can then be cut to a cd disc:
mkbootdisk --device /rescue.iso --verbose --iso --kernelargs "init=/bin/bash" 2.6.28.1
Revision [2205]
Edited on 2009-02-14 10:35:47 by WikiAdminAdditions:
===Messing with initrd===
If you clone / migrate your system to a different box which uses a different storage card, you may need to edit the initrd file to add load the necessary modules.
# back it up first!!
cp initrd-2.x.x.img initrd-2.x.x.img-bak
# extract the image to temp
mkdir temp
cd temp
zcat ../initrd-2x.x.img | cpio -idmv
# do what you have to. e.g. edit init to load a certain module, copy that module to temp/lib
# then pack the image
find . | cpio --create --format=newc > /boot/initrd-2.x.x-new.img
If you clone / migrate your system to a different box which uses a different storage card, you may need to edit the initrd file to add load the necessary modules.
# back it up first!!
cp initrd-2.x.x.img initrd-2.x.x.img-bak
# extract the image to temp
mkdir temp
cd temp
zcat ../initrd-2x.x.img | cpio -idmv
# do what you have to. e.g. edit init to load a certain module, copy that module to temp/lib
# then pack the image
find . | cpio --create --format=newc > /boot/initrd-2.x.x-new.img
Revision [1534]
Edited on 2008-03-26 05:46:16 by WikiAdminAdditions:
**Sub topics**
==[[LinuxBootParameters Useful boot time parameters]]==
==[[LinuxBootParameters Useful boot time parameters]]==
Revision [1400]
Edited on 2008-02-12 21:08:28 by WikiAdminAdditions:
==Boot from grub prompt==
The key is to point grub to the right partition. If the root parameter points to a partition other than /, system will halt with a kernel panic error.
grub> root (hd0,1)
grub> kernel /vmlinuz root=/dev/cciss/c0d0p1 ro vga=791
grub> boot
The key is to point grub to the right partition. If the root parameter points to a partition other than /, system will halt with a kernel panic error.
grub> root (hd0,1)
grub> kernel /vmlinuz root=/dev/cciss/c0d0p1 ro vga=791
grub> boot
Revision [802]
Edited on 2007-07-25 18:33:27 by WikiAdminAdditions:
==Fix grub in grub prompt==
[root@www root]# grub
grub> find /boot/grub/stage1
(hd0,0)
grub> root (hd0,0)
Filesystem type is ext2fs, partition type 0x83
grub> setup (hd0)
[root@www root]# grub
grub> find /boot/grub/stage1
(hd0,0)
grub> root (hd0,0)
Filesystem type is ext2fs, partition type 0x83
grub> setup (hd0)
Revision [487]
Edited on 2007-05-07 05:13:38 by WikiAdminAdditions:
You can also configure grub to do fallback boot. See Grub's manual http://www.gnu.org/software/grub/manual/grub.html#Booting-once_002donly
Deletions:
Revision [486]
Edited on 2007-05-07 05:13:04 by WikiAdminAdditions:
Essentially, when entry #1 is booted, it will instruct grub to boot from entry #0 on next boot. Save grub.conf and then do a
Deletions:
Revision [485]
Edited on 2007-05-07 05:11:22 by WikiAdminAdditions:
===Setting up a boot-once grub session===
It's very useful to setup grub to boot to a specific kernel only once, to perhaps test out a newly compiled kernel. Setup your grub.conf like this
default saved # This is important!!!
timeout 10
title the old kernel
root (hd0,0)
kernel /old_kernel
savedefault
title the new kernel
root (hd0,0)
kernel /new_kernel
savedefault 0 # This is important!!!
Save this file and then do a
grub-set-default 1
You can also configure grub to do failsave boot. More information on Grub's manual http://www.gnu.org/software/grub/manual/grub.html#Booting-once_002donly
It's very useful to setup grub to boot to a specific kernel only once, to perhaps test out a newly compiled kernel. Setup your grub.conf like this
default saved # This is important!!!
timeout 10
title the old kernel
root (hd0,0)
kernel /old_kernel
savedefault
title the new kernel
root (hd0,0)
kernel /new_kernel
savedefault 0 # This is important!!!
Save this file and then do a
grub-set-default 1
You can also configure grub to do failsave boot. More information on Grub's manual http://www.gnu.org/software/grub/manual/grub.html#Booting-once_002donly