Lost Windows partition after using install-grub command
Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Lost Windows partition after using install-grub command
Please help. I was hoping to move GRUB from a hard-drive that is dieing a slow death to a good drive which already has Windows XP installed on it. I used command "sudo grub-install /dev/hda1" hoping to install GRUB on this good drive. However, in the process I have lost the drive altogether. I tried uninstalling GRUB by booting from Windows XP CD but I don't see that partition at all to log in and use FIXMBR. Is there any other alternative to recover this drive or have I lost all the data?
Thanks in advance.
Following is the outcome of "sudo fdisk -l"
Disk /dev/hda: 60.0 GB, 60022480896 bytes
255 heads, 63 sectors/track, 7297 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 7297 58613121 7 HPFS/NTFS
Disk /dev/hdd: 61.4 GB, 61492838400 bytes
255 heads, 63 sectors/track, 7476 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hdd1 1 2557 20539071 83 Linux
/dev/hdd2 * 2558 7476 39511867+ 7 HPFS/NTFS
By giving hda1 to grub-install you specified it should install itself to the beginning of the hda1 partition. If you want to install it to MBR, you don't give the partition number, just the disk (hda for example, which is the same as (hd0)) on which you want GRUB be put on (to the MBR).
Installing GRUB should't destroy any personal data even if you did install it onto a partition and not MBR. It takes up 512 bytes from the beginning of the disk or partition, where a bootloader and partition table is usually stored in. Regular partitions start only after that, so your "problem" is just that the Windows bootloader is confused (probably because GRUB is where it wants to see something else); fixing it shouldn't be that bad, and anyway recovering your data for backing up for example is a matter of mounting the Windows partitions. Many modern distributions have ntfs read support out of the box (you need ntfs-3g only if you wish to write to the partitions also), so you can just mount the Windows partition(s) as you would mount any other partitions, specifying the filesystem type as ntfs (or auto).
Bad, *very* bad.
This over-writes the NTFS partition, not the MBR.
Quote:
I tried uninstalling GRUB by booting from Windows XP CD but I don't see that partition at all to log in and use FIXMBR. Is there any other alternative to recover this drive or have I lost all the data?
Try fixboot first, followed by fixmbr.
If you're lucky you'll be back in business.
Your data is still there, you just need to be able to get at it. See how you go with the above.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.