[SOLVED] GRUB-PC installation error in a botched hard disk
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then 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.
I have a trouble when I try to install grub-pc in my hard disk, I get this error message:
Quote:
/usr/sbin/grub-setup: error: /dev/sda appears to contain a udf filesystem which isn't known to reserve space for DOS-style boot. Installing GRUB there could result in FILESYSTEM DESTRUCTION if valuable data is overwritten by grub-setup (--skip-fs-probe disables this check, use at your own risk).
/dev/sda is not an optical device, it is a Serial ATA hard disk. It happened after a huge mistake I made yesterday: I accidentally deleted the partition table of that HD filling with zeroes the first part of the disk. Yeah, using the "dd" command in the wrong device :P
Luckily, I recovered almost all of my partitions using TestDisk (http://www.cgsecurity.org/wiki/TestDisk), but since then I get the "udf filesystem" error when I try to install grub on it. I suppose there might be some zero-filled bits over there, and Grub didn't expect it.
I've tried with grub-pc versions 1.99~rc1-13ubuntu3 (Ubuntu 11.04) and 1.99-11 (Debian Unstable). I've got a x86-64 processor and a Western Digital WD2500AAJS-0 hard disk, 250GB.
Does anybody knows how to fix it?
Thanks in advance!
PD: I am using a Live CD with Xfce Desktop, and Thunar displays the partitions of the hard disk as "UDF volume"...
Last edited by nicolas_lz; 08-21-2011 at 05:08 PM.
I have not tried this, but it seems that it may work.
Quote:
Originally Posted by http://nitinpant.hubpages.com/hub/Repair-Partition-Table
All you have to do with Gparted to fix the broken partition-table is to do some changes like edit or shrink a partition, create a new one out of existing space or so.
andrewthomas, unfortunately, it didn't work for me. I only could try gparted because the only partition I couldn't recover was the Windows installation (I don't care about it). Thanks anyway!
syg00, this is the output of fdisk. Thanks for your help.
Code:
$ sudo fdisk -l /dev/sda
Disk /dev/sda: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0004cec6
Device Boot Start End Blocks Id System
/dev/sda1 * 1 9961 80010240 83 Linux
/dev/sda2 * 9962 20550 85056140 83 Linux
/dev/sda3 20551 30273 78099996 83 Linux
/dev/sda4 30274 30402 1030144 82 Linux swap / Solaris
now, sda1 is just an empty ext3 filesystem. I had a Windows installation here before I deleted the partition table.
sda2 is for Debian
sda3 is the /home directory
sda4 is swap
Not making too much (more) sense - that looks o.k. except for the 2 boot flags; delete one or both.
Go here, do what it says, and post the RESULTS.txt. Has all your (current) boot/partition info.
Now, the name of the troubled device is /dev/sdb, because I added another hard disk with some personal documents, and it took the "sda" label.
Also, I've tried using LILO and it worked! (GRUB still doesn't). However, I would like to know what happened to the drive.
Normally that contains a hex dump of the MBR - those decoder errors may indicate your guess above is correct.
Grub classic handles zeroed disks fine - must admit I haven't bothered testing grub2; still not much of fan of it.
If he grub-install still doesn't work open a bug report against it.
Hi again! Luckily, I've solved it. For some reason (testdisk, maybe?) I had another partition table in /dev/sda1 device. I just made a backup of the disk contents (I had to buy another HD), then I zeroed again (now, intentionally) the first part of /dev/sda, I created the partitions again and restore its contents from the backup.
Grub worked again, "and they lived happily ever after"
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.