Professional Documents
Culture Documents
ANTFRA
2014
..
. .
. )>.(grub
+ .
. )>.(grub rescue
) (GRUB ) (.
).(Busybox / Initramfs
) + (Busybox / Initramfs .
) ( .
. .
. )(GRUB 2
..
..
..
. ..
..
. :
. ..
..
..
)( . )) .(Fallback (.
..
) (GRUB 2 ) (C ..
) (SHIFT . ) (Esc ) (.
) (set .
) (set pager=1 ) (.
) ( .
) (TAB .
) (.
).(help
).(set color_normal=white/blue
. ) (
.
. .
" ." . .
.) (.
) (.
" GRUB ) (.
) (.
) (.
>grub
>grub rescue
GRUB
)Busybox - (Initramfs
)(splash screen
:
) ( . . . ) (/grub.
.
) .( grub.cfg ) .(prefix
-:
) 1 (2
4 # sudo update-grub
1 # configfile /boot/grub/grub.cfg
2 # configfile (hd0,4)/boot/grub/grub.cfg
).(cfg
.2
..
.3
.4
).(update-grub
. . .). (.
-:
) (grub.cfg .
) (file not found ) (X,Y .
) ( .
)1 # set root=(hdX,Y
2 # linux /vmlinuz root=/dev/sdXY ro
3 # initrd /initrd.img
4 # boot
) (Wubi ) 1 (2:
)1 # set root=(loop0
2 # linux /vmlinuz root=/dev/sdXY loop=/Ubuntu/disks/root.disk ro
) ( :
)(Busybox v1.18.5 (Ubuntu 1:1.18.5-1ubuntu4) built-in shell (ash
Enter 'help' for a list of built-in commands.
)(initramfs
:
) :( Ubuntu
)1 # set root=(hd0,5
) .(sda5
... .
.
... .
3 # initrd /initrd.img
# initrd(hd0,5)/boot/initrd.img-3.8.0-25-generic
4 # boot
. .
):( Arch Linux
)1 # set root=(hd0,5
2 # linux /boot/vmlinuz26 root=/dev/sda5 ro
3 # initrd /boot/kernel26.img
4 # boot
):( Fedora
)1 # set root=(hd0,3
2 # linux (hd0,1)/vmlinuz-3.0.0-1.fc16.i686 root=/dev/sda3 rhgb quiet selinux=0
3 # initrd (hd0,1)/initramfs-3.0.0-1.fc16.i686.img
4 # boot
).( BSD
):( FreeBSD
.FreeBSD
)1 # set root=(/dev/ad4,msdos1
2 # kfreebsd /boot/kernel/kernel
. .
.
3 # kfreebsd_loadenv /boot/device.hints
4 # set kFreeBSD.vfs.root.mountfrom=ufs:/dev/ad4s1a
.
..
. ) .(FreeBSD ) (kfreebsd. .
) (kfreebsd ) (kfreebsd help ).(GRUB
5 # vfs.root.mountfrom.options=rw
6 # boot
):( NetBSD
) . (.
.
)1 # set root=(hd0,msdos1
2 # knetbsd /netbsd --root=wd0a
3 # boot
..
. ) (NetBSD ) (knetbsd.
) (knetbsd ) (knetbsd help ).(GRUB
):( Windows XP
. ) (
.
)1 set root=(hd0,msdos1
}2 drivemap -s (hd0) $ {root
. ..
3 chainloader +1
4 boot
.
. /
) (grub.cfg ).(cfg
) (GRUB 2 ) (/GRUB .
)= ( root . ) (ls /
.
) ( ) (.
)
(selinux=0 ) . (.
. . ).(grub rescue
) ( ) . .(GRUB 2
. /
. ) ( ) . .(GRUB 2
:
) ( . :
. )). (/grub (.
) (/grub .
).(grub.cfg
. ).(normal
) (GRUB 2 .
) (/grub . .
) . (.
) . (error: file not found
.
) .(error: unknown command
) ( Linux ) .(Linux
) (Linux ).(normal
) (initrd .
) .(/boot/grub ).(/usr/lib/grub/i386-pc
.(insmod (hd0,5)/usr/lib/grub/i386-pc/normal.mod) :
--------------------------------------------------------------------------------
) (set .
:
) (:
.1
. ).(sda5
.2
).* (sda5
.3
).(normal
.4
.5
) (normal .
.6
)) (Linux .(normal
.7
*.
.8
) (/ ).(/boot
.9
) (initrd .
. .
# set prefix=(hd0,5)/boot/grub
)# set root=(hd0,5
# insmod normal
# insmod (hd0,5)/boot/grub/normal.mod
# normal
# insmod Linux
# initrd /initrd.img
) (Linux )(normal
10 # initrd /boot/initrd.img-3.2.0-14-generic
11 # set
12 # boot
) .(Wubi ) 2 (7 ) 13 (14.
)13 # set root=(loop0
14 # linux /vmlinuz root=/dev/sdXY loop=/ubuntu/disks/root.disk ro
. /
. .
) ( ) . .(GRUB 2
. /
. ) ( ) . .(GRUB 2
) (GRUB ) (
:
) ( GRUB ) ( .
. ) (MBR ). .(.
. ) ( ) (core.img ) /boot .(/grub
) (:
) (.
.
. ) (Chroot ) (GRUB2 . ).(MBR
) ( . ) (Chroot ) . ..(GRUB 2
) (
) ( Busybox
) (UNIX ) (POSIX
) (Linux )
( embedded operating systems
.
:
) ( ) (Busybox Initramfs . .
!!.
) :(Busybox Initramfs
/ ).(Graphics Driver
).(HDD
).(HDD
).(DVD/CD
) (ISO ) (.
) ) (NTFS (.
..
)(
:
.1
.2
) . .(sda2
) ( ) (Gparted ) .(/
.3
.4
. ) (e ). (.
) (UUID=xxxx ) (TAB ) (.
.5
) (Ctrl+x..
.6
# Gparted
1 # sudo fdisk -l
# ls
. ) (
).(CMD
) (chkdsk .
.2
.3
) .(chkdsk )( . ).(Shutdown
.4
. )(.
3 # shutdown .....
4 # restart
2 # reboot
1 # chkdsk c: /f
. .
) .(NTFS
) (Busybox .
# mount -t ntfs-3g /dev/sda1 /root -o force
/:
) (mount . . / ).(recovery
:
.1
) (Busybox .
)) (Graphics Driver (.
.2
# exec startx
:
.1
) (mount ) (umount ) (.
.2
).(GsmartControl
.3
) .(S.M.A.R.T
.4
. :
) (/ ) (umount ) (.
.
) .e2fsck .(fsck
.sda1
) (e2fsck ).(ext2/ext3/ext4
) (fsck ).(ext2/ext3/ext4
.....
. /
. .
) ( . ) . .(GRUB 2
) (
:
) (splash screen .
.
. . .
. .) . ) (Linux (
) (e ..
) .(.
.
.1
.2
.3
.4
.5
.6
.
) (drivers ) ( .
.7
] .[name_of_the_driver_from_the_list.(kmod:fglrx) :
.8
) .(init 2 . ).(init 1
.9
).(reboot
GRUB 2 Menu > Advanced options > Recovery mode > Root
1 2 3
4 # sudo init 1
5 # root@[name_of_PC] login:
6 # jockey-text --list
7 # sudo jockey-text enable=kmod:fglrx
8 # sudo init 2
9 # sudo reboot
) . )((GRUB 2
. ) (MSDOS ) .(GPT
).(root
..
. .. UUID
).(initrd.img
)(/boot
) vmlinuz ) (initrd.img (.
)(/grub
) (grub.cfg )) .(mod. (.
# ls
# ls /
)# ls (hdX,Y
# ls (hdX,Y)/
# ls (hdX,Y)/boot/
(hdX,Y)/boot/grub/
# ls (hd0,5)/boot/grub/
grub.cfg
/boot/grub/
(hdX,Y)/
# ls /boot/grub/
# ls (hd0,5)/
vmlinuz
/
(hdX,Y)/boot/
# ls /
# ls (hd0,5)/boot/
vmlinuz-3.2.0-57-generic
/boot/
(hdX,Y)/
# ls /boot/
# ls (hd0,5)/
initrd.img
/
(hdX,Y)/boot/
# ls /
# ls (hd0,5)/boot/
initrd.img-3.2.0-57-generic
/boot/
# ls (hdX,Y)/boot/grub/
# ls /boot/
).(grub
)(normal
)(normal
) (
).(/
.
./
# set prefix=(hdX,Y)/boot/grub
*
)# set root=(hdX,Y
# insmod normal
# normal
)(/
# initrd (hdX,Y)/boot/initrd.img-3.0.2-14
) (.
# boot
. .
) (Wubi ) 1 (2 ) 1 :(2
)1 # set root=(loop0
>----
)1 # set root=(hdX,Y
>----
* :
. ) ( ) (ro ) (selinux=0 )
(enforcing=0 . )... (rhgb.
. ) ( X ) (Y .
. ).(GRUB 2
) (Bugs .
:
..
).(grub-pc
. ) (grub-install
) (sda, sdb ... ) .(UUIDs ) (grub-pc
.
..
" 496435 ).(Launchpad
. ).(MBR
..
. ) (Advanced .
" 414996 ).(Launchpad
. .
grub rescue>.
) (563895 ).(Launchpad
. ) (/boot ) (LVM
) (snapshot ) .(LVM
) (LVM ) (
. ( Win 7) .7 . ) (GRUB 2 .
A disk read error occurred
.7 ..
:
.1
. 7 ).(e
.2
) . (.
.3
) (Ctrl+X. ..7
insmod part_msdos
')set root='(hd0,msdos1
:7
.1
) (grub.cfg 7 ) (custom_40
) 7 . (.
.2
).(update-grub
# gksudo gedit /etc/grub.d/40_custom
):(custom_40
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
{ ')menuentry 'Windows 7 (customized entry
insmod part_msdos
insmod ntfs
')set root='(hd0,msdos1
chainloader +1
}
) (UUID . ) .(grub.cfg
) (sudo blkid .
) (7 ).(UUID
) (7 .
1 # sudo blkid
: . ...
. sda1) : sda2(.
) (sudo blkid .
) (sda . ) (MBR .
)( ) (ntfs :
1 # sudo aptitiude install ntfsprogs
.
) (X .
..
!Warning: This GPT partition label has no BIOS boot partition; embedding won't be possible
) (BIOS boot partition ) GPT .(EFI
. ) .(BIOS boot partition ) . .(GRUB 2
grub-setup: warn: This msdos-style partition label has no post-MBR gap; embedding won't be possible! grub2
bios-setup: warn: Embedding is not possible. GRUB can only be installed in this setup by using blocklists.
However, blocklists are UNRELIABLE and its use is discouraged. grub2-bios-setup: error: If you really want
blocklists, use --force.
. ) (GRUB 2 . ) (MBR
. )
.(USB . ) (1 . ).(2048
: . .
Embedding is not possible. GRUB can only be installed in this setup by using blocklists.
However, blocklists are UNRELIABLE and their use is discouraged.
.
) (GRUB 2 .
:
.1
).(/boot
.2
.3
.4
) (grub-install .
.1
) (/boot .
.2
/ ) 1 : ( . ) .(.
.3
) (--force ) .(grub-install .
) (chattr ) . .(GRUB 2
)....(BIOS/MBR ) (LUKS
)) (LVM2 (.
.4
)= (platform ) (/sbin/grub-install .
) (x86/amd64 ) .(platform=pc
grub-install: warn: Your embedding area is unusually small. core.img won't fit in it.
grub-install: warn: Embedding is not possible. GRUB can only be installed in this setup by using blocklists.
However, blocklists are UNRELIABLE and their use is discouraged.
) Stage 2 .(core.img
. :
.2
. . ).(VBR
.3
. ) (BIOS ).(MBR
.4
) (BIOS ) .(GPT
.5
) (UEFI ) .(GPT
.1
. .
) (alignment ).(SSD
.2
.3
. . ) (.
.4
.5
.(ef02) :
) :/ .(FAT32
2 ~ 1) :(.
.(ef00) :
.(EFI System) :
.(FAT-32) :
512) : ~ 1(.
: ) (custom_40 . ).(/dev/sdb1
#! /bin/sh -e
echo "Adding precise testing menuentry" > &2
cat << EOF
{ "menuentry "reload precise grub.cfg file from /dev/sdb1
insmod ext2
')set root= (hd1,1
search --no-floppy --FS-uuid --set=root 11992CDE-b1d9-4392-bcc4-13c2ce8702AA
configfile /boot/grub/grub.cfg
}
EOF
..
Fatal: No bootable medium found! System halted.
) (BIOS ..
. ) (BIOS ).(MBR
) .(virtual box
:
) (BIOS ).(boot
) (BIOS . .
) (.
. ).(BIOS
) .(chroot ) . .(GRUB 2
. ) . GParted (.
. .
GRUB.
) (GRUB ) (.
. .
grub> _.
. . .
. .
. ..
rescue> _.
Error 15
Error 11
. ) (GRUB 2 . ) (MBR .
) .(chroot ) . .(GRUB 2
. ..
. ) (UUID . .
. ) (windows XP ) (SATA )
(IDE )) .(AHCI " SATA ".("WindowsXP
. ) .(GRUB 2 ).(grub.cfg
) (UUID ).(grub.cfg
. ) (MBR
.
) . .(GRUB 2
. ) (GRUB 2 ).(grub.cfg
. ) (MBR
) .(sda
) . .(GRUB 2
. ) (GRUB 2 ).(grub.cfg
. ) (MBR
) .(sda
) . .(GRUB 2
.) (.
)= (root ).(Linux
. ) (GRUB 2 ).(grub.cfg
. ) (MBR
) .(sda
) . .(GRUB 2
. ) (btrfs .
.2
.3
.4
.5
2.
#GRUB_TERMINAL=console
1.
#GRUB_HIDDEN_TIMEOUT=0
4.
GRUB_HIDDEN_TIMEOUT=0
3.
sudo update-grub
5.
..
. .
) (GRUB_HIDDEN_TIMEOUT=0 ).(/etc/default/grub
):(/etc/default/grub
) (# ).(GRUB_HIDDEN_TIMEOUT=0
. ).(sudo update-grub
. ) .(Shift ) (Esc ..
. ) (Windows .
.1
.2
.1
):(/etc/default/grub
.2
) (# ).(GRUB_HIDDEN_TIMEOUT=0
. ).(sudo update-grub
. ) .(Shift ) (Esc ..
. :
.1
).(fdisk /dev/sda
.2
) (A . ) (#1
.3
) (W . ).(MBR
) (fdisk ) (Gparted .
Booting however
) (gfxterm ) (GRUB 2 ).(gfxmode
) (GRUB 2 ).(gfxpayload
) ( UEFI . )
.(KMS
. ..
.1
) .(/usr/share/grub/unicode.pf2
.2
.3
.4
).($esp/EFI/grub/
:
}# cp /usr/share/grub/unicode.pf2 ${GRUB_PREFIX_DIR
) (/usr/share/grub/unicode.pf2 .
.1
)(bdf-unifont
.2
) (unifont.pf2
.3
)} :(${GRUB_PREFIX_DIR
# grub-mkfont -o unicode.pf2 /usr/share/fonts/misc/unifont.bdf
}# cp /usr/share/grub/unicode.pf2 ${GRUB_PREFIX_DIR
) (grub.cfg ) (GRUB 2
. .
):(BIOS
insmod vbe
):(UEFI
insmod efi_gop
insmod efi_uga
) (UEFI ):(BIOS
insmod font
if loadfont ${prefix}/fonts/unicode.pf2
then
insmod gfxterm
set gfxmode=auto
set gfxpayload=keep
terminal_output gfxterm
fi
) (gfxterm ) (unicode.pf2 )}
.(${GRUB_PREFIX_DIR
!grub-setup: warn: This msdos-style partition label has no post-MBR gap; embedding will not be possible
grub-setup: warn: Embedding is not possible. GRUB can only be installed in this setup by using blocklists.
However, blocklists are UNRELIABLE and its use is discouraged.
grub-setup: error: If you really want blocklists, use force.
.
) (GRUB 2 ).(Vmware
. )) (MBR (63 1
" ) 2048( .
. ".MBR
).(GRUB 2
) (GRUB 2 . . ).(grub.cfg
) (GRUB 2 ).(UEFI
) (UEFI . .
) (EFI:
# efibootmgr -v
-------------------BootCurrent: 0000
Timeout: 3 seconds
BootOrder: 0000,0001,0002
)Boot0000* Grub HD(1,800,32000,23532fbb-1bfa-4e46-851a-b494bfe9478c)File(\efi\grub\grub.efi
)Boot0001* Shell HD(1,800,32000,23532fbb-1bfa-4e46-851a-b494bfe9478c)File(\EfiShell.efi
Boot0002* Festplatte BIOS(2,0,00)P0: SAMSUNG HD204UI
) (UEFI ..
) (GRUB 2 ) .(root . .
..
) (GRUB 2 :
)HD(1,800,32000,23532fbb-1bfa-4e46-851a-b494bfe9478c)File(\grub.efi
: " .
. ) (Windows
:
)(GRUB 2
Boot0000* Grub
1 # mv /boot/grub/device.map /boot/grub/device.map-old
2 # grub-mkconfig -o /boot/grub/grub.cfg
3 # rm /boot/grub/device.map-old.
) (grub-mkconfig . ).(Windows
. ) . . (.
. ) (GRUB 2
)(initial ramdisk
.(add_efi_memmap) :
).(Arch Linux
) (os-prober .
) (/etc/lsb-release .
) (lsb-release .
. ) (UEFI .
) ( ) (UEFI )(Intel Z77
cd EFI
mkdir Microsoft
cd Microsoft
mkdir Boot
cp FS0:\EFI\BOOT\bootx64.efi FS1:\EFI\Microsoft\Boot\bootmgfw.efi
. ) (NVRAM ..
):(Arch Linux
) (.
. ):(grub.cfg
set pager=1
set debug=all
. . :
# dpkg --list | grep grub
GRUB 2
. .
. ).(GRUB 2
/ /
menu mode
. .
) (C . . ).(grub.cfg
. .
rescue mode
edit mode
" "E .
..
..
UP/DN
Enter
. .
.
..
C
Ctrl + Alt + Delete
.
) ( . )(GRUB 2
UP/DN/Left/Right
/ .
TAB
. . .
Esc
/ .
HOME
) (.
.
END
Enter
F10
) (.
Ctrl + X
Space bar
. )(GRUB 2
.
.
UP/DN
Left/Right
/ .
TAB
. ) (C
Esc
..
) (.
.
Help + Enter
Space bar
Ctrl + Alt + Delete
).(GRUB2
. . . ) (.
. " . .
) (server .
) ( GRUB 2 .
. .
) .(.
:
.
.:
. ) (ENTER ..
. ) .(SHIFT ) (Esc .
)( ) (e / .
)) .(UP/DN/Left/Right .(ENTER
) (TAB .
.
) ) (GRUB 2 ) (initrd (.
) (Esc .
. .
. ).(sudo update-grub
) .(:
. ) (ro )..(selinux=0
/ ) .(Linux ) .(.
) (quiet ..
. / )) (recovery ( . ) (Linux
) .(single ) (S ) .(CTRL-X ) .(.
..
. ) (GRUB 2 ..
>grub
>grub rescue
) (C ..
. ) (SHIFT . ) (Esc .
. . .
) ( . ) ( .
.:
menuentry
)(
submenu
) . (.
) . (:
serial
terminal_input
terminal_output
terminfo
.
. :
)(ACPI
acpi
/ )(RAM
badram
)( block list
blocklist
.
/ . .
.
) ( configuration file ...
)( ).(CPU
. ).(CRC32
/ .
.
) (.
) (.
/
boot
cat
chainloader
cmp
configfile
cpuid
crc
date
drivemap
echo
export
false
)(.
. ) (MBR ).(GPT
gettext
gptsync
halt
help
).(initrd
initrd
)) (initrd 16(.
initrd16
).(module
insmod
.
).(Linux kernel
keystatus
Linux
linux16
list_env
load_env
)( .
loopback
.
. ) . . (.
. .
ls
normal
normal_exit
)/( .
parttool
) ( ) (.
password
) ( .
.
).(PXE
) (.
) .( .
.
/ ) (label ).(UUID
)( .
.
/
.
.
(GNU GRUB Manual 2.00 ) :
password_pbkdf2
play
pxe_unload
read
reboot
save_env
search
sendkey
set
true
unset
uppermem
.
.
boot
. ) (F10 ).(CTRL-x
cat
* configfile
).(grub.cfg
initrd
) (initrd.img . .
. .
* insmod
* Linux
loop
) ( .
ls
/ .
.
lsmod
) (normal .
normal
search
set
....
vbeinfo
)( . .
).(help
.
/
# cat (hd0,1)/boot/grub/grub.cfg
cat
# configfile (hd0,5)/boot/grub/grub.cfg
configfile
# initrd (hd0,5)/initrd.img
initrd
# insmod (hd0,5)/boot/grub/normal.mod
insmod
# insmod normal
linux
loop
ls
# ls /boot/grub # ls (hd0,5)/
# ls /
# ls (hd0,5)/boot/grub/
# ls
# ls (hd0,5)/boot
* :
.1
.2
. . . ).(sudo update-grub
.3
. ) (.
.4
) (/boot/grub )) .(/usr/lib/grub/i386-pc (.
.5
) .(5
) .(5
.6
.7
# configfile (hd0,1)/boot/grub/grub.cfg
1 # configfile /boot/grub/grub.cfg
# sudo update-grub
) (
4 # insmod normal
# insmod (hd0,1)/usr/lib/grub/i386-pc/normal.mod
file not found error
4 # insmod Linux
6 # linux /vmlinuz root=/dev/sda1 ro
7 # help search
).(grub rescue / rescue mode
:
dump
exit
)) (<grub (.
normal
):(grub rescue
unset
set
search
normal
multiboot
ls
linux
insmod
help
chain
cat
boot
. ) (.
. :
) (/grub .
).(linux
.
) (initrd.img .
).(Fallback
)) (script ( . ). (.
1 # /etc/grub.d/ gksudo leafpad 01_fallback
)2 (script
) (script .
.
. ) .(/etc/default/grub:
).(/boot/grub/grub.cfg
5 # sudo update-grub
) (.
(script):
#! /bin/sh -e
if [ ! "x${GRUB_DEFAULT}" = "xsaved" ] ; then
if [ "x${GRUB_FALLBACK}" = "x" ] ; then
export GRUB_FALLBACK=""
GRUB_FALLBACK=$(ls /boot | grep -c 'initrd.img')
[ ${GRUB_DISABLE_LINUX_RECOVERY} ] || GRUB_FALLBACK = $((${GRUB_FALLBACK} * 2))
fi
echo "fallback set to menuentry=${GRUB_FALLBACK}" >&2
cat << EOF
set fallback="${GRUB_FALLBACK}"
EOF
fi
https://help.ubuntu.com
https://www.gnu.org/software/grub/
https://wiki.archlinux.org/
http://wiki.ubuntuusers.de/ (Deutsch)
()
Antfra81 [AT] yahoo [DOT] com
ANTFRA
2014