On Saturday 24 Nov 2012 13:17:12 Kevin Safford wrote:
> gsmartcontrol reports that my hard disk is failing.
>
> I can still read and write to the disk, but I want to replace it before
> it's too late. I've not had to do anything like this before, so help! I
> have a new disk, ready and waiting.
>
> The failing drive is partitioned as:
> /dev/sda1 ext4 / 37.25 GiB
> /dev/sda3 ext4 /home 424.63 GiB
> /dev/sda2 extended 3.87 GiB
> /dev/sda5 swap
>
> After the latest problems, I booted into recovery mode and ran fsck,
> accepting the default options, to tidy up orphan files.
>
> I then installed ddrescue, and put a copy of /dev/sda on an external
> hard drive:
>
> sudo ddrescue /dev/sda /media/rescue/sda_rescue rescue.log
>
> That gives me a 500 GB file. I've also got (stored separately), gz
> backups of /home.
>
> From some of the messages I got when installing ddrescue (from memory,
> that there's no version information for various packages, assuming they
> are not installed), I've lost some of the synaptic information.
>
> What's my best way forward from here? When I've swapped disks, can I use
> dd to write my rescued information to the new hard drive?
>
> If so, is it advisable to do this, or is it better to do a clean
> install, and copy over /home from a backup?
>
> If I do a clean install, what's the easiest way of getting a list of
> software that I've installed through synaptic, and reinstalling it?
>
> I'm running Mint 13 Mate 64-bit.
If you don't have too much stuff configured (or time is not an issue) I would
opt to do a clean install on the new disk and then copy /home from the
existing disk.
On debian type systems you can use "dpkg --get-selections" as root to show
installed packages. If you diff this against a clean install then you should
get a managable number of packages to re-install.
You can also use tar to archive the root partition (ie. tar --one-file-system -
cvf root.tar /) and then restore it on your new disk.
On using dd, if you dd a whole device (/dev/sda), then you store the whole
geometry. If you dd /dev/sda1, then you only store the filesystem and you can
mount this with loopback options later, which is more flexible. Chances are
that when you change disks you would usually take the opportunity to put more
storage in. Therefore, recreating the exact device may not be what you are
after.
Hope this helps,
Tim B.
--
Hampshire Linux User Group Chairman
--
Please post to: Hampshire@???
Web Interface:
https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL:
http://www.hantslug.org.uk
--------------------------------------------------------------