Copying existing OS to new inserted drives


 
Thread Tools Search this Thread
Operating Systems Solaris Copying existing OS to new inserted drives
# 1  
Old 04-23-2014
Copying existing OS to new inserted drives

Hi,
I was wondering if there is an easy / recommended way to do the following:

Copy existing OS to 2 NEW drives inserted to server.

Netra 440 / Solaris 8

1. install the 2 new physical drives,
2. reconfigure the four drives to a RAID 1 array, and
3. copy the existing 2 drives to the 2 new ones.
# 2  
Old 04-23-2014
Are you expecting to use the new drives to replace the old? As in you are seeing system drive failures on your 440?

You could consider using dd to image all of the system drives. Don't copy directories like /dev, only the ones which are actual system disk filesystems (ufs). Consult your df output (or /etc/mnttab) to see what to copy. I'm sure other posters here have more precise help, but we will need some more information from you.

This is a little like restoring a system disk - while the system is still up - to another disk.
Interesting idea.
# 3  
Old 04-23-2014
Yes looking to replace the old..

Iam thinking the dd command as well..

---------- Post updated at 03:00 PM ---------- Previous update was at 01:12 PM ----------

I guess this is not exactly how I understood this. I need to explain in a new thread so as not to confuse. My apologies!
# 4  
Old 04-23-2014
Adding 2 new drives to mirror existing 2 root drives

Hi,
What I am looking for is in Solaris 8.

I currently have 2 drives installed

I would like to MIRROR those 2 drives with another pair.

Does anyone happen to have the procedure available?

Kind Regards!!
# 5  
Old 04-23-2014
Hi there,

Are you trying to create two mirrored sets? One containing each of the two current drives and adding one more drive to each? (ie 4 drives in total, creating 2 mirrored devices)

If so, here's an example of how it works. Take care of your device names - I've assuming the names, yours may well be different!

you'd want to create small (a few hundred megs will suffice) partitions on the two current drives to hold metadata for the mirror.
Create the metadatabase (3 copies) on the newly prepared partitions (in this example, it's c0 and s7):
Code:
metadb -a -c 3 -f c0t0d0s7
metadb -a -c 3 -f c0t1d0s7

Next, create a stripe/concat device (aka a submirror) for each partition on each disk (the numbering system is mine, you can use something different if you prefer - but I like this one as it's clear where everything goes)
Code:
metainit -f d100 1 1 c0t0d0s0
metainit -f d110 1 1 c0t0d0s1
metainit -f d130 1 1 c0t0d0s3
metainit -f d140 1 1 c0t0d0s4

metainit -f d200 1 1 c0t1d0s0
metainit -f d210 1 1 c0t1d0s1
metainit -f d230 1 1 c0t1d0s3
metainit -f d240 1 1 c0t1d0s4

Then create mirror devices (with just one disk in each for now) from each submirror:
Code:
metainit d10 -m d100
metainit d11 -m d110
metainit d13 -m d130
metainit d14 -m d140

metainit d20 -m d200
metainit d21 -m d210
metainit d23 -m d230
metainit d24 -m d240

IMPORTANTIf one of these disks was your root/boot device, use metaroot to set it up to boot:
Code:
metaroot d10

Now copy the partition tables from each disk to the new partner disk you are installing. You can use prtvtoc and fmthard to do this on the commandline and to make sure they end up identical.

Now that you have your new second submirrors ready, create the stripe/concat submirror devices as before (assuming the new disks are on c1 in this example)

Code:
metadb -a -c 3 -f c1t0d0s7
metadb -a -c 3 -f c1t1d0s7

Code:
metainit -f d101 1 1 c1t0d0s0
metainit -f d111 1 1 c1t0d0s1
metainit -f d131 1 1 c1t0d0s3
metainit -f d141 1 1 c1t0d0s4

metainit -f d201 1 1 c1t1d0s0
metainit -f d211 1 1 c1t1d0s1
metainit -f d231 1 1 c1t1d0s3
metainit -f d241 1 1 c1t1d0s4

Lastly, you can attach the new submirror to the existing mirror (do these one by one, wait until metastat shows them as completed rathen than syncing before beginning the next - otherwise it'll take waaaaay longer due to the head seeking back and forth like nuts)
Code:
metattach d10 d101
metattach d11 d111
metattach d13 d131
metattach d14 d141

metattach d20 d201
metattach d21 d211
metattach d23 d231
metattach d24 d241

At some point you'll want to check your /etc/vfstab looks right (it should have the mirror device names now instead of the /dev/dsk ones), check the /etc/system files looks right (forceload: misc/md_stripe and forceload: misc/md_mirror must be in there, and rootdev:/pseudo/md@0:0,10,blk if you ran metaroot above) and reboot.

I usually do the reboot after creating the single sided mirrors and running metaroot as it just feels like the natural point to do it. You could avoid the reboot possibly by doing umount and mounts to switch devices, but I prefer to know for sure it's going to look right after a reboot.


This should end up creating a series of devices (eg d10), each containing two submirrors (eg d100 and d101). Devices starting with d2 are on your second disk pair, d1 are the first disk pair.
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Date from filename inserted into records

Hi Folks, I have below files in one directory: Spiross-MBP:AIRTEMP spirospap$ ls -1 CPK2004001 CPK2004002 CPK2004003 etc... JFK2003001 JFK2003002 JFK2003003 etc... TEB1999001 TEB1999002 TEB1999003 etc... Month/year is in Filename and also in the file Header, first line. (18 Replies)
Discussion started by: spirospap
18 Replies

2. Shell Programming and Scripting

insert pipes for existing and non-existing records

I have a source file like this, L4058S462 34329094 F51010141TK1070000483L4058S462 34329094 0232384840 381892 182 5690 L4058S462 34329094 F51020141FIRST CLEARING, LLC A/C 3432-9094 L4058S462 34329094 F51030141JOHAN HOLMQVIST ... (1 Reply)
Discussion started by: saravanamr
1 Replies

3. Solaris

Add existing user into an existing group

Pre: no gpasswd/adduser there is just usermod can be used, also there is no -a option for usermod. How should I add a user into a group? (4 Replies)
Discussion started by: a2156z
4 Replies

4. Shell Programming and Scripting

folder existing and file existing

I want to look into a folder to see if there are any folders within it. If there are, I need to check inside each folder to see if it contains a .pdf file So If /myserver/myfolder/ contains a folder AND that folder conatins a .pdf file do X Else do Z I may have multiple folders and... (4 Replies)
Discussion started by: crowman
4 Replies

5. Shell Programming and Scripting

how floppy disks, CDs and flash drives (pen drives) are accessed in UNIX

hi how floppy disks, CDs and flash drives (pen drives) are accessed in UNIX? thanks (0 Replies)
Discussion started by: nokia1100
0 Replies

6. UNIX for Dummies Questions & Answers

help needed with getting last inserted row id

Hi, I am working on a script that inserts one row of data at the time to a table. Among the fields of that table is the “serial” which is the auto increment. I need to be able to retrieve last inserted row id to use it for another insert. To retrieve last row id right after I do successful... (2 Replies)
Discussion started by: arushunter
2 Replies

7. Filesystems, Disks and Memory

automatic copying files from external hard drives

I need to make it possible to automatically copy files from an external usb hard drive to a directory when i plug it in....if you can point me in the right direction, i would be very grateful....thanks a lot. :confused: (0 Replies)
Discussion started by: backman4sakn
0 Replies

8. Programming

cd inserted event

:confused: i am programming in c and i need to start a procedure automatically when a cd is inserted. Anyone knows how can i do it? thanx (9 Replies)
Discussion started by: massimo_ratti
9 Replies
Login or Register to Ask a Question