[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cobalt-users] Adding a second hard drive
- Subject: Re: [cobalt-users] Adding a second hard drive
- From: "BlackSun: rm-r-f" <rm-r-f@xxxxxxxxxxx>
- Date: Wed Jul 23 12:40:01 2003
- List-id: Mailing list for users to share thoughts on Sun Cobalt products. <cobalt-users.list.cobalt.com>
On 7/23/03 12:06 PM, "Gerald Waugh" <gwaugh@xxxxxxxxxxxxxxxxxxxxxxx> wrote:
> On Thu, 24 Jul 2003, Rick wrote:
>
>> Hi,
>> I would like to know what do i need to do after i add a second hard drive.
>
> Maybe drink one of those long-neck-bottles ;)
>
> It depends on what you want to do.
> What are you trying to accomplish with the second drive.
> Added storage?
> RAID0?
> RAID1?
> What kind of a server do you have?
I'm also running into a similar scenario.. maybe similar..
I have a 1GHZ Raq550 that was setup with 2 X 40GB drives but the 1st drive
as RAID0 by accident, and the 2nd drive is blank, unpartitioned.
I would like to convert the 2nd 40GB drive and make them both RAID1.. here's
the catch.. I don¹t want to shut down the machine as its live with sites!!
(reboot is ok though)
I've used this script that I created.. its a long boring read.. sorry..
... and the general outcome is a "Kernel Panic".. Any thoughts on this? Is
there an easier procedure.. such as changing the raidtab to "convert" the
1st drive to raid1, and add the 2nd drive as failed.. then reboot? Or does
the first drive need to be copied to the second, then fail the 1st and re
format the 1st as a RAID1 drive?
So stumped here.. if anyone has experienced this.. any help would be
appreciated.
Thanks.
-- Chris
############################################################################
# raid0-raid1 RAQ550 script created MAR.30.03
# Chris Fazekas, BlackSun Inc.
# Version 1.0
#
# The purpose of this script is to setup the secondary hard drive as raid1 #
and copy all the data over from the primary hard drive.
#
# The second script 'raid1fix2.sh' will format the primary hard drive
# and copy all of the data from the secondary to the primary, and copy over
# the old raid0config files.. reboot... and raid1 works! .... maybe...
#
############################################################################
clear
echo
echo "Welcome to the raid0-raid1 RAQ550 script part 1/2"
echo "-------------------------------------------------"
echo "This script comes with no warranty! If you do not"
echo "backup your data first, then you are a jackass..."
echo "-------------------------------------------------"
echo -n "Do you understand this warning? (Y/N):"
read acceptwarning
# WARNING CASE STRUCTURE
case "$acceptwarning" in
"Y" | "y" ) # Accept upper or lowercase input.
# do everything below.. or quit.
clear
echo
echo "-------------------------------------------------"
echo "Excellent!.. Making sure that you have backed up"
echo "all of the data just incase this does not work."
echo "-------------------------------------------------"
echo "Are you sure that you want to continue with step"
echo -n "one of this procedure? (Y/N):"
read beginstep1
# BEGIN CASE STRUCTURE
case "$beginstep1" in
"Y" | "y" ) # Accept upper or lowercase input.
# do everything below.. or quit.
clear
echo "-------------------------------------------------"
# copy over 'raidtab' with the raid1 settings
echo "Copy over current raidtab"
echo
#incase we are trying this again.. restore orig first
cd ~admin
cp /etc/raidtab.orig /etc/raidtab
cp raidtab.step1 /etc/raidtab.step1
cp /etc/raidtab /etc/raidtab.orig
cp /etc/raidtab.step1 /etc/raidtab
# make raid device setup
echo "Make raid device setup"
echo
/sbin/mkraid --really-force /dev/md5
/sbin/mkraid --really-force /dev/md6
/sbin/mkraid --really-force /dev/md7
/sbin/mkraid --really-force /dev/md8
# format partitions
echo "Formatting Partitions"
echo
/sbin/mkfs.xfs -f /dev/md5
echo "...MD5 ...Done."
/sbin/mkfs.xfs -f /dev/md6
echo
echo "...MD6 ...Done."
/sbin/mkswap /dev/md7
echo
echo "...MD7 ...Done."
/sbin/mkfs.xfs -f /dev/md8
echo
echo "...MD8 ...Done."
echo
# copy over fstab
#
#If we are doing this again, restore the orig first (if it exists)
cp /etc/fstab.orig /etc/fstab
echo "Copying over fstab..."
cp fstab.step1 /etc/fstab.step1
cp /etc/fstab /etc/fstab.orig
cp /etc/fstab.step1 /etc/fstab
echo "...Done."
echo
#create and mount new partitions
echo "Mounting new partitions..."
mkdir /mnt/newroot
echo "...Mounting /dev/md5"
mount -t xfs /dev/md5 /mnt/newroot
echo "...Done."
echo "...Mounting /dev/md6"
mkdir /mnt/newroot/var
echo "...Done."
mount -t xfs /dev/md6 /mnt/newroot/var
mkdir /mnt/newroot/home
echo "...Done."
echo "...Mounting /dev/md8"
mount -t xfs /dev/md8 /mnt/newroot/home
echo "...Done."
echo
#copy data from old partitions
cd /
echo "Copying data to new partitions..."
echo "...Copying /"
find / -xdev | cpio -pm /mnt/newroot
echo "...Done"
echo
echo "...Copying /var"
find /var -xdev | cpio -pm /mnt/newroot
echo "...Done"
echo
echo "...Copying /home"
find /home -xdev | cpio -pm /mnt/newroot
echo "...Done"
echo
# Unmounting drive and stopping raid
echo "Unmounting drive and stopping raid..."
echo "...Unmount /mnt/newroot/home"
umount /mnt/newroot/home
echo "...Done."
echo "...Unmount /mnt/newroot/var"
umount /mnt/newroot/var
echo "...Done."
echo "...Unmount /mnt/newroot/"
umount /mnt/newroot
echo "...Done."
echo
echo "...Raidstop /dev/md5"
/sbin/raidstop /dev/md5
echo "...Done."
echo "...Raidstop /dev/md6"
/sbin/raidstop /dev/md6
echo "...Done."
echo "...Raidstop /dev/md7"
/sbin/raidstop /dev/md7
echo "...Done."
echo "...Raidstop /dev/md8"
/sbin/raidstop /dev/md8
echo "...Done."
echo
#swap fstab file for new raid config
echo "Swapping fstab for new raid config"
# if we're doing this again, backup the .orig first (if exists)
cd ~admin
cp /etc/fstab.orig /etc/fstab
cp /etc/fstab /etc/fstab.orig
cp fstab.step2 /etc/fstab
echo "...Done."
echo
#swap mtab for new mtab
echo "Swapping mtab for new mtab"
cp mtab.step2 /etc/mtab
echo "...Done"
echo
#build oldroot directories
echo "Building old root directories"
mkdir /mnt/oldroot
mkdir /mnt/oldroot/var
mkdir /mnt/oldroot/home
echo "...Done"
echo
echo
echo "please run /sbin/shutdown -r now"
exit 0
;; #END OF YES CASE FOR BEGIN STEP1
# NO SELECTION FOR BEGINSTEP1
"N" | "n" ) #Accept upper or lowercase input.
echo
echo
echo "You did not start step1 of the procedure..."
exit 0
;;
# EQUALS ALL OTHER KEYS
*)
echo
echo
echo "You have pressed and invalid key, please try again"
echo
echo
exit 0
;;
esac
;; #END OF YES CASE FOR WARNING
#NO SELECTION FOR WARNING
# EQUALS NO
"N" | "n")
echo
echo
echo "You did not accept the warning"
echo
exit 0
;;
# EQUALS ALL OTHER KEYS
* )
echo
echo
echo "You have pressed and invalid key, please try again."
exit 0
;;
esac