Hello Holker,

Holger Parplies wrote:

>> 3. Mirror partition tables from one of the existing disks:
>>
>>      # sudo sfdisk -d /dev/sda | sfdisk /dev/sdc
> 
> apart from something having been mangled ("???"), I tend to wonder why you
> need root permission to read the partition table of /dev/sda but not to write
> it to /dev/sdc ;-). You might, of course, have relaxed the permissions on
> /dev/sdc, but I'd spare an extra 'sudo' for the howto ;-).

I took the information above from the page:

Setting up software RAID in Ubuntu Server
http://advosys.ca/viewpoints/2007/04/setting-up-software-raid-in-ubuntu-server/

" Once system as been rebooted with the new unformatted replacement 
drive in place, some manual intervention is required to partition the 
drive and add it to the RAID array.
The new drive must have an identical (or nearly identical) partition 
table to the other. You can use fdisk to manually create a partition 
table on the new drive identical to the table of the other, or if both 
drives are identical you can use the “sfdisk” command to duplicate the 
partition. For example, to copy the partition table from the second 
drive “sdb” onto the first drive “sda”, the sfdisk command is as follows:

sfdisk –d /dev/sdb | sfdisk /dev/sda"

I don't know if it's possible to add a 3rd drive to the RAID, that 
hasn't got the right partitions on it :-?

> I believe the original idea is *not* to temporarily cripple your RAID but
> rather to add a third disk (three way mirror).

you're right I changed my setup and have now a three way raid, so that I 
can unplugg one drive and keep it as offline backup.

 > I'm not sure if you can do that after initial creation of the array,
 > but the man page suggests it should be possible "on kernels which
 > provide necessary support".

On Ubuntu Server I was able to add a third harddisk to the array and get 
it synced. After sync had been completed I can remove the 3rd drive from 
the array and lock it away for offline storage.

   Change a 2-disk RAID1 to a 3-disk RAID:
   # sudo mdadm --grow --raid-devices=3 /dev/md0

   Add a 3rd drive to the existing 2disk RAID1:
   # sudo mdadm --add /dev/md0 /dev/sdc1
   -> spare will be rebuilded

   Remove 3rd disk from RAID
   # sudo mdadm --fail /dev/md0 /dev/sdb1
   # sudo mdadm --remove /dev/md0 /dev/sdb1

While this approach is much better than the one I suggested yesterday it 
still leads to some Questions:

1) Is there a way to add the 3rd drive to RAID1 as soon as it will be 
connected to the system (External harddrive that is oonnected via usb2)?
Or more generally: Can I run a script when an external storage device is 
connected via usb?

2) Do I need to resize my RAID after removing the 3rd harddrive with
    # sudo mdadm --grow --raid-devices=2 /dev/md0
    Are there any problems when the RAID will be used in clean, but 
degraded state?

- Kurt


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:    http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/

Reply via email to