Grub error, error: fd0 read error

If none of the more specific forums is the right place to ask

Grub error, error: fd0 read error

Postby vehemoth » 2011-06-06 06:00

how do I fix this error
Code: Select all
error: fd0 read error

debian squeeze install, two hard drives, one partition on each which make up a software raid1.
User avatar
vehemoth
 
Posts: 17
Joined: 2011-03-27 07:23

Re: Grub error, error: fd0 read error

Postby mvdan » 2011-06-06 13:18

Boot from your install CD/DVD, go to Other options / Rescue mode and once you get there, open a shell (through any of the two debian partitions) and run:

Code: Select all
su
grub-install /dev/sda
update-grub


Note that you might not want to install grub to the main hard drive (/dev/sda), but that is mostly the best choice.

Good luck!
Unstable 'Sid' amd64 - Awesome WM - https://gitorious.org/~mvdan
Richard M. Stallman wrote:We can't take the future of freedom for granted. Don't take it for granted! If you want to keep your freedom, you must be prepared for it.
User avatar
mvdan
 
Posts: 237
Joined: 2010-12-17 17:52
Location: Barcelona, Spain

Re: Grub error, error: fd0 read error

Postby _stefanos_ » 2011-06-17 06:05

danielmarti5,

I have exactly the same issue with wheezy...I ran the unsafe updates (yeah stupid me!) and now I can't do anything about it. I have tried every possible solution I know or have found through Google and still returns to grub prompt. I have mounted the necessary partitions, chroot-ed it and ran update-grub, grub-install, and so forth...you know, the normal steps to make it work but still it does not work.

Is there a way to solve this problem? It appeared right after I installed the latest updates on my system. The last thing I want to do is to reinstall everything; that won't be the solution or the proper way to solve an issue.

What would be your recommendation to such issue?
_stefanos_
 
Posts: 8
Joined: 2011-06-17 05:58

Re: Grub error, error: fd0 read error

Postby mvdan » 2011-06-17 08:35

Have you tried reinstalling GRUB as I explained above?

If so, then the problem might be that Wheezy is broken. In such case, you could go back to the shell from the rescue mode in the install CD/DVD, and run
Code: Select all
su
aptitude update
aptitude upgrade


If there was any problem with some update, that might be already fixed. If that doesn't work, try making a backup copy of /home and reinstalling. Sorry, but in testing the errors might be many nowadays :)
Unstable 'Sid' amd64 - Awesome WM - https://gitorious.org/~mvdan
Richard M. Stallman wrote:We can't take the future of freedom for granted. Don't take it for granted! If you want to keep your freedom, you must be prepared for it.
User avatar
mvdan
 
Posts: 237
Joined: 2010-12-17 17:52
Location: Barcelona, Spain

Re: Grub error, error: fd0 read error

Postby _stefanos_ » 2011-06-17 12:30

I have GNU/Linux Debian 6.0.1a DVD and run in Rescue Mode, but it would not let me mount anything. BusyBox had limited commands and couldn't run the normal procedure so I may "chroot" my current system and fix it.

With Knoppix 6.4 though I can run the same procedure and get successful results; nevertheless, the system returns to grub prompt which means something went wrong upon updating.

Is there a way to repair the current system without reinstalling everything from scratch? Once upon a time when I was a FreeBSD user I could self-host another version of FreeBSD and upon success I would merge guest with host without losing valuable data from server; it was a brilliant feature.

Do you think I could do so with Debian?
_stefanos_
 
Posts: 8
Joined: 2011-06-17 05:58

Re: Grub error, error: fd0 read error

Postby mvdan » 2011-06-17 16:25

_stefanos_ wrote:I have GNU/Linux Debian 6.0.1a DVD and run in Rescue Mode, but it would not let me mount anything. BusyBox had limited commands and couldn't run the normal procedure so I may "chroot" my current system and fix it.

What does it say? It's always worked for me.

_stefanos_ wrote:With Knoppix 6.4 though I can run the same procedure and get successful results; nevertheless, the system returns to grub prompt which means something went wrong upon updating.

That way, you install Knoppix' version of GRUB. I don't know if it would work, but I would use Debian's anyway.

_stefanos_ wrote:Is there a way to repair the current system without reinstalling everything from scratch? Once upon a time when I was a FreeBSD user I could self-host another version of FreeBSD and upon success I would merge guest with host without losing valuable data from server; it was a brilliant feature.

Do you think I could do so with Debian?

Sorry, but my knowledge doesn't go that far :)
Unstable 'Sid' amd64 - Awesome WM - https://gitorious.org/~mvdan
Richard M. Stallman wrote:We can't take the future of freedom for granted. Don't take it for granted! If you want to keep your freedom, you must be prepared for it.
User avatar
mvdan
 
Posts: 237
Joined: 2010-12-17 17:52
Location: Barcelona, Spain

Re: Grub error, error: fd0 read error

Postby _stefanos_ » 2011-06-17 19:40

I have tried your way...and unfortunately it didn't work.

Silly me I did not chroot to /target to have all commands to my availability. I was expecting to have all these commands without doing so...I have even tried dpkg-reconfigure grub-pc and still the same. I am run out of options or ideas.

Where do you think the error might be and causing the error: fd0 read error? Do you think that a package might got corrupted somewhere?
_stefanos_
 
Posts: 8
Joined: 2011-06-17 05:58

Re: Grub error, error: fd0 read error

Postby mvdan » 2011-06-17 22:02

_stefanos_ wrote:I have tried your way...and unfortunately it didn't work.

Silly me I did not chroot to /target to have all commands to my availability. I was expecting to have all these commands without doing so...I have even tried dpkg-reconfigure grub-pc and still the same. I am run out of options or ideas.

Where do you think the error might be and causing the error: fd0 read error? Do you think that a package might got corrupted somewhere?


Does it say "loading..." and then "welcome to grub", and when you select Debian it says error or does it say "loading..." and then error?

If it's the first one, then the configuration file for grub has errors or the debian install is damaged. If it's the other way, GRUB can't find the partition marked as boot. In other words, it can't load /etc/grub/grub.cfg. In this case, reinstalling grub (using chroot ;-)) is the only way to go, as far as I know.
Unstable 'Sid' amd64 - Awesome WM - https://gitorious.org/~mvdan
Richard M. Stallman wrote:We can't take the future of freedom for granted. Don't take it for granted! If you want to keep your freedom, you must be prepared for it.
User avatar
mvdan
 
Posts: 237
Joined: 2010-12-17 17:52
Location: Barcelona, Spain

Re: Grub error, error: fd0 read error

Postby _stefanos_ » 2011-06-18 11:49

No, it does not say "loading..." or something like that. It goes to Welcome to GRUB! and takes me to the grub prompt.

I have disabled my floppy from BIOS and even deleted the --no-floppy lines from grub.cfg. With this option it does not delay for 15 seconds; it goes straight to grub prompt.

Right now I am backing up my system and try a few more times to sort things out. I really don't know what else to do. If you know a way to repair my system without reinstalling it from scratch, I would be grateful to you.
_stefanos_
 
Posts: 8
Joined: 2011-06-17 05:58

Re: Grub error, error: fd0 read error

Postby mvdan » 2011-06-18 12:54

_stefanos_ wrote:No, it does not say "loading..." or something like that. It goes to Welcome to GRUB! and takes me to the grub prompt.

I have disabled my floppy from BIOS and even deleted the --no-floppy lines from grub.cfg. With this option it does not delay for 15 seconds; it goes straight to grub prompt.

Right now I am backing up my system and try a few more times to sort things out. I really don't know what else to do. If you know a way to repair my system without reinstalling it from scratch, I would be grateful to you.


In that case, grub is fine and the boot partition is in its place. Either Debian is damaged or the hard disk is damaged. If it's the first one, you could repair it using chroot. I'm thinking... you could reinstall the linux kernel and grub, and see if that does the trick (using aptitude, of course). If the disk is damaged, then even wiping wouldn't solve it. But that second possibility is less likely since you haven't been throwing your computer around (or have you?) ;-)

PS: It could be GRUB's fault, but in that case it would say "root partition not found", "boot image not found" or similar (as far as I've seen).
Unstable 'Sid' amd64 - Awesome WM - https://gitorious.org/~mvdan
Richard M. Stallman wrote:We can't take the future of freedom for granted. Don't take it for granted! If you want to keep your freedom, you must be prepared for it.
User avatar
mvdan
 
Posts: 237
Joined: 2010-12-17 17:52
Location: Barcelona, Spain

Re: Grub error, error: fd0 read error

Postby kiyop » 2011-06-19 13:35

If you get into Grub menu, type "C" to enter grub prompt.

If you successfully get into grub prompt,
grub>
is shown.
At grub prompt, type
Code: Select all
ls

and submit the result.
If you understand what is the debian partition, for example (hd0,1), type
Code: Select all
set root=(hd0,1)
ls /
ls /boot/

or so to search if there are correct kernel and initramfs or not.
If there are possible kernel and initramfs, type
Code: Select all
set root=(hd0,1)
linux /vmlinuz root=/dev/sda1 ro
initrd /initrd.img
boot

Of course, if you know the correct version of kernel and its initramfs, type them instead of /vmlinuz and /initrd.img, for example,
/boot/vmlinuz-2.6.32-5-686
/boot/initrd.img-2.6.32-5-686
...although they are for Stable (Squeeze). I am not familiar with Testing (Wheezy).

You can use boot info script to analyze the problem.
http://bootinfoscript.sourceforge.net/
Openbox: Wheezy, Sid, Arch / Win XP (on VirtualBox) and 7
http://kiyoandkei.bbs.fc2.com/
User avatar
kiyop
 
Posts: 2367
Joined: 2011-05-05 15:16
Location: Where persons without desire to improve themselves fear to tread, in Japan

Re: Grub error, error: fd0 read error

Postby _stefanos_ » 2011-06-19 17:36

After I have extensively searched the internet and have spoken to great guys from Debian channel, (they couldn't help me at all) I decided to give a try to my patience before I attempt to reinstall everything.

Fortunately for me and my system, I have realized that "patience is a virtue!". Upon using a LiveCD, I saw that /dev/sda1 and /dev/DesktopPC-root contained both of them a grub folder!

After a bit of investigation I have discovered the problem. For those who are still using GRUB1 and want to upgrade to GRUB2, or have already done so and have the same problem like in my case (under an LVM system of course), they should follow this procedure accordingly:

Check for your boot partition as root user.
Code: Select all
fdisk -l

In my case is /dev/sda1. Under your system it might be something totally different.

With a LiveCD mount it, copy its contents [as root user of course] to your LVM partition.
Code: Select all
rsync -avh --progress /dev/sda1/ /dev/DesktopPC-root/boot/


NOTE: Please make sure that in /dev/sda1 there's a folder named grub. By running the above command, it synchronizes the contents of /dev/DesktopPC-root/boot/ with that of /dev/sda1.

By doing so, you are moving your GRUB1 files to GRUB2 directory. After you do so, run VERY CAREFULLY this command:

Code: Select all
dd if=/dev/zero of=/dev/sda1 bs=446 count=1

That would fill up your /dev/sda1 with zeros.

DISCLAIMER: I take no responsibility for any data loss. Run it at your own risk please. You have been warned! Please run backups before you attempt such command!

NOTE: If your LiveCD does not have installed lvm2 package you have to manually install it. In my case, one of the LiveCDs I had to use was GNU/Linux Ubuntu 10.04 which did not have lvm2 installed; I had to install it myself to make it work.

Code: Select all
apt-get install lvm2


After you have successfully installed your lvm2 package, run:

Code: Select all
vgscan

Code: Select all
Reading all physical volumes.  This may take a while...
Found volume group "DesktopPC" using metadata type lvm2


Code: Select all
lvscan

Code: Select all
 
inactive '/dev/DesktopPC/root' [295.32 GiB] inherit
inactive '/dev/DesktopPC/swap_1' [2.53 GiB] inherit


Code: Select all
vgchange -ay


Doing so will activate your inactive volume groups. Run again the previous lvscan command.

Code: Select all
lvscan

Code: Select all
 
ACTIVE '/dev/DesktopPC/root' [295.32 GiB] inherit
ACTIVE '/dev/DesktopPC/swap_1' [2.53 GiB] inherit

There you go. It should show the above message to you.

Time to mount our filesystems:
Code: Select all
mount -t ext3 /dev/DesktopPC-root /mnt
mount --bind /dev /mnt/dev
mount -t proc none /mnt/proc
mount -t sysfs /sys /mnt/sys


Now it's time to make mnt to behave like a root (/) directory:
Code: Select all
chroot /mnt


Now it's about time to edit /etc/fstab and disable /boot and most probably its representative UUID. At least in my case, I had to do so.
Code: Select all
# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
/dev/mapper/DesktopPC-root /               ext3    errors=remount-ro 0       1
#/dev/sda1       /boot           ext2    defaults        0       2
#UUID=1a602b40-cc39-4cea-9894-d28ff3451d80       /boot           ext2    defaults        0       2
/dev/mapper/DesktopPC-swap_1 none            swap    sw              0       0
/dev/scd0       /media/cdrom0   udf,iso9660 user,noauto     0       0
/dev/scd1       /media/cdrom1   udf,iso9660 user,noauto     0       0
/dev/fd0        /media/floppy0  auto    rw,user,noauto  0       0


After you do so, run
Code: Select all
dpkg-reconfigure grub-pc


We have to do so, because we have removed a partition from our system and we have to inform it that we have done a major change to it. If we don't inform it, fsck will produce an error most probably with
Code: Select all
failed (code 8)
.

If I have forgotten something here guys, I will update it again and I will let you know for sure. It was a painful procedure, but heck...I have learnt so much from it!

Remember: Every single failure is a step closer to success. NEVER GIVE UP!

Cheers ;)
Last edited by _stefanos_ on 2011-06-20 08:30, edited 3 times in total.
_stefanos_
 
Posts: 8
Joined: 2011-06-17 05:58

Re: Grub error, error: fd0 read error

Postby kiyop » 2011-06-19 23:42

_stefanos_ wrote:Upon using a LiveCD, I saw that /dev/sda1 and /dev/DesktopPC-root contained both of them a grub folder!

Maybe, your /etc/fstab and/or grub2 setting was not suitable. And so, your update-grub only changed the contents of /boot in /dev/DesktopPC-root (in LVM?).
Grub2 can recognize LVM and RAID. You could include correct modules for LVM and RAID into core.img of grub2.
Installing grub2 correctly is better.

_stefanos_ wrote:Now it's about time to edit /dev/fstab

Typo. /etc/fstab

_stefanos_ wrote:/dev/mapper/DesktopPC-root / ext3 errors=remount-ro 0 1

_stefanos_ wrote:/dev/mapper/DesktopPC-swap_1 none swap sw 0 0

I am curious.
Is your Grub2 menu, which is shown just after booting, updated after your kernel is updated?
(Usually there is no problem. But your case is not usual.)
Please run boot info script and submit the result if you care.

Good luck.
Openbox: Wheezy, Sid, Arch / Win XP (on VirtualBox) and 7
http://kiyoandkei.bbs.fc2.com/
User avatar
kiyop
 
Posts: 2367
Joined: 2011-05-05 15:16
Location: Where persons without desire to improve themselves fear to tread, in Japan

Re: Grub error, error: fd0 read error

Postby _stefanos_ » 2011-06-20 08:11

And so, your update-grub only changed the contents of /boot in /dev/DesktopPC-root (in LVM?).

After I copied contents of /boot/ to /dev/DesktopPC-root/boot/, which that included the kernel and others files plus the grub folder, I ran the necessary commands and updated my system.

Grub2 can recognize LVM and RAID. You could include correct modules for LVM and RAID into core.img of grub2.
Installing grub2 correctly is better.

I forgot to mention that I edited /etc/default/grub and added this line
Code: Select all
GRUB_PRELOAD_MODULES=lvm
, so I guess editing core.img would be unnecessary.

Typo. /etc/fstab

Thanks for detecting the typo; already fixed it.

I am curious.
Is your Grub2 menu, which is shown just after booting, updated after your kernel is updated?
(Usually there is no problem. But your case is not usual.)


I'm afraid I cannot recall. For sure what I know is that I have fixed my problem and everything works just fine now, thanks to Jim's Repository

Please run boot info script and submit the result if you care.


You mean you want my grub.cfg as it has been generated by dpkg-reconfigure grub-pc? If yes, let me know by tonight when I will get back home to post it here for you.
_stefanos_
 
Posts: 8
Joined: 2011-06-17 05:58

Re: Grub error, error: fd0 read error

Postby kiyop » 2011-06-20 11:09

Thanks for your reply.
I have understood what you did a little further.

_stefanos_ wrote:
Please run boot info script and submit the result if you care.

You mean you want my grub.cfg as it has been generated by dpkg-reconfigure grub-pc? If yes, let me know by tonight when I will get back home to post it here for you.

No.
boot info script reports not only the contents of /boot/grub/grub.cfg, but also the detail information on the bootloader in MBR and PBR and the relation between the necessary files in some partitions and MBR and/or PBR.
It would be greatly appreciated if you kindly report the result of boot info script.
Thanks in advance.
Openbox: Wheezy, Sid, Arch / Win XP (on VirtualBox) and 7
http://kiyoandkei.bbs.fc2.com/
User avatar
kiyop
 
Posts: 2367
Joined: 2011-05-05 15:16
Location: Where persons without desire to improve themselves fear to tread, in Japan

Next

Return to General Questions

Who is online

Users browsing this forum: No registered users and 12 guests

fashionable