Debian install problem

Varun

Golden Member
Aug 18, 2002
1,161
0
0
Greetings.

I have a 10GB Seagate Hard drive on an AX59 Pro/K62 500MHz machine that I want to set up as a webserver.

The Seagate drive came from an Xbox, it's a regular 10GB PATA drive set as primary master.

During the install, it auto sets up the partitions - 9.6GB for / and 444.1MB for swap. However when I select write partitions to disk and say YES on the warning page, it goes for a while then gives an error:

Input/Output error during read on /dev/ide/host0/bus0/target0/lun0/disk

The only way to get past this is to cancel on the error, and shortly after I get an error that says

Failure to create Swap

Any input? Do you think it is because the hard drive came from an Xbox? I have a 20GB Maxtor drive however the bearings are SO loud in it, I don't want to use it as it will likely die.

p.s. I auto detected the IDE drive in the BIOS, and set it to LBA which was the recommended option. I also tried NORMAL and the same thing.

Thanks for the input.
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Well the first thing I immediately think of is, 'did the burn on the install cdrom work correctly'

It seems that burned cds with errors are the highest cause of problems when it comes to installs were the machine locks up or you get weird errors.

However it seems like it's the harddrive itself that is suspect, but keep the cdrom in mind.. maybe try reburning a new one under slower speeds.

But we can find if it's the harddrive or not thru a test... I could be something to do with it being in a Xbox, but it could also be simply caused by weird file system freakiness. It is also likely that the drive is failing and has some bad sectors on the drive that can't be worked around.

We can try out a command... If your harddrive is /dev/hda you go like this:
dd if=/dev/zero of=/dev/hda

That will fill up the entire drive until it reaches the end of the drive and it will error out cleanly, since it will run out of space.

If it hits some bad sectors it will probably choke a bit or do a few errors before failing completeley.

It is basicly filling up the harddrive with 0's.. obliterating all information on the drive and completely erasing the master boot record.

Sometimes on install CD's they do weird stuff like that /dev/ide/host0/bus0/target0/lun0/disk

In that case sometimes they make a symlink to /dev/hd*, but the command for dd would work the same..
dd if=/dev/zero of=/dev/ide/host0/bus0/target0/lun0/disk


I think it has to do with devfs, not sure. When the install cdrom boots up and its time to pick a kernel or whatnot.. you normally just hit enter and it selects 'linux', at that prompt select 'linux26' instead. That way your using a probably better kernel version, plus when you get finished with your install your system will default to a 2.6 version, which I think is better then 2.4 series kernels.

Even then it might use the goofy /dev name for the harddrive. Just use whatever is best.

In the debian install cdrom there is a install menu to select tasks.. you can get to a command line prompt from that or you can do ctl-alt-f2 and do a command line from that.

If your having a hard time try booting up with a knoppix cdrom or even a simple linux-on-a-floppy can run the dd command perfectly well.

A good linux on floppy system is Tom's root boot disk images...
http://www.toms.net/rb/

After you get the dd done, it should take a LONG time.. after all your creating a 10+ gig file of nothing but zeros on the harddrive.. then you can try to install Debian on it again and see if it works.

I've used dd to 'repair' drives that have had completely borked master boot records and I've use it to confirm a failed disk.


Also on a side note it's usefull for semi-securely destroying data on the disk.. Another device other then /dev/zero you can use /dev/urandom, and if you need to securely erase a disk by alternating between usind dd if=/dev/zero and dd if=/dev/urandom... (of course the only perfectly secure way to destroy the data on a disk is to destroy the physical media.)
 

Varun

Golden Member
Aug 18, 2002
1,161
0
0
Thanks for the tips Drag.

I put this hard drive in my XP box, and booted it. BIOS detected it fine, however the drive does not show up in Disk Managment at all. I'm pretty sure they put a proprietary MBR or something on the disk.

I'll plug in my 20GB Maxtor of DOOM and see how it goes I guess.

p.s. if I have a working Linux webserver, is there software to image it onto a DVD or something so I can move it to a different hard drive when I can get one?
 

Varun

Golden Member
Aug 18, 2002
1,161
0
0
I put the Maxtor in and it worked right off the bat.

I set up

/boot as 150MB
/ as 15GB
/home as 2.5GB
swap as 2.5GB

Does that sound good or should I do that again?
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Ya..

It's the dd command again. You can use that to make a image of a drive. I use it to make images of cdroms, too.

for instance:
dd if=/dev/cdrom of=randumb.iso
(to bad that doesn't work in reverse! I use cdrecord to burn disks from iso images)

If you want to get fancy you can do it over a network.. say you have two machines booted up on cdroms... The image is comming from 10.0.0.1 and is going to 10.0.0.2
(you don't want to do this while filesystems are in use.. you can do it will the drive is in use.. but not exactly what is copying)

On the 'receiver' machine:
nc -l -p 8000 | dd of=/dev/hda
or alternatively if you just want to make a image file...
nc -l -p 8000 | dd of=/path/to/harddrive.img

then on the 'giver' machine:
dd if=/dev/hda | nc 10.0.0.2 8000

(it will use tcp port 8000 for the transmission, it can be whatever you want)

To mirror just partitions you'd just use the /dev/hda1 partition name instead of the harddrive device file.

The downside for this is that the receiving device has to have the same space or more aviable to it then what the sending device has. Otherwise it will run out of room.

If your upgrading from a 10gig to a 120gig drive it's pretty easy.. You go like this...
1. turn off computer, setup receiving drive as secondary master, assuming that the original drive is primary master
2. boot up computer with knoppix or floppy or whatever you want
3. dd if=/dev/hda of=/dev/hdb
..wait.. ..wait..
4. once finished resize partitions and filing systems to fill up the entire new drive with something like parted or qtparted.

Some types of filing systems can be shrunk, most can be expanded to fill the entire space aviable.
5. turn off computer, take out old drive, put new drive as primary master, reboot.

And that should be it.

The dd utility was originally designed for copying files to tapes and such. It can deal with changing block formats and other more fancy stuff that most people don't need anymore.

the major major downside to dd is that it copies _everything_ including empty space.

So if your backing up a partition that has 30 megs of space used but has 6gigs of space aviable it will make a 6 gig image.

That's why for backups most people use tools like tar and dump.

Tar is very handy...

For instance if you want to backup your filing system thru the network you can use tar and netcat to do it pretty easily and quickly. I also use it for transfering large files between computers... the downside it's not secure. For secure transfers of files avoid netcat and ftp and use scp or some more complex file service.

For backing or tranfering entire directory systems from root upwards you have to be aware that there are several not-real filing systems.

For instance /proc /dev/ and /sys are not real physical systems. You don't want to back those up.. for isntance what happens when your reach /dev/zero?

So it's easiest to do it from a boot disk, however with care it's easy enough to do while a machine is running you just have to be more selective. I usually just use a boot disk..

To do that you'd go
on the receiving computer
receiver ~# nc -l -p 7000 > root.tar
on the 'server'
giver ~# tar cf - /* | nc 10.0.0.2 7000

If you want to create a compressed tarball, and maybe you want it to tell you what files have been copied you can go:

nc -l -p 7000 > root.tar.gz

tar zcf - /* | nc 10.0.0.2 7000


For copying files from computer to computer without making a tarball..
nc -l -p 7000 | tar x

tar cf - * |nc 10.0.0.2 7000


So on and so forth. For regular backups you'd probably want something more robust, for for one of thing s were your there to watch and confirm everything is working it's fine.

Or something like that.

Usually I forget something and have to try a couple times to get anything to work.

For much more detailed information google around.


Also you can simply use cp to copy your root directory system from one mounted partition to another. See the man file for the proper command modifiers to enable perserving time stamps and symbolic links and such. I think with gnu cp you can just go cp --archive and get good results.

Most people use tar though. It's very handy for moving any sort of directory system around.


The downside to using tar is that you'd have to setup the partitions and file systems prior to copying the files over. That includes the master boot record. After moving the files over you'd have to use the chroot command to use the file system as if it was booted up and re-run lilo or grub-install scripts to get your bootloader working again. With DD all that is copied over... the mbr, the file system or whatever.

The up side is that any device your copying to can be any size you want, just as long as it has enough space for the files itself.

If you have multiple smaller devices you can use 'split' command to divide up tarballs and other large files and such. (like how *.rar files work in windows-land) If your going to compress the files... compress AFTER you've split them into smaller parts. If you split up a compressed file and one of those peices is lost or corrupted then the whole thing is gone. If split then compress each peice even if one peice is missing or corrupt then the rest of the archive can be rescued.

I tend to use tar a bit more. Using Knoppix with chroot command is a very handy way to rescue non-boot-able operating systems.

Say your root is held on /dev/hda2 partition. So from knoppix you'd do something like:
mount /dev/hda2 /mnt/hda2root

mount -t proc proc /mnt/hda2root/proc

cd /mnt/hda2root
chroot ./

and there are some usefull options for chroot and stuff. So if you ah heck up your bootloader you can use chroot like that to help you fix it. Or if you need to change some files like fstab it can make things a bit easier because then you can mount file systems and double check different configurations.

Also you can run services and do updates thru chroot...

For instance it's common security practice to setup a special little file system for running traditionally insecure programs like 'bind' dns server in chroot'd enviroments seperate from the host os. This sort of thing is called a 'chroot' jail.


Most of this stuff is fairly complex, but after you do a few rescues and copy a few root directories around then it makes sense.

If that is to much then regular Ghost will work almost as good. Also there are automated backup things like Amanda and OSS versions of Ghost clones that can make things seem simplier and such. Google around.
 

Varun

Golden Member
Aug 18, 2002
1,161
0
0
Oh my goodness Drag that is a pile of information I have to chew through. I used Slackware a little bit in the past and am trying Debian really as total beginner. I don't understand most of what you said, but I'm going to copy it to a word document and keep it for later reference when hopefully some of it makes sense!
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
just google for it. Lots of people explain it much better then me.

For instance a search for

dd harddrive image

gets this page on the first hit:
http://www.rajeevnet.com/hacks_hints/os_clone/os_cloning.html

It explains things pretty well.

Also here is the page for parted...
http://www.gnu.org/software/parted/parted.html

So don't be worried if you don't understand or remember most of it. It's probably fairly innaccurate anyways. Just get some of the terms and commands in your head then when you need them you just look them up and that will help you to know what to do.

:)
 

Varun

Golden Member
Aug 18, 2002
1,161
0
0
since you're here...

I did apt-get install gnome on Debian 3.1, it did a bunch of installing.

Anyways how do I get to the desktop? I tried startx and got bad command, which is what worked for me in Slackware.

This is going to be a heck of a learning curve
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Ah, bad command?

Do you mean something like 'bash: startx: command not found'?

Make sure that you have X windows isntalled.

apt-get install x-window-system

Otherwise make sure that you have /usr/bin/X11 in your path statement. ( echo $PATH )

Usually xdm or gdm is set to start up by default. It won't let you use startx to start x when one of those are running..

edit:
(if you selected 'server' in tasksel then I don't think it installs X by default.. so maybe you want to go back and run tasksel and select both 'desktop enviroment' and 'webserver' to make things easier.)