LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 12-10-2008, 01:36 AM   #1
IshanJ
LQ Newbie
 
Registered: Aug 2008
Posts: 13

Rep: Reputation: 0
Question saving grub files to use in case


I had installed both XP and Ubuntu 8.04 in my computer. One day my brother had tried to fix something in XP by running XP installation cd and ultimately I couldn't run my Ubuntu installation. But XP worked well. And when I checked it with the live cd, all the contents of /boot directory was gone. I tried several times to copy the contents of /boot in the live cd rom to my real installation and then boot up. But it didn't work! So I reinstalled Ubuntu. I want to know if there is a way to recover the Ubuntu installation in situations like these? And is there a way to save the contents of /boot directory to somewhere else and can I use this copied /boot directory at a later time to fix the system in a situation like this?
 
Old 12-10-2008, 04:17 AM   #2
JosipBroz
Member
 
Registered: Nov 2008
Location: Ljubljana
Distribution: OpenSuSE
Posts: 56

Rep: Reputation: 18
The situation you're describing is highly atypical, so trying to safeguard yourself from it "reoccurring" would be quite overzealous. I'm completely baffled that the XP CD could actually ruin anything residing on a GNU/Linux partition -- Windows don't even know how to read those partitions at all (well, some read-only drivers do exist for Windows, but they are in no way present on a XP installation CD). A Windows CD could mess up your entire GNU/Linux partition, to be sure, but it could never nuke just selected directories on it! What it could do, however, and do it gladly, is overwrite your Grub bootblock code (or MBR, as they call it) with its own. Now, you'd be facing two possible situations:
1. Highly probable. Only your MBR has been overwritten. You simply overwrite it again (using a GNU/Linux live CD) with the command grub setup.
2. Almost impossible. Your /boot directory (or, far more likely, a separate /boot partition) has been deleted. You use a live GNU/Linux distro to run a fake "reinstallation", skipping all the steps until you get to the Grub installation phase and there reinstall Grub. I must admit I've never tried this solution myself, it's just something that's been circulating on the Internet for a long time. An alternate way to achieve the same (at least with some distros) would be running grub-install from a virtual terminal.
 
Old 12-12-2008, 12:21 PM   #3
IshanJ
LQ Newbie
 
Registered: Aug 2008
Posts: 13

Original Poster
Rep: Reputation: 0
Thanks JozipBros for your reply. As you have mentioned in the second situation, I tried to reinstall only grub by skipping the other steps but the CD didn't allow me to do that. That's why I had to reinstall the entire system from the scratch. That was very cumbersome.
 
Old 02-26-2009, 03:11 PM   #4
serafean
Member
 
Registered: Mar 2006
Location: Czech Republic
Distribution: Gentoo, Chakra
Posts: 997
Blog Entries: 15

Rep: Reputation: 136Reputation: 136
Hi, I know this is slightly outdated, but I feel the need to submit my hypothesis : the thing I see the most probable is that XP overwrote the MBR, thus GRUB had no way of starting. You booted Ubuntu LiveCD, and mounted your / partition. What you didn't do is mount your /boot partition. The mount point being a directory, when you looked inside it, you saw nothing, because all the data it should have contained was on another partition which you didn't mount. That's just my view of the situation, so it may not be what actually happened, but as I have never heard abot Windows writing do an ext partition, I think this might have happened.

btw:in this case Josip's situation number1 would have applied to you. And just reinsalling GRUB wouldn't reinstall the kernel image, so I don't think number 2 would work.
 
  


Reply



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
Copying files from case-sensitive Linux to case-insensitive Windows via CIFS? SlowCoder Linux - General 4 05-07-2008 07:03 PM
Saving to usb sometimes changes file name case knobby67 Debian 1 01-15-2008 06:59 AM
i broke grub... not saving using yast CopyrightPhilly Linux - Software 1 01-14-2007 04:49 PM
Why are all my upper case files being shown as lower case?? [Kernel 2.6.9-1.667 FC3] t3gah Fedora 4 03-11-2005 04:09 PM
grub bootloader : saving a new configuration file? lynnsbomb Mandriva 3 02-03-2004 04:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 06:38 PM.

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
Open Source Consulting | Domain Registration