public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] duplicate HD drives
@ 2014-09-12 21:53 Joseph
  2014-09-12 22:05 ` Alexander Puchmayr
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Joseph @ 2014-09-12 21:53 UTC (permalink / raw
  To: gentoo-user

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

fdisk -l /dev/sda

Disk /dev/sda: 596.2 GiB, 640135028736 bytes, 1250263728 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x000f2548

Device    Boot     Start        End    Blocks  Id System
/dev/sda1 *           63      80324     40131  83 Linux
/dev/sda2          80325   16868249   8393962+ 82 Linux swap / Solaris
/dev/sda3       16868250  121740569  52436160  83 Linux
/dev/sda4      121740570 1250258624 564259027+ 83 Linux

fdisk -l /dev/sdb

Disk /dev/sdb: 596.2 GiB, 640133946880 bytes, 1250261615 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


-- 
Joseph


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [gentoo-user] duplicate HD drives
  2014-09-12 21:53 [gentoo-user] duplicate HD drives Joseph
@ 2014-09-12 22:05 ` Alexander Puchmayr
  2014-09-12 22:18 ` Ivan Viso Altamirano
  2014-09-12 22:52 ` Neil Bothwick
  2 siblings, 0 replies; 16+ messages in thread
From: Alexander Puchmayr @ 2014-09-12 22:05 UTC (permalink / raw
  To: gentoo-user

On Freitag, 12. September 2014, 15:53:19 Joseph wrote:
> I have two identical HD in a box and want to duplicate sda to sdb

OK, do you want to copy just the boot sector or clone the whole disk with all 
data on it?

> 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 want to copy *all* data, why stop after one block? Omit the "count=1" 
and clone the whole disk. BTW: It might go a little faster of you increase the 
block size, lets say bs=4096.

> fdisk -l /dev/sda
> 
> Disk /dev/sda: 596.2 GiB, 640135028736 bytes, 1250263728 sectors
> Units: sectors of 1 * 512 = 512 bytes
> Sector size (logical/physical): 512 bytes / 512 bytes
> I/O size (minimum/optimal): 512 bytes / 512 bytes
> Disklabel type: dos
> Disk identifier: 0x000f2548
> 
> Device    Boot     Start        End    Blocks  Id System
> /dev/sda1 *           63      80324     40131  83 Linux
> /dev/sda2          80325   16868249   8393962+ 82 Linux swap / Solaris
> /dev/sda3       16868250  121740569  52436160  83 Linux
> /dev/sda4      121740570 1250258624 564259027+ 83 Linux
> 
> fdisk -l /dev/sdb
> 
> Disk /dev/sdb: 596.2 GiB, 640133946880 bytes, 1250261615 sectors
> Units: sectors of 1 * 512 = 512 bytes
> Sector size (logical/physical): 512 bytes / 512 bytes
> I/O size (minimum/optimal): 512 bytes / 512 bytes



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [gentoo-user] duplicate HD drives
  2014-09-12 21:53 [gentoo-user] duplicate HD drives Joseph
  2014-09-12 22:05 ` Alexander Puchmayr
@ 2014-09-12 22:18 ` Ivan Viso Altamirano
  2014-09-12 22:19   ` Ivan Viso Altamirano
  2014-09-12 22:52 ` Neil Bothwick
  2 siblings, 1 reply; 16+ messages in thread
From: Ivan Viso Altamirano @ 2014-09-12 22:18 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1333 bytes --]

You are only cloning the first 512 bytes , remove the count parameter . It
is usefull if you need to copy/restore the mbr .
El 12/09/2014 23:53, "Joseph" <syscon780@gmail.com> escribió:

> 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
>
> fdisk -l /dev/sda
>
> Disk /dev/sda: 596.2 GiB, 640135028736 bytes, 1250263728 sectors
> Units: sectors of 1 * 512 = 512 bytes
> Sector size (logical/physical): 512 bytes / 512 bytes
> I/O size (minimum/optimal): 512 bytes / 512 bytes
> Disklabel type: dos
> Disk identifier: 0x000f2548
>
> Device    Boot     Start        End    Blocks  Id System
> /dev/sda1 *           63      80324     40131  83 Linux
> /dev/sda2          80325   16868249   8393962+ 82 Linux swap / Solaris
> /dev/sda3       16868250  121740569  52436160  83 Linux
> /dev/sda4      121740570 1250258624 564259027+ 83 Linux
>
> fdisk -l /dev/sdb
>
> Disk /dev/sdb: 596.2 GiB, 640133946880 bytes, 1250261615 sectors
> Units: sectors of 1 * 512 = 512 bytes
> Sector size (logical/physical): 512 bytes / 512 bytes
> I/O size (minimum/optimal): 512 bytes / 512 bytes
>
>
> --
> Joseph
>
>

[-- Attachment #2: Type: text/html, Size: 1686 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [gentoo-user] duplicate HD drives
  2014-09-12 22:18 ` Ivan Viso Altamirano
@ 2014-09-12 22:19   ` Ivan Viso Altamirano
  0 siblings, 0 replies; 16+ messages in thread
From: Ivan Viso Altamirano @ 2014-09-12 22:19 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1457 bytes --]

El 13/09/2014 00:18, "Ivan Viso Altamirano" <ivanviso123@gmail.com>
escribió:

> You are only cloning the first 512 bytes , remove the count parameter . It
> is usefull if you need to copy/restore the mbr .
> El 12/09/2014 23:53, "Joseph" <syscon780@gmail.com> escribió:
>
>> 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
>>
>> fdisk -l /dev/sda
>>
>> Disk /dev/sda: 596.2 GiB, 640135028736 bytes, 1250263728 sectors
>> Units: sectors of 1 * 512 = 512 bytes
>> Sector size (logical/physical): 512 bytes / 512 bytes
>> I/O size (minimum/optimal): 512 bytes / 512 bytes
>> Disklabel type: dos
>> Disk identifier: 0x000f2548
>>
>> Device    Boot     Start        End    Blocks  Id System
>> /dev/sda1 *           63      80324     40131  83 Linux
>> /dev/sda2          80325   16868249   8393962+ 82 Linux swap / Solaris
>> /dev/sda3       16868250  121740569  52436160  83 Linux
>> /dev/sda4      121740570 1250258624 564259027+ 83 Linux
>>
>> fdisk -l /dev/sdb
>>
>> Disk /dev/sdb: 596.2 GiB, 640133946880 bytes, 1250261615 sectors
>> Units: sectors of 1 * 512 = 512 bytes
>> Sector size (logical/physical): 512 bytes / 512 bytes
>> I/O size (minimum/optimal): 512 bytes / 512 bytes
>>
>>
>> --
>> Joseph
>>
>>

[-- Attachment #2: Type: text/html, Size: 2010 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [gentoo-user] duplicate HD drives
  2014-09-12 21:53 [gentoo-user] duplicate HD drives Joseph
  2014-09-12 22:05 ` Alexander Puchmayr
  2014-09-12 22:18 ` Ivan Viso Altamirano
@ 2014-09-12 22:52 ` Neil Bothwick
  2014-09-13  3:17   ` Joseph
  2014-09-13 17:38   ` [gentoo-user] " Neil Bothwick
  2 siblings, 2 replies; 16+ messages in thread
From: Neil Bothwick @ 2014-09-12 22:52 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 817 bytes --]

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

Always proofread carefully to see if you any words out.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [gentoo-user] duplicate HD drives
  2014-09-12 22:52 ` Neil Bothwick
@ 2014-09-13  3:17   ` Joseph
  2014-09-13  6:53     ` J. Roeleveld
                       ` (2 more replies)
  2014-09-13 17:38   ` [gentoo-user] " Neil Bothwick
  1 sibling, 3 replies; 16+ messages in thread
From: Joseph @ 2014-09-13  3:17 UTC (permalink / raw
  To: gentoo-user

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

-- 
Joseph


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [gentoo-user] duplicate HD drives
  2014-09-13  3:17   ` Joseph
@ 2014-09-13  6:53     ` J. Roeleveld
  2014-09-13  7:07     ` Kerin Millar
  2014-09-13 17:41     ` [gentoo-user] " James
  2 siblings, 0 replies; 16+ messages in thread
From: J. Roeleveld @ 2014-09-13  6:53 UTC (permalink / raw
  To: gentoo-user


On Friday, September 12, 2014 09:17:41 PM 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.
> 
> 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

Grub2 can work with older style BIOS and MBR partitioning.
I believe the issues you were facing was caused by the partitioning you were 
trying.

But even with legacy grub, the steps are, mostly, the same.

Check the Gentoo documentation for RAID+LVM installs and if you only want to 
use RAID, ignore the LVM steps.

--
Joost


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [gentoo-user] duplicate HD drives
  2014-09-13  3:17   ` Joseph
  2014-09-13  6:53     ` J. Roeleveld
@ 2014-09-13  7:07     ` Kerin Millar
  2014-09-13 16:31       ` Joseph
  2014-09-13 17:41     ` [gentoo-user] " James
  2 siblings, 1 reply; 16+ messages in thread
From: Kerin Millar @ 2014-09-13  7:07 UTC (permalink / raw
  To: gentoo-user

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


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [gentoo-user] duplicate HD drives
  2014-09-13  7:07     ` Kerin Millar
@ 2014-09-13 16:31       ` Joseph
  2014-09-13 16:45         ` Alan McKinnon
  0 siblings, 1 reply; 16+ messages in thread
From: Joseph @ 2014-09-13 16:31 UTC (permalink / raw
  To: gentoo-user

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?

-- 
Joseph


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [gentoo-user] duplicate HD drives
  2014-09-13 16:31       ` Joseph
@ 2014-09-13 16:45         ` Alan McKinnon
  2014-09-13 18:01           ` Kerin Millar
  0 siblings, 1 reply; 16+ messages in thread
From: Alan McKinnon @ 2014-09-13 16:45 UTC (permalink / raw
  To: gentoo-user

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



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [gentoo-user] duplicate HD drives
  2014-09-12 22:52 ` Neil Bothwick
  2014-09-13  3:17   ` Joseph
@ 2014-09-13 17:38   ` Neil Bothwick
  2014-09-13 18:56     ` Alan McKinnon
  1 sibling, 1 reply; 16+ messages in thread
From: Neil Bothwick @ 2014-09-13 17:38 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 765 bytes --]

On Fri, 12 Sep 2014 23:52:57 +0100, Neil Bothwick wrote:

> 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
> 
> Always proofread carefully to see if you any words out.

Thank you everybody for not highlighting the irony of that tagline...


-- 
Neil Bothwick

"Time is the best teacher....., unfortunately it kills all the students"

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [gentoo-user] Re: duplicate HD drives
  2014-09-13  3:17   ` Joseph
  2014-09-13  6:53     ` J. Roeleveld
  2014-09-13  7:07     ` Kerin Millar
@ 2014-09-13 17:41     ` James
  2 siblings, 0 replies; 16+ messages in thread
From: James @ 2014-09-13 17:41 UTC (permalink / raw
  To: gentoo-user

Joseph <syscon780 <at> gmail.com> writes:

>
> 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

> Is it hard to set it UP RAID-1

Joseph,

Here is an excellent link for you to read. I'm *NOT* saying use
BTRFS, as it may or maynot be the right choice for you at this
time. What I am saying is many folks are very happy with BTRFS
and eventually, many folks believe that btrfs will be a worderful
FS choice. Choices that encompasse mirroring and many other
features of an advanced file system are goals for btrfs as well
of other FS offerings. Naturally expect folks to become quite
animated as you openly discuss file system choices. File systems
chioces with raid are very important as to the exact goals that
are BEST for YOU.


https://btrfs.wiki.kernel.org/index.php/
UseCases#How_do_I_create_a_RAID1_mirror_in_Btrfs.3F


The choice of a  file-system here at Gentoo, is always a defensible
event, so it is not to be made lightly.


hth,
James






^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [gentoo-user] duplicate HD drives
  2014-09-13 16:45         ` Alan McKinnon
@ 2014-09-13 18:01           ` Kerin Millar
  0 siblings, 0 replies; 16+ messages in thread
From: Kerin Millar @ 2014-09-13 18:01 UTC (permalink / raw
  To: gentoo-user

On 13/09/2014 17:45, Alan McKinnon wrote:

<snip>

>> If I do:
>> fdisk /dev/sda
>> t 1 fd
>>
>> Won't it destroy data on /dev/sda?
>
>
> No.

Although mdadm will. A simple solution is to create the array with only 
the second disk as the initial member and designate the other device as 
literally "missing". The array will function in degraded mode. Then it 
is simply a matter of copying over the data from the original filesystem 
on the first disk, after which it may be (destructively) added to the array.

--Kerin


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [gentoo-user] duplicate HD drives
  2014-09-13 17:38   ` [gentoo-user] " Neil Bothwick
@ 2014-09-13 18:56     ` Alan McKinnon
  2014-09-13 19:01       ` Neil Bothwick
  2014-09-13 19:12       ` Neil Bothwick
  0 siblings, 2 replies; 16+ messages in thread
From: Alan McKinnon @ 2014-09-13 18:56 UTC (permalink / raw
  To: gentoo-user

On 13/09/2014 19:38, Neil Bothwick wrote:
> On Fri, 12 Sep 2014 23:52:57 +0100, Neil Bothwick wrote:
> 
>> 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
>>
>> Always proofread carefully to see if you any words out.
> 
> Thank you everybody for not highlighting the irony of that tagline...
> 
> 


I saw your typo, I missed the tagline :-)

It's *freaky* how your fortunes so often match the post :-)
How the blazes do you do that?




-- 
Alan McKinnon
alan.mckinnon@gmail.com



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [gentoo-user] duplicate HD drives
  2014-09-13 18:56     ` Alan McKinnon
@ 2014-09-13 19:01       ` Neil Bothwick
  2014-09-13 19:12       ` Neil Bothwick
  1 sibling, 0 replies; 16+ messages in thread
From: Neil Bothwick @ 2014-09-13 19:01 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1158 bytes --]

On 13 September 2014 19:56:06 BST, Alan McKinnon <alan.mckinnon@gmail.com> wrote:
> On 13/09/2014 19:38, Neil Bothwick wrote:
> > On Fri, 12 Sep 2014 23:52:57 +0100, Neil Bothwick wrote:
> > 
> >> 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
> >>
> >> Always proofread carefully to see if you any words out.
> > 
> > Thank you everybody for not highlighting the irony of that
> tagline...
> > 
> > 
> 
> 
> I saw your typo, I missed the tagline :-)
> 
> It's *freaky* how your fortunes so often match the post :-)
> How the blazes do you do that?
> 
> 
> 
> 
> -- 
> Alan McKinnon
> alan.mckinnon@gmail.com

USE=magic emerge signify

;-) 

-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.

[-- Attachment #2: Type: text/html, Size: 1690 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [gentoo-user] duplicate HD drives
  2014-09-13 18:56     ` Alan McKinnon
  2014-09-13 19:01       ` Neil Bothwick
@ 2014-09-13 19:12       ` Neil Bothwick
  1 sibling, 0 replies; 16+ messages in thread
From: Neil Bothwick @ 2014-09-13 19:12 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1230 bytes --]

On 13 September 2014 19:56:06 BST, Alan McKinnon <alan.mckinnon@gmail.com> wrote:
> On 13/09/2014 19:38, Neil Bothwick wrote:
> > On Fri, 12 Sep 2014 23:52:57 +0100, Neil Bothwick wrote:
> > 
> >> 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
> >>
> >> Always proofread carefully to see if you any words out.
> > 
> > Thank you everybody for not highlighting the irony of that
> tagline...
> > 
> > 
> 
> 
> I saw your typo, I missed the tagline :-)
> 
> It's *freaky* how your fortunes so often match the post :-)
> How the blazes do you do that?
> 
> 
> 
> 
> -- 
> Alan McKinnon
> alan.mckinnon@gmail.com

USE=magic emerge signify

;-) 

-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.
-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.

[-- Attachment #2: Type: text/html, Size: 1632 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2014-09-13 19:14 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-12 21:53 [gentoo-user] duplicate HD drives Joseph
2014-09-12 22:05 ` Alexander Puchmayr
2014-09-12 22:18 ` Ivan Viso Altamirano
2014-09-12 22:19   ` Ivan Viso Altamirano
2014-09-12 22:52 ` Neil Bothwick
2014-09-13  3:17   ` Joseph
2014-09-13  6:53     ` J. Roeleveld
2014-09-13  7:07     ` Kerin Millar
2014-09-13 16:31       ` Joseph
2014-09-13 16:45         ` Alan McKinnon
2014-09-13 18:01           ` Kerin Millar
2014-09-13 17:41     ` [gentoo-user] " James
2014-09-13 17:38   ` [gentoo-user] " Neil Bothwick
2014-09-13 18:56     ` Alan McKinnon
2014-09-13 19:01       ` Neil Bothwick
2014-09-13 19:12       ` Neil Bothwick

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox