Re: [gentoo-user] Re: Duplicate identical Hard Disk

2010-04-02 Thread Neil Bothwick
On Thu, 01 Apr 2010 19:47:09 -0700, walt wrote:

 However, if you want to leave both cables connected and change your
 BIOS to boot from 'sdb', you will need to edit some of the files on
 'sdb',

Check your BIOS first, some allow you to disable individual SATA ports,
so you can disconnect the drive without pulling cables.


-- 
Neil Bothwick

To most people solutions mean finding the answers. But to chemists
solutions are things that are still all mixed up.


signature.asc
Description: PGP signature


Re: [gentoo-user] Re: Duplicate identical Hard Disk

2010-04-02 Thread Joseph

On 04/02/10 09:42, Neil Bothwick wrote:

On Thu, 01 Apr 2010 19:47:09 -0700, walt wrote:


However, if you want to leave both cables connected and change your
BIOS to boot from 'sdb', you will need to edit some of the files on
'sdb',


Check your BIOS first, some allow you to disable individual SATA ports,
so you can disconnect the drive without pulling cables.


--
Neil Bothwick


Good suggestion, but I'm not sure my motherboard BIOS supports it.
I have GA-MA790GP-DS4H motherboard, reading from the manual:

it has OnChip SATA Type (SATA2_0 ~ SATA2_3 connectors)
Mode: Native IDE
RAID
AHCI - Advanced Host Controller to enable advanced Serial ATA features such as 
Native Command Queuing and hot plug.

Is it the one AHCI? I've never used it. 
I'm more interested in configuring it as an auxiliary drive sdb to serve as a bootable backup. The box will be installed in a remote location and I'll have 
an ssh access to it.


The box is running in a medical clinic and I'm mostly concern that after the emerge if something happens, I want the user to be able to boot grub from 
second drive, and it will be sdb (hd1); but during normal operation, when running from sda I want to backup some application files to it so sdb stays 
current.


--
Joseph



[gentoo-user] Re: Duplicate identical Hard Disk

2010-04-02 Thread walt

On 04/02/2010 07:59 AM, Mark Knecht wrote:



1) Yes, you can RAID partitions of drives. That's what I'm doing. You
can look at the Gentoo RAID/LVM Install guide to see an example of
using RAID0 and RAID1 on a single drive.

http://www.gentoo.org/doc/en/gentoo-x86+raid+lvm2-quickinstall.xml


Very useful post, thanks.  I'm just nitpicking here about the use of
RAID0 on a single physical drive, which doesn't seem useful IIUC.

RAID0 alternates stripes between two physical drives so that one disk
can be reading/writing while the other disk's heads are seeking, no?

If that is the case, then single-disk RAID0 will just be thrashing the
heads back and forth between stripes on different partitions, making
more work for itself than necessary.

If I'm wrong about this, someone please correct me.




[gentoo-user] Re: Duplicate identical Hard Disk

2010-04-02 Thread walt

On 04/02/2010 08:46 AM, Joseph wrote:

On 04/02/10 09:42, Neil Bothwick wrote:

On Thu, 01 Apr 2010 19:47:09 -0700, walt wrote:


However, if you want to leave both cables connected and change your
BIOS to boot from 'sdb', you will need to edit some of the files on
'sdb',


Check your BIOS first, some allow you to disable individual SATA ports,
so you can disconnect the drive without pulling cables.


--
Neil Bothwick


Good suggestion, but I'm not sure my motherboard BIOS supports it.
I have GA-MA790GP-DS4H motherboard, reading from the manual:

it has OnChip SATA Type (SATA2_0 ~ SATA2_3 connectors)
Mode: Native IDE
RAID
AHCI - Advanced Host Controller to enable advanced Serial ATA features such as 
Native Command Queuing and hot plug.

Is it the one AHCI? I've never used it. I'm more interested in configuring it as an 
auxiliary drive sdb to serve as a bootable backup. The box will be installed 
in a remote location and I'll have an ssh access to it.

The box is running in a medical clinic and I'm mostly concern that after the emerge if something happens, I 
want the user to be able to boot grub from second drive, and it will be sdb (hd1); 
but during normal operation, when running from sda I want
to backup some application files to it so sdb stays current.


Ah, well, having only remote access rules out unplugging cables or changing
BIOS settings unless there is someone at the site who can do those things.

Seems like you would be better off to set up grub on sda so it can boot from
sda by default, but also so a remote user can just choose sdb from grub's menu.
That assumes that sda is physically intact enough to load grub from sda.  You
seem to be more worried about software screwups than hardware failure.  But
you will need to edit the handful of config files on sdb so all the right
filesystems will mount correctly.







Re: [gentoo-user] Re: Duplicate identical Hard Disk

2010-04-02 Thread Mark Knecht
On Fri, Apr 2, 2010 at 9:37 AM, walt w41...@gmail.com wrote:
 On 04/02/2010 07:59 AM, Mark Knecht wrote:


 1) Yes, you can RAID partitions of drives. That's what I'm doing. You
 can look at the Gentoo RAID/LVM Install guide to see an example of
 using RAID0 and RAID1 on a single drive.

 http://www.gentoo.org/doc/en/gentoo-x86+raid+lvm2-quickinstall.xml

 Very useful post, thanks.  I'm just nitpicking here about the use of
 RAID0 on a single physical drive, which doesn't seem useful IIUC.

 RAID0 alternates stripes between two physical drives so that one disk
 can be reading/writing while the other disk's heads are seeking, no?

 If that is the case, then single-disk RAID0 will just be thrashing the
 heads back and forth between stripes on different partitions, making
 more work for itself than necessary.

 If I'm wrong about this, someone please correct me.

No, you are correct, RAID0 on a single drive makes no sense. If I
suggested that then I apologize for the confusion. I was only saying
that you can do RAID on one partition but do non-RAID on another. For
instance, /boot is non-RAID and then other partitions are RAID. I may
be wrong but I think that's only possible with software RAID. Not sure
you could do this behind a hardware RAID controller.

sda1 = /boot - non-RAID
sda2, sdb2, sdc2 = swap, but not RAID. The kernel binds them.
sda3, sdb3, sdc3 = RAID /home

or something like that.

In case even that's not clear, I don't think mdadm supports a RAID
array of any type with all the partitions on a single drive. For
instance:

mdadm --create /dev/md1 --level=1 --raid-devices=3 /dev/sda1 /dev/sda2 /dev/sda3

doesn't make any sense to me even if it is supported.

Hope that helps clear things up. ;-)

- Mark



Re: [gentoo-user] Re: Duplicate identical Hard Disk

2010-04-02 Thread Joseph

On 04/02/10 09:47, walt wrote:

On 04/02/2010 08:46 AM, Joseph wrote:

On 04/02/10 09:42, Neil Bothwick wrote:

On Thu, 01 Apr 2010 19:47:09 -0700, walt wrote:


However, if you want to leave both cables connected and change your
BIOS to boot from 'sdb', you will need to edit some of the files on
'sdb',


Check your BIOS first, some allow you to disable individual SATA ports,
so you can disconnect the drive without pulling cables.


--
Neil Bothwick


Good suggestion, but I'm not sure my motherboard BIOS supports it.
I have GA-MA790GP-DS4H motherboard, reading from the manual:

it has OnChip SATA Type (SATA2_0 ~ SATA2_3 connectors)
Mode: Native IDE
RAID
AHCI - Advanced Host Controller to enable advanced Serial ATA features such as 
Native Command Queuing and hot plug.

Is it the one AHCI? I've never used it. I'm more interested in configuring it as an 
auxiliary drive sdb to serve as a bootable backup. The box will be installed 
in a remote location and I'll have an ssh access to it.

The box is running in a medical clinic and I'm mostly concern that after the emerge if something happens, I 
want the user to be able to boot grub from second drive, and it will be sdb (hd1); 
but during normal operation, when running from sda I want
to backup some application files to it so sdb stays current.


Ah, well, having only remote access rules out unplugging cables or changing
BIOS settings unless there is someone at the site who can do those things.

Seems like you would be better off to set up grub on sda so it can boot from
sda by default, but also so a remote user can just choose sdb from grub's menu.
That assumes that sda is physically intact enough to load grub from sda.  You
seem to be more worried about software screwups than hardware failure.  But
you will need to edit the handful of config files on sdb so all the right
filesystems will mount correctly.


As I've mentioned earlier I have enough backups on another system, so I'm not 
much worry about hardware failure.
From my years of experience with Gentoo, I'm more worry about things working 
correctly after emerge :-/
I've made list what I need to do, but I'm not sure if this is all:

1.) Boot from external CD
dd if=/dev/sda of=/dev/sdb

2.)
modify (add to) grub.conf on sda
#title boot sda current
title=1st HD sda Kernel Current
root (hd0,0)
kernel /boot/kernel-current root=/dev/sda3

#title boot sdb current
title=2nd HD sdb Kernel Current
root (hd1,0)
kernel /boot/kernel-current root=/dev/sdb3

3.) Modify fstab

You have mentioned to use rdev but reading man pages it is only i386, and all 
my boxes running amd64 (x86_64).

--
Joseph



[gentoo-user] Re: Duplicate identical Hard Disk

2010-04-01 Thread walt

On 04/01/2010 06:40 PM, Joseph wrote:

On 04/01/10 17:43, Mark Knecht wrote:

On Thu, Apr 1, 2010 at 4:02 PM, Paul Hartman
paul.hartman+gen...@gmail.com wrote:

On Thu, Apr 1, 2010 at 5:48 PM, Joseph syscon...@gmail.com wrote:

I have two identical HD in the box and want to duplicate sda to sdb;
sdb is not even partitioned.
I think I could do:
dd if=/dev/sda of=/dev/sdb
but I need to boot from CD isn't it?


Yes, basically, boot from USB or CD and use ddrescue to clone it, then
edit your fstab and I think you should be good.

RAID1 would help if a drive physically dies, but if you had any
filesystem corruption or anything you'd just have an identically
corrupt copy on the second disk.


A big part of my struggles over the last few days has been with mdadm
 RAID1. I'm learning that we don't want to send someone down that
path unless he has the right sort of disks. I'm having to deal with
returns and reordering due to this.

People should be aware of what is really required to do RAID before
they get started so they don't duplicate my trials. I wasn't and I'm
paying for it. (Almost literally if I don't get the drives in the
mail!) ;-)

Cheers,
Mark


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.
So my best option is bootable CD and:
dd if=/dev/sda of=/dev/sdb

But I'm kind of confused as to how to edit the sdb second drive.
I know I'll have to edit at lest: grub.conf and fstab
But how?

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?
2.) If configure second drive after copying as sdb will it still boot if fist 
disk is disconnected?


In the old days you had to be careful about configuring each drive as either
'master' or 'slave'.  That was the old PATA drives.  Today, most drives are
SATA drives (a very good thing) so you don't have to worry about those silly
jumpers on the back of each drive.  No such thing as 'master' or 'slave' any
more :o)

So, assuming your drives are SATA drives, all you need to do is to unplug
the cable from one drive and the other drive will automatically be sda when
you reboot.  In that case you don't need to edit any files at all because the
drive that you plugged in is automatically sda, no matter which drive it is.

However, if you want to leave both cables connected and change your BIOS to
boot from 'sdb', you will need to edit some of the files on 'sdb', just as
you said, including all appropriate entries in fstab, and the 'root' device
in grub.conf (e.g. change hd0 to hd1), and use the 'rdev' utility to change
the 'root device' in your /boot/vmlinuz-2.6.NN file.  (man rdev).