Gentoo Archives: gentoo-user

From: walt <w41ter@×××××.com>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Re: Duplicate identical Hard Disk
Date: Fri, 02 Apr 2010 02:44:34
Message-Id: hp3lka$vtd$1@dough.gmane.org
In Reply to: Re: [gentoo-user] Duplicate identical Hard Disk by Joseph
1 On 04/01/2010 06:40 PM, Joseph wrote:
2 > On 04/01/10 17:43, Mark Knecht wrote:
3 >> On Thu, Apr 1, 2010 at 4:02 PM, Paul Hartman
4 >> <paul.hartman+gentoo@×××××.com> wrote:
5 >>> On Thu, Apr 1, 2010 at 5:48 PM, Joseph <syscon780@×××××.com> wrote:
6 >>>> I have two identical HD in the box and want to duplicate sda to sdb;
7 >>>> sdb is not even partitioned.
8 >>>> I think I could do:
9 >>>> dd if=/dev/sda of=/dev/sdb
10 >>>> but I need to boot from CD isn't it?
11 >>>
12 >>> Yes, basically, boot from USB or CD and use ddrescue to clone it, then
13 >>> edit your fstab and I think you should be good.
14 >>>
15 >>> RAID1 would help if a drive physically dies, but if you had any
16 >>> filesystem corruption or anything you'd just have an identically
17 >>> corrupt copy on the second disk.
18 >>
19 >> A big part of my struggles over the last few days has been with mdadm
20 >> & RAID1. I'm learning that we don't want to send someone down that
21 >> path unless he has the right sort of disks. I'm having to deal with
22 >> returns and reordering due to this.
23 >>
24 >> People should be aware of what is really required to do RAID before
25 >> they get started so they don't duplicate my trials. I wasn't and I'm
26 >> paying for it. (Almost literally if I don't get the drives in the
27 >> mail!) ;-)
28 >>
29 >> Cheers,
30 >> Mark
31 >
32 > So what you are folks saying is to stay away from RAID-1, beside as Paul mention if I get any corruption and/or configuration (due to ebuild) with RAID I'll be screwed anyhow.
33 > So my best option is bootable CD and:
34 > dd if=/dev/sda of=/dev/sdb
35 >
36 > But I'm kind of confused as to how to edit the "sdb" second drive.
37 > I know I'll have to edit at lest: grub.conf and fstab
38 > But how?
39 >
40 > 1.) Both disk are bootable, (have a boot sector) if I disconnect first one sda, I think the second one will be recognize automatically as "sda" isn't it?
41 > 2.) If configure second drive after copying as "sdb" will it still boot if fist disk is disconnected?
42
43 In the old days you had to be careful about configuring each drive as either
44 'master' or 'slave'. That was the old PATA drives. Today, most drives are
45 SATA drives (a very good thing) so you don't have to worry about those silly
46 jumpers on the back of each drive. No such thing as 'master' or 'slave' any
47 more :o)
48
49 So, assuming your drives are SATA drives, all you need to do is to unplug
50 the cable from one drive and the other drive will automatically be sda when
51 you reboot. In that case you don't need to edit any files at all because the
52 drive that you plugged in is automatically sda, no matter which drive it is.
53
54 However, if you want to leave both cables connected and change your BIOS to
55 boot from 'sdb', you will need to edit some of the files on 'sdb', just as
56 you said, including all appropriate entries in fstab, and the 'root' device
57 in grub.conf (e.g. change hd0 to hd1), and use the 'rdev' utility to change
58 the 'root device' in your /boot/vmlinuz-2.6.NN file. (man rdev).

Replies

Subject Author
Re: [gentoo-user] Re: Duplicate identical Hard Disk Neil Bothwick <neil@××××××××××.uk>