LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Dying disk - how to salvage and avoid disaster (https://www.linuxquestions.org/questions/slackware-14/dying-disk-how-to-salvage-and-avoid-disaster-471047/)

Yalla-One 08-05-2006 10:58 AM

Dying disk - how to salvage and avoid disaster
 
After upgrading to the latest -current (today), my disk has started to make more and more noise, and logging in on KDE now takes 3-4 minutes, as opposed to 10 seconds...

I can't find anything in the changelog that suggests a software problem, so I assume my disk is starting to die. (It's a laptop from 2002).
Other symptoms are that the load is constantly above 2 (against 0.01), that various programs don't function (I/O error etc) and that other files are not found.

So - without further prelude - I have a 2 week old backup and would obviously like to salvage whatever files I have worked on in the meantime. Can someone with prior knowledge and experience (please, in this case, no well-meant guessing) please advise if the following plan makes sense:
  1. Boot CDROM Slackware 10.2 boot-disk
  2. Mount external USB-disk
  3. Mount internal harddrive ReadOnly
  4. tar -czvf /mnt/usbdisk/backup.tgz /mnt/origdisk/home/*
  5. Get a list of all packages installed from /mnt/origdisk/var/log/packages to see what packages I need to install once I've reformatted / bought new disk
  6. copy entire /etc to be on the safe side...
  7. Pray to whatever I hold holy that no important files were lost

Did I forget anything? Should I add other parameters to the tar command?

Any input greatly appreciated!

Thanks in advance!

-Y1

Bruce Hill 08-05-2006 12:32 PM

Why boot with the CD? Just boot to CLI and "cp -a /home/y1 /mnt/usb/"
and then do that for /etc or whatever else you want.

You could also put that laptop drive in the USB enclosure and mount
it with your PC and copy, if that's an option. I'm doing that all the
time with failed drives in Windoze laptops. Just cp to my server.

To determine if you have a package that is specific to your kernel:
ls /var/log/packages | grep `uname -r`

And there's a pkgtool command, iirc, which will let you find out any
packages that aren't from the original distro install, but I cannot
remember it now. Will search and post back if I find it.

GrueMaster 08-05-2006 12:32 PM

Depending on how big your external usb drive is, and how much drive space is being used on your laptop, you could backup the entire drive to the usb drive using partimage. It works similar to Norton's Ghost (except it's free as in beer). It will backup each partition, including the boot sector to a destination drive, either mounted on the system or on the network (it includes a daemon process if you don't want to use nfs).

If you don't have an external usb harddrive, I'd highly recommend getting one. The cases ususally run $20-$30, and will take a normal desktop harddrive (IDE or SATA on the newer cases).

Good luck!

Bruce Hill 08-05-2006 12:54 PM

Yalla-One,

LOL -- that was in one of your threads:
http://www.linuxquestions.org/questi...d.php?t=461212
and it appears you have to already have used "slackpkg" to update
your system. So, that precluded me from trying it out.

kd5pbo 08-05-2006 01:00 PM

If things get really bad, try ddrescue.
http://www.gnu.org/software/ddrescue/ddrescue.html

jschiwal 08-05-2006 08:12 PM

How large the hard drive that you need to backup?
If the externel usb drive is formatted in a fat filesystem, then it will not be able to hold files above 2 GB in size.

If you already have files on the drive, and can't reformat it, you could pipe the output of dd_rescue to the split program. The dd_rescue program is similar to the dd program, but it doesn't abort on errors, so it can be used to backup a drive image from a failing drive with read errors.

If you just want to backup files from your HOME directory and perhaps the /etc directory, you could use the find command and pipe the output to xargs to tar it up and pipe the output of that to split.

A split tarball can be restored by CATing the parts together and piping the output to tar. Example:
cat /mnt/usbdisk/homebu.tar.gz.0?? | tar -C ~/ -xvzf -

This would allow you to reinstall and restore only what you want, without having to handle a 10 GB tar backup.

Yalla-One 08-06-2006 06:49 AM

Thanks much to all the repliers!

I mounted my external USB disk and did a tar czpvf of /etc, /var/log/packages and /export/home/my_users, then ran reiserfsck on the partitions, which all came up clean. The system now appears to be running fine, without any of the weird sounds from the harddrive, but this has been a serious wakeup call, so I'll have it replaced to be on the safe side.

As Chinaman pointed out I already have a script to see which packages are installed on a system that are not "core" Slackware, but I never used slackpkg ;)

Otherwise - thanks again for the insight, giving me confidence to try this out, and making it work. Much appreciated, and kudos to LQ and their users for once again jumping to the rescue ;)

-Y1


All times are GMT -5. The time now is 08:54 AM.