LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   URGENT: Hard drive is dying, need migration (https://www.linuxquestions.org/questions/linux-general-1/urgent-hard-drive-is-dying-need-migration-258136/)

AngryLlama 11-22-2004 07:59 PM

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

mritch 11-22-2004 08:16 PM

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.

AngryLlama 11-22-2004 08:20 PM

But will cp -a preserve devices correctly?

qwijibow 11-22-2004 08:35 PM

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.

AngryLlama 11-22-2004 08:37 PM

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

mritch 11-22-2004 08:46 PM

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.

AngryLlama 11-23-2004 01:14 AM

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.

mritch 11-23-2004 02:22 AM

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.

AngryLlama 11-23-2004 12:13 PM

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

mritch 11-23-2004 12:53 PM

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?

AngryLlama 11-23-2004 01:18 PM

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

theYinYeti 11-24-2004 03:42 AM

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.

AngryLlama 11-27-2004 10:31 AM

That looks pretty good. I should probably do something like that in a cron to backup my home directory.


All times are GMT -5. The time now is 10:51 AM.