On 24/11/12 14:01, Michael James Daffin wrote:
Don't see why would wouldn't be able to just dd the data to the new
disk, assuming the new disk is larger. You can then use any partition
manager tool to increase the size of the partitions to fill the new space.
Worst case is it fails and you have to reinstall anyway... assuming you
have the time, and since you had the time to create the image in the
first place.
(Well, the actual worst case is you dd the wrong disk and lose
everything then panic and set your house on fire ;) )
On 24 November 2012 13:52, Tim Brocklehurst <[email protected]
<mailto:[email protected]>> wrote:
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: [email protected]
<mailto:[email protected]>
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--------------------------------------------------------------
--
Michael Daffin <[email protected] <mailto:[email protected]>>
Thanks to both of you. I'm now up-and-running on the new disk.
I used Michael's way, with one tweak. The new disk is the same size as
the old one, not bigger, so I took a separate rescue partition for both
sda1 and sda3. Then I used 'ddrescue -f' to get them onto the new disk,
and finally reconfigured grub2. My joy when it booted was boundless!
I've been *very* wary of changes to hardware since upgrading an Amstrad
PC1512 to 640KB RAM, many years ago. You had to take the whole thing
apart to get at the memory slot. The upgrade worked, but I still
remember looking at this expensive computer lying in bits in the spare
room, thinking "What have I done?" One more dragon seriously wounded, if
not completely slain.
--
Kevin Safford
--
Please post to: [email protected]
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--------------------------------------------------------------