From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 54D4413838B for ; Sat, 13 Sep 2014 16:46:47 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id DF7E5E089F; Sat, 13 Sep 2014 16:46:37 +0000 (UTC) Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com [209.85.212.182]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 906FCE0841 for ; Sat, 13 Sep 2014 16:46:36 +0000 (UTC) Received: by mail-wi0-f182.google.com with SMTP id e4so2141256wiv.3 for ; Sat, 13 Sep 2014 09:46:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=2PDM04xcXuRhbmDMVUUl+hCU5ISDnGNWzjhiguBdVW8=; b=GV2mDANz7ls6W8l31+BnP5356pH7HN9uGPj/ZlIOBf7nmP3XbqI7aBYNcjZogHUfTp WGu/jKtg9UvLYyfhEHVFyzWWb2ccxliO0ThVW56yRhJAtZxmkKyYR7ucz+VYxCSbP66j b00WkfEq9oQxGwxBua1win/EbHAggneI8/OesQmV/ssJZ/yqgMFR0jHzPK5EQwhv0NI+ MZ1hJYVu5hQHlEG72giqMgzFdDemsX83b3qvzGb0A14+JVBukVf3af4A81RS3IcmHkcc iPa+7g2Ly5CfHFjRH5bgm/qNxp1aqe5N1PBRrJrWH0izuCIR9xDQ//RfMVBKj8s3MYoP NRVA== X-Received: by 10.194.61.99 with SMTP id o3mr20655668wjr.103.1410626795229; Sat, 13 Sep 2014 09:46:35 -0700 (PDT) Received: from [172.20.0.41] (105-237-53-178.access.mtnbusiness.co.za. [105.237.53.178]) by mx.google.com with ESMTPSA id mx19sm5405536wic.3.2014.09.13.09.46.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 13 Sep 2014 09:46:34 -0700 (PDT) Message-ID: <541474A3.3050009@gmail.com> Date: Sat, 13 Sep 2014 18:45:23 +0200 From: Alan McKinnon User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] duplicate HD drives References: <20140912215319.GA13628@syscon7> <20140912235257.1b7d0e18@digimed.co.uk> <20140913031741.GB13628@syscon7> <5413ED3C.2040706@fastmail.co.uk> <20140913163157.GD13628@syscon7> In-Reply-To: <20140913163157.GD13628@syscon7> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Archives-Salt: c2c6b07b-2a44-4e96-a58c-73a894f431ae X-Archives-Hash: 8108e1401d18faff2e6ab8ab13be859e On 13/09/2014 18:31, Joseph wrote: > On 09/13/14 08:07, Kerin Millar wrote: >> On 13/09/2014 04:17, Joseph wrote: >>> On 09/12/14 23:52, Neil Bothwick wrote: >>>> On Fri, 12 Sep 2014 15:53:19 -0600, Joseph wrote: >>>> >>>>> I have two identical HD in a box and want to duplicate sda to sdb >>>>> I want sdb to be bootable just in case something happens to sda so I >>>>> can swap the drives and boot. >>>>> >>>>> Do I boot from USB and run: >>>>> dd if=/dev/sda of=/dev/sdb bs=512 count=1 >>>> >>>> If you remove the cunt argument as already mentioned, this will copy >>>> the >>>> whole drive, but it will be incredibly slow unless you add bs=4k. It >>>> also >>>> only copies it once, as soon as you start using sda, sdb will be out of >>>> date. Set up a RAID-1 array with the two drives, then install GRUB >>>> to the >>>> boot sector of each drive, using grub2-install and you will always be >>>> able to boot in the event of a failure of either drive. >>>> >>>> >>>> -- >>>> Neil Bothwick >>> >>> I'll be interested in setting up RAID-1. Is it hard? >>> I've never done it and I know there is plenty of information on line >>> about RAID-1 >>> >>> I'm not going to grub2 anytime soon. This machine has BIOS and the HD >>> has MBR partition. >>> With recent problem I had with my other older box (that has BIOS) and >>> grub2 I'm not going to play with it. >>> >>> Is it hard to set it UP RAID-1 >> >> No, it is not. However, to keep things simple, observe the following: >> >> * create the array with the --metadata=0 option (using mdadm) >> * mark the partitions belonging to the array as type FD >> * enable CONFIG_MD_AUTODETECT in the kernel >> >> Doing so will ensure two things. Firstly, that the legacy version of >> grub is able to read the kernel. Unlike grub2, it does not intrinsically >> understand RAID. Using the original metadata format prevents that from >> being an issue; grub can be pointed to just one of the two partitions >> belonging to a RAID-1 array and read its filesystem. >> >> Secondly, using the original metadata format means that, once the kernel >> has loaded, it is able to assemble the array by itself. Therefore, you >> may have your root filesystem on the array and mount it without having >> to use an initramfs. >> >> In terms of partitioning, you could just create one big partition on >> each drive, join them into an array, and make that the basis of a root >> filesystem. As much as Gentoo has enshrined the concept, a dedicated >> boot filesystem is simply not necessary and swap can be created as a >> file. Alternatively, you could follow the handbook style and create >> three arrays for boot, swap and root. >> >> There is a trick to achieving bootloader redundancy. Let's say that you >> have set up array /dev/md0, with /dev/sda1 and /dev/sdb1 as its members, >> and that /dev/md0 contains a singular root filesystem. In the grub >> shell, one would run these commands: >> >> grub> device (hd0) /dev/sda >> grub> root (hd0,0) >> grub> setup (hd0) >> grub> device (hd0) /dev/sdb >> grub> root (hd0,0) >> grub> setup (hd0) >> >> The magic here is that the bootloader will still be able to function, >> even if a disk is removed or broken. >> >> Finally, even though your disks are not exactly the same size, it does >> not matter. If there is a discrepancy among the devices that mdadm is >> given to create an array with, it will size the array according to the >> lowest common denominator. If you prefer, you can manually ensure that >> the partitions are the exact same size on both disks. >> >> --Kerin > > If I do: > fdisk /dev/sda > t 1 fd > > Won't it destroy data on /dev/sda? No. -- Alan McKinnon alan.mckinnon@gmail.com