RAID setup automation problem


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting RAID setup automation problem
# 1  
Old 09-05-2008
RAID setup automation problem

Hi guys,

I'm trying to write a small script that sets up RAID using MDADM without asking user for any input.
Here's what I'm doing:
Code:
start=`mdadm --create $2 --level=$3 --raid-devices=$4 $5 $6 <<  MAYDAY
y
MAYDAY`

When I it, I get this
Code:
./redundancy -setup /dev/md0 1 2 /dev/files/test0 /dev/files/test1

MDADM Module successfully loaded. Starting the RAID Array.
mdadm: /dev/files/test0 appears to be part of a raid array:
    level=raid1 devices=2 ctime=Thu Aug 28 18:56:33 2008
mdadm: /dev/files/test1 appears to be part of a raid array:
    level=raid1 devices=2 ctime=Thu Aug 28 18:56:33 2008
Continue creating array? Continue creating array? (y/n) Continue creating array? (y/n) mdadm: create aborted.

Can someone help me fix this please?
Thank you
# 2  
Old 09-05-2008
Have you tried 'echo y | mdadm ...' ?

expect might also be an option.


Carl
# 3  
Old 09-05-2008
Quote:
Originally Posted by BOFH
Have you tried 'echo y | mdadm ...' ?

expect might also be an option.


Carl

Thanks Carl, it works fine! Well, I didn't want to use expect because it was only one interaction and expect would have over-complicated things.

Thanks
# 4  
Old 09-05-2008
Sounds good. I didn't have all the details so I provide all options I can think of Smilie

Carl
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Help with RAID setup...

Hi All, Quick question on the RAID. I have a Dell server with 27 hard drives. Two hard ware controller cards. Boot disks will be mirrored. That leaves us with 25 disks. I need to configure that as Raid 5. On the Boot disk, already installed RHEL 6. How do I make the 25 disks as RAID 5? ... (2 Replies)
Discussion started by: samnyc
2 Replies

2. UNIX for Advanced & Expert Users

USB RAID 5 Problem on Joli OS 1.2 (Ubuntu) using mdadm

Hi All, I have been trying to create a USB RAID 5 using mdadm tool on Joli OS 1.2 (Ubuntu) but with no luck. I cannot even get pass the creation of array device (/dev/md0) and superblock. I am using 3 USB keys (2 16.4 GB kingston and 1 16GB sandisk). My steps are: ... (5 Replies)
Discussion started by: powelltallen
5 Replies

3. Hardware

Problem with External Raid Controller.

Hi, We have a Sunfire 4150 with On-Board Internal Raid Controller connected to 4 X 146 GB SAS disks. This also has an External Raid Controller (Storagetek Eight-Port, External HBA Model SG-XPCIESAS-R-EXT-Z) connected to a JBOD array ( Storagetek XTA2530 ) which has 5 X 300 GB Hard disk. ... (1 Reply)
Discussion started by: ranjansukumar
1 Replies

4. Solaris

Raid problem on T2000

Hi all, First post so be gentile :) It's my first time installing Solaris on T2000 server. I have 2 72GB HD's on it. After configuring HW raid and running raidctl command I get this output: bash-3.00# raidctl -l c0t0d0 Volume Size Stripe Status Cache RAID ... (2 Replies)
Discussion started by: Obi-Wan
2 Replies

5. Filesystems, Disks and Memory

RAID Problem on SUSE 11.0

I setup a RAID 5 with 5 drives, one failed, hardware failure so I physically removed it from the raid after powering the machine off then powered it back on and my raid was still good but no 5th drive. I built a 5th drive from scratch and added it in the raid thinking the raid would go into... (0 Replies)
Discussion started by: lacakid
0 Replies

6. Shell Programming and Scripting

korn shell automation problem!

I got the task writting Korn Shell script to automate the tuxedo login so that users neednot have to enter options manually. I have done that using expect tool from the Unix but my manger told me its not secure so you have to do that using Kornshell without using Expect. Here is the way to login to... (0 Replies)
Discussion started by: pareshan
0 Replies

7. Solaris

How to setup hardware RAID on a T2000

Hello all We've just bought a T2000. It has two disks and I'm trying to figure out how to create a mirror of the boot disk. I understand that I have to boot into single user mode from DVD and then use the raidctl command to set up the mirror and label the volume afterwards. Format returns... (4 Replies)
Discussion started by: soliberus
4 Replies

8. Solaris

Hardware Raid related problem

Dear All I would Like to know that if suppose c1t0d0 is of 72 gb hard disk and system boot from this hard disk and c1t1d0 is of 147gb hard disk. Can we implement hardware raid (Mirror) between these two hard disks of different capacity if raid crontroller is present in the server Kind regards (4 Replies)
Discussion started by: girish.batra
4 Replies

9. Filesystems, Disks and Memory

Problem replace disk with RAID-5 volumes

Good morning, I have a problem replacing a disk with raid-5 volumes. An hardware error was occurred from a disk c9t3 so all slices were in maintenace. Every slice is part of a raid-5 volume. Any replica is present. Following Volume manager manual for replacing a disk, I have: - phisically... (0 Replies)
Discussion started by: bonovox
0 Replies

10. Filesystems, Disks and Memory

2-Ch RAID Problem in SCO Open Server

Help, if possible. In SCO Open Server with installation of two-channel RAID controller the following happens: on the channel 0 disk array is seen by an operational system, and on the channel 1 array is not seen (simultaneously). That is the operational system can not simultaneously use more than... (1 Reply)
Discussion started by: pko60
1 Replies
Login or Register to Ask a Question