Gentoo Archives: gentoo-user

From: Paul <gentoo@××××××××××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Replacing main harddisk
Date: Mon, 19 Sep 2005 13:48:13
Message-Id: 200509191439.11870.gentoo@appjaws.plus.com
In Reply to: RE: [gentoo-user] Replacing main harddisk by Michael Kintzios
1 Well I have carried out the procedure outlined in your message, but I have had
2 some problems.
3 When booting the new disc it always failed with a reiserfs problem (I once
4 rebuilt the tree), after 3 attempts I still had errors so I formated the
5 partition with ext2, copied all the files and rebooted. IT WORKED.
6
7 The only error I have detected is during boot I get a warning "unable to open
8 an initial console", the screen freezes until x is started.
9 This doesn't seem to be a big problem but I would like to fix it -- any
10 ideas????
11
12 thanks for all who helped
13 Paul
14
15 On Friday 16 Sep 2005 16:33, Michael Kintzios wrote:
16 > > -----Original Message-----
17 > > From: Paul [mailto:gentoo@××××××××××××.com]
18 > > Sent: 16 September 2005 15:23
19 > > To: gentoo-user@l.g.o
20 > > Subject: [gentoo-user] Replacing main harddisk
21 > >
22 > >
23 > > Hi all,
24 > >
25 > > My main harddisk is starting to go, making awful noise and
26 > > causing the
27 > > computer to freeze.
28 > > I have another spare disk and I wondered if somebody would
29 > > list out the
30 > > procedure I need to follow to create and format the
31 > > partitions and to copy
32 > > all of the faulty disk contents. Then how to boot from the new disk.
33 > > The new disk will need the following partitions:-
34 > > /boot ext2
35 > > /swap
36 > > / reiserfs
37 >
38 > 1. Using the dd command or a cloning software derivative:
39 > If the new disk is *exactly* the same size like the old one, then using
40 > the dd command you can basically clone your failing disk, including MBR
41 > and all partitions, including swap!, bit by bit:
42 > =========================
43 > dd if=/dev/hda of=/dev/hdb
44 > =========================
45 >
46 > On the other hand, if the new drive is larger then you will need to
47 > partition it, exactly like the old one. On the new drive, create the
48 > same entries you find with fdisk for your old drive: # fdisk -l
49 > /dev/hda
50 >
51 > Also, don't forget to clone the MBR:
52 > =========================
53 > dd if=/dev/hda of=/dev/hdb bs=446 count=1
54 > =========================
55 > If you also want to clone the partition table (as opposed to writing one
56 > afresh with fdisk) then increase the bs=446 to 512.
57 >
58 > 2. Using tar
59 > If at the same time you want to alter the partition sizes on the new
60 > drive then you can use the tar command, for each partition except for
61 > swap. Besides creating partitions of a preferred size on the new drive,
62 > you will also need to mkfs for each partition. Still have to use dd to
63 > clone the MBR.
64 > =========================
65 > # mkdir -p /mnt/new_boot
66 > # mount /dev/hdb1 /mnt/new_boot
67 > # cd /boot
68 > # tar lcpf - .|(cd /mnt/new_boot; tar xpvf -)
69 > =========================
70 > Repeat for / and also use tar -d (check $ man tar) to verify that the
71 > directories were copied over without any mishaps. Personally I prefer
72 > tar because it is faster, it defragments the drive's contents and can
73 > verify that the new directory was not corrupted in the tarring/untarring
74 > process.
75 >
76 > 3. There's a number of backup apps out there which can do more or less
77 > the same using a different front end; e.g. partimage.
78 >
79 > Good luck.
80 > --
81 > Regards,
82 > Mick
83
84 --
85 This message has been sent using kmail with gentoo linux
86 --
87 gentoo-user@g.o mailing list

Replies

Subject Author
RE: [gentoo-user] Replacing main harddisk Michael Kintzios <michaelkintzios@××××××××.uk>