peetaur

boot fix -chroot method

Jul 27th, 2013
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.88 KB | None | 0 0
  1.     mkdir /mnt/root
  2.  
  3.     mount /dev/${disk}${partition} /mnt/root # replace with disk and partition of your root device
  4.  
  5.     # if you have a separate boot device, also run this:
  6.     mount /dev/${disk}${partition} /mnt/root/boot # replace with disk and partition of your boot device
  7.  
  8.     cd /mnt/root
  9.    
  10.     mount -o rbind /dev dev
  11.     mount -o rbind /proc proc
  12.     mount -o rbind /sys sys
  13.     chroot /mnt/root
  14.    
  15.         blkid
  16.         vim /etc/fstab
  17.             make sure UUIDs are right (compare to blkid output)
  18.  
  19.         # replace $disk with your disk
  20.         # this assumes you want grub on the disk, not a partition
  21.         grub2-install /dev/$disk
  22.         grub2-mkconfig -o /boot/grub2/grub.cfg
  23.    
  24.         vim /boot/grub/grub.cfg
  25.             make sure UUIDs are right (compare to blkid output)
  26.            
  27.         mkinitrd
  28.  
  29.     #now you can reboot and hope it works
Advertisement
Add Comment
Please, Sign In to add comment