LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-05-2006, 10:58 AM   #1
Yalla-One
Member
 
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 641

Rep: Reputation: 36
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
 
Old 08-05-2006, 12:32 PM   #2
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,940

Rep: Reputation: 129Reputation: 129
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.
 
Old 08-05-2006, 12:32 PM   #3
GrueMaster
Member
 
Registered: Aug 2005
Location: Oregon
Distribution: Kubuntu.
Posts: 848

Rep: Reputation: 30
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!
 
Old 08-05-2006, 12:54 PM   #4
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,940

Rep: Reputation: 129Reputation: 129
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.
 
Old 08-05-2006, 01:00 PM   #5
kd5pbo
Member
 
Registered: Jun 2006
Location: Washington, DC, USA
Distribution: Slackware
Posts: 41

Rep: Reputation: 15
If things get really bad, try ddrescue.
http://www.gnu.org/software/ddrescue/ddrescue.html
 
Old 08-05-2006, 08:12 PM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
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.
 
Old 08-06-2006, 06:49 AM   #7
Yalla-One
Member
 
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 641

Original Poster
Rep: Reputation: 36
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
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is my hard disk dying? Nylex Linux - Hardware 6 07-16-2006 02:31 PM
Hard disk failure, how to salvage? Worstje Linux - Hardware 3 04-25-2005 06:23 AM
What can be done to salvage a bad CD? vasudevadas Linux - Hardware 5 04-17-2005 11:34 PM
Dying disk???? Mux Linux - Hardware 2 10-22-2002 06:27 PM
How avoid boot disk and 'startx' command? whitehof Linux - General 5 10-17-2002 02:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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

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