Re: Recovering/Restoring Boot Partition

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Jan 29, 2014, at 11:41 AM, Don Levey <fedora-list@xxxxxxxxxxxxx> wrote:

> A short while ago, during a power cut, my desktop machine failed.  A
> power-up displayed symptoms consistent with a missing /boot partition;
> attempting to boot under the rescue CD seemed to confirm this when it
> did not mount the /boot partition.
> 
> Booting under the F20 LiveUSB key allowed me to manually mount the
> partition; however, while I see files listed there some of them do not
> appear to be readable.
> 
> I have seen the suggestion that all I need to do is to reinstall the
> appropriate kernel files in the right place:
> 	* Mount / via LiveUSB
> 	* Mount /boot under / (above)
> 	* "mount -bind" the current /proc directory to the
> 	  HD /proc directory
> 	* "chroot" to the / directory mounted (above)
> 	* "yum install" of grub, kernel, and logos
> (all via
> http://www.linuxforums.org/forum/red-hat-fedora-linux/187043-howto-recover-boot-partition.html";
> 
> Is that what I'm looking to do, or is this dangerous?  Are there
> alternate/better suggestions?

I'm wondering why /boot and not rootfs, and why it's not mounting. Normally /boot isn't being written to at all except when kernels are being installed, and /boot on ext4 or XFS should recover with a normal mount at boot without even requiring fsck.

Anyway, if you're for sure convinced it's corrupt then reformat the partition. Use blkid to get the new volume UUID to insert into /etc/fstab so it gets mounted when you next boot. And then mount root, boot, (boot/efi if this is a UEFI machine), and use:
mount -B /dev /mnt/dev    #where /mnt is where rootfs is mounted
mount -B /proc /mnt/proc
mount -B /sys /mnt/sys
chroot /mnt
yum reinstall kernel     #grubby will probably complain due to lack of grub.cfg
grub2-install /dev/sdX                       
grub2-mkconfig -o /boot/grub2/grub.cfg


If UEFI the last two commands are:
grub2-install                       
grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg

Then type exit, and then reboot. You won't have an emergency boot entry, just one kernel entry. To get an emergency entry you can run:

/etc/kernel/postinst.d/51-dracut-rescue-postinst.sh 

And then use grub2-mkconfig to make a new grub.cfg that will include the rescue kernel+initramfs.


Chris Murphy
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org




[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux