LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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

Reply
 
Search this Thread
Old 11-22-2004, 07:59 PM   #1
AngryLlama
Member
 
Registered: Sep 2004
Location: /dev/urandom
Distribution: Gentoo
Posts: 171

Rep: Reputation: 30
URGENT: Hard drive is dying, need migration


Hello.

I am currently running Gentoo and Windows XP on my computer. Windows was originally installed on my larger and faster harddrive, and Linux is installed on a spare harddrive. I really like Linux now, so I made the decision to install Linux on the main harddrive with Windows. So, I backed up the Windows drive to an external USB Harddrive. I intended to reinstall Windows and migrate Linux over. Today I tried to boot into linux and the linux harddrive kept failing. It couldn't even be mounted during boot without something like-- hdb: dma-intr: error=0x7F { UncorrectableError SectorIDNotFound ... } Very scary to say the least.

I disabled DMA in the BIOS and fortunately, it booted. However, the HDD must be on it's last leg.

I need directions to migrate Linux over to the new harddrive. I found this page here:here, and it seems pretty legit. Is this a good method? Has anyone else had experience with this? You don't have to taylor to my exact problem, a good reference would be great though.

Thank you!
Paul

Last edited by AngryLlama; 11-22-2004 at 08:06 PM.
 
Old 11-22-2004, 08:16 PM   #2
mritch
Member
 
Registered: Nov 2003
Location: austria
Distribution: debian
Posts: 667

Rep: Reputation: 30
i didn't took a closer look, but there is quite a lot harddisk i/o involved. using
cp -a /whatyou/need or large file copying with
tar -input | tar -output (see the manpages)
or using parted to copy the whole partition to another drive will all do it if just your harddisk stays alive.
if you'd like to use (aka try to use) your hd afterwards use mke2fs with the double -c flag (destructive r/w check).

fngcrs, mritch.

%
Windows Tip of the Day:
Add DEVICE=FNGRCROS.SYS to your CONFIG.SYS file.

Last edited by mritch; 11-22-2004 at 08:17 PM.
 
Old 11-22-2004, 08:20 PM   #3
AngryLlama
Member
 
Registered: Sep 2004
Location: /dev/urandom
Distribution: Gentoo
Posts: 171

Original Poster
Rep: Reputation: 30
But will cp -a preserve devices correctly?
 
Old 11-22-2004, 08:35 PM   #4
qwijibow
Guru
 
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672

Rep: Reputation: 47
noooo.... dont migrate a booted root partiton.
boot with a live cd like KNOPPIX and use that to mount and migrate the filesystems.

Linux uses lots of "lock files" for example... when you boot into graphical mode, a lock file is created to stop any more instances of the X-server running on the same desktop as the one thats already running..

when you shutdown, the lock file is deleted.

if you migrate a booted file system, all those Lock files will also be coppied !

and your migrated system will not be able to start many programs, because it will think they are already running.. it will be a complete mess !

Knoppix is a good live-CD distro.. but if you have a slow internet connection, try DamnSmallLinux.

both will work for this purpose.
 
Old 11-22-2004, 08:37 PM   #5
AngryLlama
Member
 
Registered: Sep 2004
Location: /dev/urandom
Distribution: Gentoo
Posts: 171

Original Poster
Rep: Reputation: 30
Oh don't worry, I wouldnt do it while the OS was active. I was planning on doing it from my Gentoo 2004.2 Live CD. However, I still want to know the best means of actually copying the data
 
Old 11-22-2004, 08:46 PM   #6
mritch
Member
 
Registered: Nov 2003
Location: austria
Distribution: debian
Posts: 667

Rep: Reputation: 30
probable not. man MAKEDEV/mknode.
if you have udef or devfsd setup ok, you should not have to worry.
i'd use parted. cp minor ....
then boot (bootable rescue cd, floppy with similar kernel, root=/dev/new_root_partition) or chroot into your new partition and rerun lilo with a suitable lilo.conf

sl mritch.
 
Old 11-23-2004, 01:14 AM   #7
AngryLlama
Member
 
Registered: Sep 2004
Location: /dev/urandom
Distribution: Gentoo
Posts: 171

Original Poster
Rep: Reputation: 30
Great Thanks,

I have one more question. Can I install the boot partion past sector 1023? I know in the past one couldn't. The first partition will be a 20GB NTFS, followed by the /boot and other linux partions. I will be using grub as my bootloader. My computer is an Athlon XP. Has this limit been removed for a setup like mine?

Edit: Nevermind. I'm pretty sure I have LBA.

Last edited by AngryLlama; 11-23-2004 at 01:49 AM.
 
Old 11-23-2004, 02:22 AM   #8
mritch
Member
 
Registered: Nov 2003
Location: austria
Distribution: debian
Posts: 667

Rep: Reputation: 30
usually that's no good idea = depends on the bootloader you use. rare, but there are problems with lba. use the hda=dimensions,*,* in such a case.
i think lilo is such a loader that needs the kernel to be within the first 1024. read lilo's manual.txt/ grub doc about this restriction.

btw: i like to have a small linux partition (~64mb) with static busybox and other useful things there anyway. serving as boot & rescue partition. sometimes things simple go really wrong... %)
it's a quite slow part (mechanical) of the disk also.

even more complex/confusing: put another loader into the masterbootrecord (does smbdy. know one resistent against those frequent windows-reinstallations? and lilo added with boot=/dev/hda1 or at a bootable marked partition hda1.

x simple: stay with the limitation (i only know/use lilo working right this way for sure).

if you can't accept it, have a look for another way to get a useable boot table (even nfs or via tftp is possible if you have the vmlinuz loaded) you can also boot from vfat with loadlin.exe & kernel & boot-options.
via kernel compilation (and bootparameters) there sometimes is a way to handle even braindead broken bioses.

sl mritch.
 
Old 11-23-2004, 12:13 PM   #9
AngryLlama
Member
 
Registered: Sep 2004
Location: /dev/urandom
Distribution: Gentoo
Posts: 171

Original Poster
Rep: Reputation: 30
Well, I've been busy, and this is my current situation.

I created my partitions using fdisk and created the filesystems using the appropriate mkXXX tools. I tried copying with parted but it said my ext2 was unusual, so I did not continue. Instead, I used the instructions on the site I mentioned in the first post. The copy looks fine, permissions and all.

I then booted with my Gentoo live cd, mounted the proper filesystems (including the instructions in the handbook for /proc). I did an env-update, MAKEDEV update, and at this point everything looked good, including my devices.

I then edited /etc/fstab and /boot/grub/grub.conf to adjust to the new partitions. I ran grub-install and it didn't throw any errors, everything seems fine... I bit the bullet and restarted. But, the old Grub menu (from the older drive) came up. So I fixed the first boot device in the BIOS, but it looked like the old menu again, so I booted from it anyways.

I figured I was in my old enviroment for some reason. My plan was to mount my new filesystem and double check the conf files. I was in one of the steps of mounting the harddrive (a mkdir or the actualy mount) and all of a sudden my system turned off! Now, I cannot boot my system. I cannot get to my BIOS. My harddrives do not even spin up. But my fans and lights lightup. Whats going on? PSU? CPU? MOBO?

Anyways, any ideas would be appreciated.
Paul

Last edited by AngryLlama; 11-23-2004 at 12:15 PM.
 
Old 11-23-2004, 12:53 PM   #10
mritch
Member
 
Registered: Nov 2003
Location: austria
Distribution: debian
Posts: 667

Rep: Reputation: 30
the old bootloader wasn't rewritten.

what's this parted message about?
how are your hd's partitioned?

i can't tell much about the grub bootloader, but posting a configuration file may help.

have you done all neccesary changes - is everything mounted right?
check for a valid /proc and for error messages in the various /var/log/ logfiles.

running MAKEDEV is imho not needed here, but shouldn't break anything. be sure grub will work in this situation and doublecheck your configuration: boot- & root-device, bootflag, right disk?:
normaly your pc will try to boot off the first disk on the first ide-controller = hda. at the very beginning of this drive, there is the mbr,...(read lilo's manual.txt and/or grub documentation).

than try to boot into your new system with the valid root=/dev/hdX settings? example: i'd take the knoppix or debian bootcd and boot the linux kernel with root=/my/root.

sl mritch.

btw: which kernel version is in use?
 
Old 11-23-2004, 01:18 PM   #11
AngryLlama
Member
 
Registered: Sep 2004
Location: /dev/urandom
Distribution: Gentoo
Posts: 171

Original Poster
Rep: Reputation: 30
YAY!

It turns out my old harddrive was bringing the system down. It wouldn't even boot with the harddrive plugged in. Looks like I backed everything up just in time. I am now running linux on my new harddrive and everything is just how I left it, except now I'm not on a cramped up harddrive.

Thanks again to everyone for their help. Its great to be able to get assistance during times of hardware disaster. I would have cried if I had to recompile my whole system and reprogram 100's of hours worth of source code.

~Paul


P.S: This case is closed
 
Old 11-24-2004, 03:42 AM   #12
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 61
I see you're OK. Fine. Just for the record, here's a usefull thing I did last time I had to backup.

Problem: I wanted to backup on CD, but:
- nowhere in the PC there was room for an ISO file;
- and anyway, the CD burner just wouldn't want to work anymore, so no way to do it with mkisofs | cdrecord.

Solution: I connected the network, and for each (list of)directory I wanted to backup, I did:
Code:
local># cd /place/with/things/to/backup
local># tar cf - things to backup | ssh remoteuser@remotehost 'gzip >backup-XX.tar.gz'
...increasing XX each time.

Yves.
 
Old 11-27-2004, 10:31 AM   #13
AngryLlama
Member
 
Registered: Sep 2004
Location: /dev/urandom
Distribution: Gentoo
Posts: 171

Original Poster
Rep: Reputation: 30
That looks pretty good. I should probably do something like that in a cron to backup my home directory.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is this hard drive dying? newmoon Linux - Hardware 5 11-14-2005 02:46 PM
Hard Drive Migration-upgrading to new SCSI stunter Linux - Hardware 1 07-04-2005 10:02 PM
Hard Drive Migration wdingus Linux - General 2 04-07-2005 01:19 PM
Hard drive dying. Need to move Linux partition over. Fear58 Linux - General 3 01-29-2005 05:14 PM
Hard drive dying, good backup method cadj Linux - Software 3 12-14-2004 07:28 PM


All times are GMT -5. The time now is 07:07 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration