[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Replacing Dying Harddisk (ReiserFS)



Darryl Clarke wrote:
Hi,

I was wondering if anybody has any wonderful ideas as to how I should
go about "ghosting" my existing linux system.

Norton Ghost only supports EXT2/3 for linux and I used ReiserFS so
using it is out of the question.

Does anybody have any ideas as to how I could transfer my existing
setup to the new drive?

Old Disk: 8gb /dev/hda
New Disk: 80gb /dev/sda (currently plugged into USB2, to be moved to /dev/hda)
Bootloader: Grub
Filesystems: ReiserFS

Hopefully there's a simple solution ;) Thanks!


This is how I cloned my failing hard drive:

Hard disk clone
===============
==============================
Make a copy of the partition table (thanks to Osamu for this).
	- print out the partition table and save it on a piece
	of paper glued/taped to the disk

	fdisk -l /dev/hda | lpr

Making back up binary copy to Floppy may help.

# dd if=/dev/hda of=/dev/fd0 block=512 count=2

THis always gives you complete recovery for base partition.



===============================


Debian Packages
---------------
util-linux (provides sfdisk)
gcc make (needed to complile pcopy)

Source package
--------------
pcopy-1.5.tar.gz (from ftp://ftp.lysator.liu.se/pub/unix/pcopy)


Compile and install pcopy
-------------------------
$ tar -xzvf pcopy-1.5.tar.gz
$ cd pcopy-1.5
$ ./configure

$make

$ su
Password:
# make install
/usr/bin/install -c -m 755 pcopy /usr/local/bin
athlon:/home/chris/download/pcopy/pcopy-1.5
# exit
$


Assumed hardware setup
----------------------
Original IDE hdd is primary disk with jumper set to master.
New IDE hdd is secondary disk with jumoer set to cable select (CS).


Clean up existing systems
-------------------------
Run scandisk on MS Windows systems.
Run fsck -Cv on unmounted Linux partitions.


Single user mode?
-----------------
You might want to go to single-user mode before starting to copy the disk, in order to shut down the system daemons and preserve the state of the logs, and to prevent users from logging in:

/sbin/telinit 1


Stop network
------------
# /etc/init.d/networking stop
Deconfiguring network interfaces...done.
#


Get a list of existing partitions
---------------------------------
cfdisk /dev/hda1

Copy to and print from an editor.


Copy partition table
--------------------
NB Disk must be large enough.

$ su
Password:
# sfdisk -d /dev/hda | sfdisk /dev/hdb
Checking that no-one is using this disk right now ...
OK

Disk /dev/hdb: 19457 cylinders, 255 heads, 63 sectors/track
Old situation:
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start     End   #cyls    #blocks   Id  System
/dev/hdb1          0       -       0          0    0  Empty
/dev/hdb2          0       -       0          0    0  Empty
/dev/hdb3          0       -       0          0    0  Empty
/dev/hdb4          0       -       0          0    0  Empty
New situation:
Units = sectors of 512 bytes, counting from 0

   Device Boot    Start       End   #sectors  Id  System
/dev/hdb1   *        63   4176899    4176837   6  FAT16
/dev/hdb2       4369680 116262404  111892725   f  W95 Ext'd (LBA)
/dev/hdb3       4176900   4369679     192780  16  Hidden FAT16
/dev/hdb4             0         -          0   0  Empty
/dev/hdb5       4369743   8594774    4225032   7  HPFS/NTFS
/dev/hdb6       8594838   9655064    1060227  82  Linux swap
/dev/hdb7       9655128  10281599     626472  83  Linux
/dev/hdb8      10281663  18683594    8401932  83  Linux
/dev/hdb9      18683658  28933064   10249407  83  Linux
/dev/hdb10     28933128  35085959    6152832  83  Linux
/dev/hdb11     35086023  36114119    1028097  83  Linux
/dev/hdb12     36114183  37961594    1847412   6  FAT16
/dev/hdb13     37961658  82734749   44773092  83  Linux
/dev/hdb14     82734813  86638544    3903732  83  Linux
/dev/hdb15     86638608  87618509     979902  82  Linux swap
/dev/hdb16     87618573  91843604    4225032   7  HPFS/NTFS
/dev/hdb17     91843668  99747584    7903917  83  Linux
/dev/hdb18     99747648 103972679    4225032   7  HPFS/NTFS
/dev/hdb19    103972743 110495069    6522327   b  W95 FAT32
/dev/hdb20    110495133 112744169    2249037  83  Linux
/dev/hdb21    112744233 116262404    3518172  83  Linux
Successfully wrote the new partition table

Re-reading the partition table ...

If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)
to zero the first 512 bytes:  dd if=/dev/zero of=/dev/foo7 bs=512 count=1
(See fdisk(8).)
#


Copy the partitions
-------------------

Use pcopy (faster than dd)

# pcopy -h
Usage: pcopy [options] <source> <destination>
Options:
-s      Silent mode
-q<num> Queue size
-u<num> Update frequency (in seconds)
-b<num> Buffer size (in KBytes)
-d      Show progress as a series of dots
#


# pcopy -d /dev/hda3 /dev/hdb3
Copying from /dev/hda3 to /dev/hdb3 (start in 3 seconds)...
...............................................................................................
/dev/hda3: Done. Copied 94 MB in 5 seconds (18 MB/s)
#


Hth

Chris



Reply to: