本教程适合debian系列系统.
必要条件:
- /etc/default/grub(以下是默认的)
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'
GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX="initrd=/install/initrd.gz"
# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"
# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console
# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480
# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true
# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"
# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"
2./etc/grub.d/(默认)
- 00_header
- 05_debian_theme
- 10_linux
- 20_linux_xen
- 30_os-prober
- 30_uefi-firmware
- 40_custom
- 41_custom
使用kali安装盘启动救援模式
可以直接打开livecd进行操作.打开终端,默认即为root然后依次输入并执行以下命令
注:sda1为所在kali分区,先挂载原系统,这里kali仅安装在一个分区中,如果有不同,请根据实际情况挂载到/mnt相应的目录下,
注意:kail中,挂载完毕以后,需要执行相应的挂载
/dev,
,/dev/pts
/proc ,
,以便在子系统中可以执行相应的炒作,否则不会成功.这个和某些系统比如archlinux系统不相同./sys
# mount /dev/sda1 /mnt/
# mount --bind /dev /mnt/dev/
# mount --bind /dev/pts /mnt/dev/pts
# mount --bind /proc /mnt/proc
# mount --bind /sys /mnt/sys
转至原系统根目录
# chroot /mnt/
安装grub并刷新,如果有,则不用装
# grub-install /dev/sda
更新grub.cfg,并退至启动盘根目录
# update-grub
# exit
虽然无关紧要,但请养成一个良好的习惯,解挂
# umount /mnt/dev/pts
# umount /mnt/dev
# umount /mnt/proc
# umount /mnt/sys
# umount /mnt
重启电脑即可
# reboot