LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-10-2014, 11:20 PM   #1
TallTanBarbie
LQ Newbie
 
Registered: May 2003
Posts: 5

Rep: Reputation: 0
Restore Reformatted Boot Partition


Hello...I have a computer with several hard drives. The first hard drive (sda) is Windows 8. The second hard drive(sdb)is for Fedora 20 Linux. When I'm running Windows the /boot partition on the second hard drive shows up as a 500MB unformatted drive. I was installing some external hard drives via USB and I accidentally reformatted the Fedora /boot partition from Windows. After this happened I could no longer boot into Fedora and get a "you need to load the kernel first" error message. I can use the installation disc to boot into rescue mode successfully. Is there a way to reformat (under Linux) and recreate the /boot partition so I don't have to do a complete reinstall?

Last edited by TallTanBarbie; 04-10-2014 at 11:24 PM.
 
Old 04-11-2014, 12:17 AM   #2
edbarx
Member
 
Registered: Sep 2010
Distribution: Used Debian since Sarge. (~2005)
Posts: 373

Rep: Reputation: 20
It depends on how you intend to restore your partition. You can attempt to recover the files and directories from the previous partition although I doubt you will be able to restore everything. There are some tools precisely for restoring files from nuked partitions but you can still attempt a full restore. Testdisk and ext3grep can do restores but it all depends on the extent of damage done to the data you want to restore.

I don't use Fedora, but it all depends what files are store in /boot and how the partition was linked to the other partitions in the installation of Fedora. If /boot only contained kernel stuff and the bootloader, it should be possible to make a full restore without reinstalling. You will need to create the partition, make sure it uses the same UUID listed in /etc/fstab and use a chroot to install the missing kernels and bootloader from /boot. Obviously, the package management tool may complain that somes files are missing. In that case attempt to reinstall the missing kernels and bootloader. I want to emphasize that the key to succeeding in this method is to match the UUID of the newly build partition to the one listed in Fedora's /etc/fstab.

I assumed you don't have a backup, otherwise, restoration should be far easier.

Last edited by edbarx; 04-11-2014 at 12:25 AM.
 
Old 04-11-2014, 12:29 AM   #3
TallTanBarbie
LQ Newbie
 
Registered: May 2003
Posts: 5

Original Poster
Rep: Reputation: 0
In rescue mode the space that used to be the /boot partition is listed as Windows formatted space so it's totally gone. However, the EFI and LVM partitions are still there. Thanks.
 
Old 04-11-2014, 12:50 AM   #4
edbarx
Member
 
Registered: Sep 2010
Distribution: Used Debian since Sarge. (~2005)
Posts: 373

Rep: Reputation: 20
That is obvious. You have to delete the newly created partition or direct the file recovery tools to search in the new partition. /boot usually contains kernels, initial ram images and kernel configuration files. All the latter should, in theory, be possible to restore without doing an complete reinstallation. Needless to state, the new partition should be reformatted with the same filesystem as the original one.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
backup and restore boot partition ajayyadavmca Programming 4 06-28-2012 01:26 AM
Fix boot failure after restore partition to a different partition with Clonezilla heronlin LinuxQuestions.org Member Success Stories 2 06-13-2012 09:18 PM
[SOLVED] Can't launch restore partition on dual boot sabre_pilot Fedora 2 03-20-2011 09:52 PM
Cannot mount reformatted partition shimonl Linux - Newbie 5 02-16-2011 02:47 PM


All times are GMT -5. The time now is 12:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration