LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 06-26-2007, 09:54 PM   #1
NomDeGuerre
Member
 
Registered: Oct 2003
Posts: 136

Rep: Reputation: 15
Can't install GNU/Linux after connecting external USB harddrive.


I connected an external usb drive to my computer and the next time I started it I got this message after choosing Ubuntu 7.04 or Windows XP in GRUB: "Error 29: Disk write error". Used XP disc to do fixboot and fixmbr which got Windows started. When I try to install Debian or Ubuntu I get this at the part where I accept partition changes: "Input/output error during write on /dev/hdb ERROR!!!" on Ubuntu and "Input/output error during read on /dev/ide/host0/bus0/target1/lun0/disc ERROR!!!" on Debian. dmesg gives me several: "end_request: I/O error, dev hdb, sector" and then a number. There were lots of 0 and 8 and a few 74252424. I just reformatted the drive with XP cd and installed XP, I also tried loading the optimized and then fail-safe defaults on BIOS but I *still* get that message when I get to the part where I accept partition changes, so I can't install either Debian or Ubuntu. Any ideas on what the problem is?
 
Old 06-27-2007, 12:37 AM   #2
AceofSpades19
Senior Member
 
Registered: Feb 2007
Location: Chilliwack,BC.Canada
Distribution: Slackware64 -current
Posts: 2,079

Rep: Reputation: 58
grub probably changes the lettering and numbering of the harddrive when the external one is plugged it
 
Old 06-27-2007, 12:44 AM   #3
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
Quote:
"Input/output error during write on /dev/hdb ERROR!!!"
But shouldn't hdb refer to a secondary IDE harddisk, rather than USB, which should be referred to as sda (in case the internal harddisk is IDE disk, hda), or if the internal disk was SATA disk (sda), then the external should be sdb and not hdb, again?

Also I would find it odd that GRUB changed lettering/numbering all of a sudden. Those errors do seem to be caused by a malfunctioning (as in "not functioning quite the way it should") secondary (hard)disk, but if you plug the USB drive out, then shouldn't the problems vanish? Do they?
 
Old 06-27-2007, 07:21 AM   #4
NomDeGuerre
Member
 
Registered: Oct 2003
Posts: 136

Original Poster
Rep: Reputation: 15
GRUB was installed in master boot record so how can it still cause problems if I've done fixmbr with the Windows XP cd and even reinstalled?

Yes hdb refers to my internal IDE harddrive which is plugged in as slave (no reason for that other than that's how it turned out when I plugged it in the first time). I also have two other harddrives, sda and sdb, one which was /home and one which was only /media/sdb which contained everything I couldn't fit in /home.

The external usb harddrive isn't plugged in, it only was for a short while. It had ntfs and I got a message that I didn't have permission to write to it, even when I was root, so I just gave up.
 
Old 06-27-2007, 10:25 AM   #5
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
Normally to boot a USB device you must instruct the Bios to boot it first. That gives the first bootable disk status to it. Therefore the MBR would be in the first sector of the USB disk.

The internal disk will not boot properly because it will be relegated to the second bootable disk status but all the OS were installed as the first boot disk.

Also the USB device may not get the sda status as this is dependent on the relationship between the mobo connection and the Bios. Even if it is a sdc in Linux it can still be the first boot disk (hd0) to Grub.

One needs to know how the boot disk order work reasonably well before trying to boot from a USB device.

In general the sda, sdb, sdc etc are location-dependent and don't get changed once plugged but the disk order is one freely specifies in the Bios.

Also SCSI/Sata/USB system names the disks consecutively. Thus removing sdb disk in the middle will force the one following sdc to take up its name.

In case of doubt boot up a Live CD and type in root terminal

Code:
fdisk -l
will show all partitions of every disk in Linux notation.

Code:
grub
geometry (hd0)
geometry (hd1)
geometry (hd2)
geometry (hd3)
etc and so on
show up the partitions of 1st, 2nd, 3rd and 4th disk.

That is the way to get the information from the horse's mouth, getting Linux and Grub to report how each sees your disks.

Last edited by saikee; 06-27-2007 at 10:29 AM.
 
Old 06-27-2007, 12:22 PM   #6
NomDeGuerre
Member
 
Registered: Oct 2003
Posts: 136

Original Poster
Rep: Reputation: 15
I didn't try to boot from the USB hard disk. It was brand new and I connected it to move some files over to it, didn't work so I just ejected it and unplugged it, that was the end of it. And it's not mine so no advice on how to get it to work now Also I don't mind if everything on hdb gets lost as long as I can install GNU/Linux on it, obviously Windows installs on it just fine but i don't want to use that.

This is the boot order for hard disks in BIOS:
Code:
1. Ch0 S.	:	ST340016A
2. Ch2 M.	:	ST3200822AS
3. Ch3 M.	:	HDS725050KLA360
First boot device is CD-ROM and second boot device is Hard Disk.

I forgot to do 'grub' but since I did fixmbr earlier I shouldn't have grub... right? Grub should be completely removed from my hard disk.

This is what i got from 'fdisk -l'
Code:
Disk /dev/sda: 200.0 GB 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes 

Device		Boot	Start	End	Blocks		Id	System
/dev/sda1		1	24321	195358401	83	Linux


Disk /dev/sdb: 500.1 GB 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device		Boot	Start	End	Blocks		Id	System
/dev/sdb1		1	60801	488384001	83	Linux


Disk /dev/hdb: 40.0 GB 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes 

Device		Boot	Start	End	Blocks		Id	System
/dev/hdb1	*	1	4864	39070048+	7	HPFS/NTFS

Last edited by NomDeGuerre; 06-27-2007 at 01:24 PM.
 
Old 06-27-2007, 12:56 PM   #7
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
Don't kid yourself. The fixmbr merely overwrite the MBR which is 512 bytes large or the first sector with MS 's MBR.

You can destroy Grub by nuking the Linux partitions which you have sda1 and sdb1.

You Windows can only boot if it was installed as the first disk and run as such. Your information doesn't tell us if the fisrt bootable disk is 400Gb or not.

You should do geometry command in a Grub shell as suggested in Post #5.

Seem to me you don't have an idea which of your 200Gb, 500Gb and 400Gb disk is the first bootable disk and could have restored the XP MBR to the wrong disk. In any case you haven't told us if your XP boots and you Linux doesn't have you?

Under the normal circumstance the Pata disk will automatically get the first boot disk status unless the user specified otherwise.
 
Old 06-27-2007, 01:34 PM   #8
NomDeGuerre
Member
 
Registered: Oct 2003
Posts: 136

Original Poster
Rep: Reputation: 15
Why would GRUB end up in sda or sdb when I installed Ubuntu on hdb and only used sda as /home ? Either way I can't nuke sda and sdb since that's where I keep everything, hdb was for OS only.

I had Ubuntu and Windows XP on hdb, my 40gb hard disk. When I did fixmbr with the Windows XP cd I had to choose which hard disk to do it to, and the only choice was C: (where XP was installed, which is hdb) so I didn't restore MBR on the wrong disk. Yesterday I formatted the whole disk to NTFS and installed Windows XP on it, it boots just fine. It did before too when Windows was in a partition and Ubuntu was in another, after I did fixmbr to get rid of GRUB that is. Before I had done fixmbr neither Ubuntu or Windows would start when I chose them in the GRUB menu.


ST340016A which is first in the BIOS boot order for hard disks is my 40gb hard disk and it is also bootable as you can see from the results that I got after doing 'fdisk -l'.

I put in the Debian cd and chose to execute a shell, when I typed in 'grub' I got this:

Code:
/bin/sh: grub: not found
 
Old 06-27-2007, 02:48 PM   #9
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
OK you 1st disk is now Xp.

Thus to install and boot a Linux you can either

(1) Use Xp's boot loader NTLDR to boot Linux. Task E4 in the last link in my signature refers.

or

(2) Put another disk as first bootable disk. Install Linux or restore its boot loader. You then boot XP by switch the boot disk order on-the-fly, using commands inside Grub or Lilo. Section A of the second link of my signature refers
 
Old 06-27-2007, 06:11 PM   #10
NomDeGuerre
Member
 
Registered: Oct 2003
Posts: 136

Original Poster
Rep: Reputation: 15
Perhaps I misunderstand but I get the impression that to do nr. 1 I need to actually have GNU/Linux installed already (which I don't), is that right? If not, how will I get e.g. Ubuntu installed after doing those things if I can't even create a partition for it using the installation disc?


I don't want to keep Windows XP though, I'm just forced to use it.
What I want is to completely remove Windows XP, fix the problem (whatever it is), and install Ubuntu.

Nr 2. I can't do, my two other disks are full.
 
Old 06-29-2007, 03:53 PM   #11
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Have you tried using the system rescue CD or RIP or something
to see if they can re-partition hdb?


Cheers,
Tink
 
Old 07-02-2007, 06:19 PM   #12
NomDeGuerre
Member
 
Registered: Oct 2003
Posts: 136

Original Poster
Rep: Reputation: 15
I haven't tried those but I did just try cfdisk with an old Slackware 9.1 cd. I deleted the NTFS partition which took up the whole disk and made two 7gb partitions at the beginning and one 2gb swap at the end. Then I put in the Ubuntu cd and got to the partitioning program in that. The first 7gb partition was NTFS, I guess that's because cfdisk didn't actually format the partition only created it so the old stuff was still in it (though WinXP wouldn't boot properly afterwards since I messed the partitions up). So I choose to format the first partition to ext3 and at first it looked like it was going to work but then it stopped and gave me this message:

Failed to create a file system
The ext3 file system creation in partition #1 of IDEslave (hdb) failed.

I then tried to delete all the partitions (we're still in ubuntu installer) and choose to install Ubuntu on the entire disk (hdb) instead of manually setting up the partitions. I then get this error message:

The attempt to mount a file system with type ext3in IDE1 slave, partition #2 (hdb2) at / failed.


So now I've at least gotten to more error messages (clues?). We're making some progress!
 
Old 07-02-2007, 06:53 PM   #13
AceofSpades19
Senior Member
 
Registered: Feb 2007
Location: Chilliwack,BC.Canada
Distribution: Slackware64 -current
Posts: 2,079

Rep: Reputation: 58
you should just reformat and start from scratch
 
Old 07-04-2007, 09:50 AM   #14
NomDeGuerre
Member
 
Registered: Oct 2003
Posts: 136

Original Poster
Rep: Reputation: 15
Well that's the problem, I can't.
 
Old 07-05-2007, 08:55 AM   #15
NomDeGuerre
Member
 
Registered: Oct 2003
Posts: 136

Original Poster
Rep: Reputation: 15
When I tried installing Ubuntu on the entire disk (read post #12) I chose not to use sda and sdb so those weren't mounted but it still wouldn't work so obviously those are not part of the problem, right?

I have this in my notebook, I think it's from trying to install Slackware.

Code:
[!!] Install the base system
Base system installation error

The debootstrap program exited with an error (return value 1).
Check /var/log/syslog or see virtual console 4 for the details.
I checked virtual console 4 and saw several of these:

Code:
(here was date and time) kernel: [  197.017785] end_request : I/O error, dev hdb, sector 812653
The numbers 197.017785 and 812653 were different on each line.
 
  


Reply

Tags
disk, error, external, grub, harddrive, inputoutput, io, read, usb, write



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
how to install external harddrive ION USB 2.0 IOGEAR? cara Slackware 4 03-01-2006 05:33 PM
USB External harddrive ashley75 Linux - General 1 10-28-2005 10:54 AM
USB 2.0 external Harddrive Problems Lars09002 Linux - Hardware 0 05-05-2005 08:45 AM
USB 2.0 PCMCIA external harddrive basd Linux - Hardware 5 10-02-2003 11:44 AM
Installing linux to and USB external Harddrive??? loser04 Linux - Hardware 1 08-18-2003 02:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:35 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
Open Source Consulting | Domain Registration