LoginSignup
9
10

More than 5 years have passed since last update.

Grubローダが壊れた

Last updated at Posted at 2015-10-13

ブートローダが壊れた
原因は新しいシステムを構築しようとしたとき間違えてEFIシステムを壊してしまったのだ
すぐに、grub-install を使ったが、再起動した時にこんなメッセージとプロンプトが

Minimal BASH-Like line editing is supported. For the first word, TAB lists possible command completion. Anywhere else TAB lists possible device or file completions.

grub> 

ほかのArch-linuxからマウントしてarch-chrootでシステムに入る

# mount /dev/sdb3 /mnt
# mount /dev/sda1 /mnt/boot
# arch-chroot /mnt /bin/bash

initrdがないようなので

# mkinitcpio -p linux

これでいける思ったが。vmlinuxがいないよといわれる。

全体アップデートしたばかりだったので/var/cache/pacman/pkg/に残ってた

# cp /var/cache/pacman/pkg/linux-4.2.2-1-x86_64.pkg.tar.xz ~
# tar zxf linux-4.2.2-1-x86_64.pkg.tar.xz 
# cp boot/vmlinux-linux /boot

これで直った

追記


grub.cfgのバックアップがない場合は、手動でブートする必要あります

grub> ls
(hd0) (hd0,gpt1) (hd0,gpt2) (hd0,gpt3) (hd1) (hd1,gpt1)

#rootにブートパーティションを設定
grub> set root=(hd0,gpt1) 

#確認
grub> ls / 
EFI  grub  initramfs-linux-fallback.img  initramfs-linux.img  vmlinuz-linux

#linuxがあるパーティションをセット
grub> linux /vmlinuz-linux root=/dev/sda3
grub> initrd /initramfs-linux.img

#パーティションで分割してない場合
grub> linux /boot/vmlinuz-linux root=/dev/sda1
grub> initrd /boot/initramfs-linux.img

#起動
grub> boot

起動後、grub.cfg を作成

# grub-mkconfig -o /boot/grub/grub.cfg

参考
GRUB - ArchWiki

9
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
10