Solved

dd command (clone) for Solaris 8

Posted on 2013-11-02
109
1,473 Views
Last Modified: 2013-11-09
Hi everyone, I am trying to clone a hard drive on my Sunfire v100 using the dd command. However, I cannot seem to make the system detect the 2nd hard drive. The setup is one source Hard drive and the 2nd is the destination. The hard drives are the same model.

I cannot seem to get the system to detect the second hard disk. Also the two hard drives that show up on is the main hard disk and the second appears to be a CD Rom based on the model and no size defined.

The second hard disk has jumper settings for cable select and its connected on the HD1 cable.

I typed in df -k and this is what shows up.
df -k commandIO stat command
io stat command
Here are the steps I took.

Typed this
# touch /reconfigure

Shut down the system.

# init 0
 
Boot the system.

ok boot -s

Copy the source disk to the destination disk. But this failed. I think c0t3d0 is the CDROM and the path is incorrect. Isnt it dsk instead of rdsk?

# dd if=/dev/rdsk/c0t2d0 of=/dev/rdsk/c0t3d0  


Can anyone provide assistance please?

Thanks!
0
Comment
Question by:TeknikDev
  • 51
  • 28
  • 25
  • +1
109 Comments
 
LVL 76

Expert Comment

by:arnold
ID: 39619527
df -k only reflects mounted file system.

adding a drive hot, you would need to use devsadm to detect it or alternatively
touch /reconfigure
reboot
format

this will enumerate all the drives in the system.
partition the new drive as you see fit
then mount each partition thast you want to copy

Instead of using dd which is a low level and could take a long time, you could use
ufsdump 0f - /dev/dsk/c0t2d0s0 | ufsrestore -xf - /mnt_root_of_new_drive
ufsdump 0f - /dev/dsk/c0t2d0s6 | ufsrestore -xf - /mnt_usr_of_your_new_drive

note you need to modify the fstab

alternatively, you could configure the existing drive and the new one in a software RAID using metadevices.
0
 

Author Comment

by:TeknikDev
ID: 39619762
thank you arnold, i am farily new to Solaris and Linux.

Could you provide exact instructions for the dd command? I know its lower level and takes  long time but I want to take this route to prevent modifying anything. I just want to be able to install and boot right away.

so are these the steps? please can you type as is so i can follow?

#    touch /reconfigure   <---- nothing happens when I hit enter, is this normal?

what is the procedure for devsadm ?

#    init 0
ok   format    <---- -will this show the new drive in df -k command?
ok    dd command starts here?
0
 
LVL 22

Expert Comment

by:blu
ID: 39619791
The disk drive you see at target three is your CDROM, not the new disk, as you surmised.

So far you have no indication that the disk is even seen by the system.

To answer your question, the "touch /reconfigure" doesn't do anything by itself, it just creates a file that the boot procedure looks for to indicate that new hardware has been added and that it needs to look for it and do some stuff to make it available. So after doing the touch /reconfigure, you need to reboot.

First thing to do is to see if the hardware is working right. From the "ok>" prompt, run the command "probe-ide". This will cause the bootprom to go to each IDE controller and to try and get info on each target on that controller. If the disk is correctly set up it should show up in the list, along with some info about it. You should look for a number that indicates the target or disk number. The current disk will have this number as a "2" (from the output above) and the cdrom will have this number as a "3".

If that works and the system can see you new disk, then type "boot" at the okay prompt to boot the system. If you already did the "touch /reconfigure" then the system will automatically run devfsadm and make the disk available to you on the system.

Once the system is up and running, you can run the "format" command. It will show a list of available disks, hopefully your new disk will be on the list.

You generally don't want to clone a disk with dd unless the disks are exactly the same. The usfdump and restore method is better, but you need to partition the disk first and the ufsdump and restore must be done for each file system separately.
0
 

Author Comment

by:TeknikDev
ID: 39619803
Hi blu, thanks that was crystal clear!

Steps:
# touch /reconfigure
# init 0
ok probe-ide
ok boot -s

This is the results! It shows both hard disks! I removed the CD rom so it wont be confusing.

probe-ide
Can you help me and type out what the dd command should be?

Once I boot into single user mode (to use dd command), do I go into maintenance mode or just boot in normally?

The disks are exactly the same size and model which is why I want to try dd and dd command doesnt require me to do anything like setup configure or boot files. It should boot as it was the original hd.

Here is the results from Format command. Looks good so far, can you tell me what to type next?
format
0
 
LVL 47

Expert Comment

by:dlethe
ID: 39619813
You can't clone a booted device if it is mounted read-write.  The filesystem will change while you are copying it.

(Exception, is if you are using ZFS, then you could easily just take snapshots, or convert to a mirror and then split the mirror).

Do you have another system? You could boot off the network and run the system diskless.  
Or yank the disks and stick them in a PC and use dd while that system is running LINUX.

Bottom line, you are not going to get it to work when you are booted to the source drive that you use to copy from … unless you are booted to a read-only image.
0
 

Author Comment

by:TeknikDev
ID: 39619814
dlethe - do you mean another PC with Solaris?

Do you mean like this?
PC has the Solaris OS 8 installed
Insert the Source HD and Destination HD from the Sun fire as slaves on the PC so there are now 3 hard disks?

Hard Disk 0 = PC Solaris 8 OS
Hard Disk 1 = Source HD from Sun Fire
Hard Disk 2 = Destination HD from Sun Fire

Does all three hard drive have to be identical?
0
 
LVL 47

Expert Comment

by:dlethe
ID: 39619823
Any computer, any *nix operating system.   dd is a bit-level copy. It doesn't care what O/S the source and target disks have on them.  All dd sees is 1s and 0s.  

but it also cares about the total block count. I am assuming that the two disks have the same block count, or at the very least the target disk capacity is larger than the source.  If not, you'll end up with something that may or may not boot, but it will likely result in data loss.

I suggest to make life easy, you make a bootable USB stick with linux on it.  Go to ubuntu.com and on home page is instructions to do that.
0
 

Author Comment

by:TeknikDev
ID: 39619879
Hey dlethe - sorry just to be clear. Since I'm still a newbie, i need to make sure. :)

So to clarify, are you saying create a bootable USB stick with Linux on it...now this will prevent me from having to install Linux on the machine right?

Yes both of the hard drive are the same size and model. When you say same block count, if the destination hard disk is going to be the clone of the source hard drive, wouldn't that be okay?

Instead of a USB stick, can a DVD or CDrom work? I went searching for it on Ubuntu.com and no luck. I do however have Ubuntu's bootable CDs.

Can you provide the link?

Thanks!
0
 
LVL 47

Expert Comment

by:dlethe
ID: 39619887
Yes, you can even make a bootable CD/DVD called a "live" distribution.  it boots to a read-only kernel and will not mount any Solaris or even windows partition read-write.

If source & destination are same make/model, and if you didn't go out of your way to manually install some software that reprograms the total block count … then block count (total capacity to the byte) will be the same.

Here is the link to build a bootable live USB.  Sorry, they changed the layout since last time I looked at the home page..

USB stick .
http://www.ubuntu.com/download/desktop/create-a-usb-stick-on-windows

other options:
http://www.ubuntu.com/download/desktop/try-ubuntu-before-you-install
0
 
LVL 22

Accepted Solution

by:
blu earned 300 total points
ID: 39619892
You don't need to boot off a USB or CD you just need to be in single user mode. It is true that the disk may change during the process, but if you are in sginle user mode the chnages will be minimal and if you do an fsck of the resulting disk it will correct any changes that did occur.

Oracle has the procedure on line. See http://docs.oracle.com/cd/E19253-01/817-5093/6mkisoqni/index.html

The procedure is the same for Solaris 8.

From the probe-ide, we can see that the target disk is disk0. You source disk is the current boot disk, disk2.
0
 

Author Comment

by:TeknikDev
ID: 39619957
Yikes, sounds like contradictions here. So I'll try blu's method first since its the easiest and if it doesnt work, I'll try dlethe next. Thanks guys!
0
 

Author Comment

by:TeknikDev
ID: 39620065
confused - can you tell me if its c0t2d0 or c0t0d0 is the source?
0
 
LVL 47

Expert Comment

by:dlethe
ID: 39620083
run the format -e command (it is menu-based, no worry about it automatically formatting),  and select the option to tell you the serial numbers for both.  Do a physical inspection after powering off the machine so you know which is which.

Device names are not written in stone.  The same HDD can be a different device name after a power cycle (this is more common in a SAN environment or after a device goes offline then online, but still it can happen).

If you are not sure which drive is the one that was originally there, then unplug power to one if them.  If it boots, then you know serial # of the one that is booted by running format with the -e options.

(Note, -e may not be the advanced option in solaris 8, don't remember, but you can do a man on the format command if it doesn't like it)
0
 

Author Comment

by:TeknikDev
ID: 39620095
ok - i noticed the magic label error on one of the hard disk. I previously did a clone using paragaon hard drive disk manager 12, possibly it cloned fine but the label is wrong?
0
 
LVL 47

Expert Comment

by:dlethe
ID: 39620212
Sorry, i have no idea what paragon might be doing, but if the label is wrong it clearly didn't do a bit-level copy.
0
 
LVL 22

Expert Comment

by:blu
ID: 39620639
From your original posting screen shots, the current boot disk is c0t2d0s*. From the format command output the new disk is c0t0d0s*. (The asterisk representing multiple sections).

There wasn't really a conflict. The other poster was just noting that on a live system the disk image is constantly changing and system buffers mean that the disk image may not be consistent and so wanted you to boot off of another device to prevent this. My point is that when you boot single user there are no applications writing to disk so log files are the only thing changing. If you copy it like that you still lose the buffered data, but that is the same as just unplugging a live system, which is what fsck is designed to recover from. So the procedure is to run fsck on the new disk to make sure the resulting disk is consistent.
0
 

Author Comment

by:TeknikDev
ID: 39621160
Ugh, I thought the magic label error was the issue why the 2nd hard disk wasnt booting so I googled it and typed backup and just hit enter to change the label. Now when I do probe-ide, only the primary hd is showing up!

Can someone tell me why? I just change the jumper on the hd so its slave also.
thanks
0
 
LVL 76

Expert Comment

by:arnold
ID: 39621238
The drive was already reflected as slave, double check that you did not out the jumper in the master position.
Magic label issue with an old drive points to a failure, with a new drive that it is not formatted in a solaris way.
0
 

Author Comment

by:TeknikDev
ID: 39621476
i want to reformat so that its in the "Solaris" way, can someone provide instruction so its a clean hard drive?

The models are identical
0
 
LVL 22

Expert Comment

by:blu
ID: 39621570
Is your problem now with the original boot disk or the new disk? Does the disk still show up in the format command?
0
 

Author Comment

by:TeknikDev
ID: 39621699
The problem is the new disk. The new disk does not show up in the format command. Only the original boot disk.
0
 
LVL 76

Expert Comment

by:arnold
ID: 39621762
Could you elaborate on what exactly you did after which point the drive no longer shows up?

Double check to make sure it is still plugged-in.

This was not a old drive that you just found?

did you try the

defsadm
http://www.experts-exchange.com/OS/Unix/Solaris/Q_21425765.html


make sure you have devfsadmd running (ps -ef | grep devfsadmd)
devfsadm -c disk
this will limit the tool to scour for disk references.


the command for dd is partition by partition.
if input file
of output file
(linux/Unix everything is referenced as a "file")

dd if=/dev/dsk/c0t2d0s0 of=/dev/dsk/c0t0d0s0

IMHO, to do the entire disk, I think you have to be booted by an external OS (CD/DVD)
dd if=/dev/dsk/c0t2d0 of=/dev/dsk/c0t0d0

It is a 40gig drive.

using ufsdump with ufsrestore means the formating/partitioning of the new drive has to be done by you and then the data is cloned.
But all this can be done while the system is operational.

Another options is to use metainit/metadb/metattach
to convert your existing setup to a RAIDed one with the OS managing the cloning of the disks.
0
 
LVL 22

Expert Comment

by:blu
ID: 39621785
If it doesn't show up in the probe-ide, I'd try powering everything off, reseat the cables and then power on again. Once you get to the OK> prompt, try the probe-ide again.
0
 

Author Comment

by:TeknikDev
ID: 39622167
I just noticed the error message about corrupt label - wrong magic number so I tried to fix it by following the instructions found here.

http://docs.oracle.com/cd/E19620-01/805-4036/msgs-1187/index.html

"The workaround is to go into format and get the backup label using the backup command. Relabel the disk using this backup label. You should then be able to access the disk."

That's all I did, when it asked to enter a label, I just hit enter.
0
 
LVL 76

Expert Comment

by:arnold
ID: 39623231
So you created slice 2 backup referencing the entire drive from 0 to 40Gb?

The fix for that was to partition the drive and save labeling the disk.

The issue that the disk is not showing up points to either it failed, is no longer connected, or is no longer connected to power.
Or the jumper you set is incorrectly set as primary while connected as secondary, cable select while cable does not provide that support, or the connection slipped.

Do you have another non-solaris system to which you can attach this disk to wipe it.
Confirm it is functional?
0
 

Author Comment

by:TeknikDev
ID: 39623240
Hi everyone, here's the latest. So I basically wiped clean the destination drive and tried the dd command again. The good news is after i plugged it in and type touch /reconfigure, the system detected the new hard drive. However, the issue now is the dd command is not able to execute for lack of better word. I provided the screenshots.

I tried all the commands by arnold and blu and still got the No such file or directory exists.

Any thoughts here?

 errors from dd command
format
dfk -k
0
 
LVL 76

Expert Comment

by:arnold
ID: 39623245
What is the dd command you are running and what is the error message.

I believe the issue is that dd will likely not run to work on a mounted filesystem which c0t2d0 has two.

How about you try the ufsdump/ufsrestore copying.
Alternatively, look at metadevices

Let's try this.

What is the purpose behind what you are trying to do?  What is the goal, is the current drive dying and you want to replace it with minimal impact?

Look at man metainit, metadb, metattach.
0
 

Author Comment

by:TeknikDev
ID: 39623246
also, how do you delete a typo in the # command line? It's annoying that I have to start over if I hit the wrong key. The backspace and delete button adds funny characters afterwards.
0
 

Author Comment

by:TeknikDev
ID: 39623247
Hi arnold, basically trying to clone the hard drive as close as possible.

can you please provide more details of what you suggests? I am willing to try it if I have it step by step.

Also, I am willing to take the two hard disk and set it up as slave on a PC installed with Linux to use the dd there.
0
 
LVL 76

Expert Comment

by:arnold
ID: 39623248
Ctrl-h is backspace if not mistaken.

When you hit backspace, you get a control character? ^[ or something like that?
Ctrl-w is delete word
Ctrl-u is delete the entire line.

Your keyboard emulation might not be set correctly.
TERM=VT100
not sure whether stty is limited to the OS I.e. stty erase=[hitbackspace]<enter>
0
 
LVL 76

Expert Comment

by:arnold
ID: 39623292
The below are steps, but only try them after reviewing the commands and making sure you are ok with them.
As well as make sure you have a full backup.

If you have a test system on which you can try these steps first, consider trying there first.
The process requires alteration to the boot record to boot from or reference the metadevice that will be created.


http://docs.oracle.com/cd/E19455-01/806-3206/sds41installrel-181/index.html
http://www.mattzone.com/disksuite.html


Do you have available 10-30 MB of space left on each device to function as the metastate record?

I.e. c0t2d0s7
Make sure to format/partition the new drive identically as far as spacing/cylinder allocation.
While it is not a requirement to use s0 on both, it helps to maintain a uniform convention.

metadb -i -a /dev/dsk/c0t2d0s7 /dev/dsk/c0t0d0s7

The firs step is to define the existing drive/partition-slice as a metadevice without losing data.
metainit -f d10 1 1 /dev/dsk/c0t2d0s0 # crates a single device
metainit -f d20 1 1 /dev/dsk/c0t2d0s6 -||-
metainit  d0 -m d10 initialized the RAID volume consisting of a single submirror
metattach d1 -m d20 -||-

metastat

This will return the currents state of the newly created metadevices d0 and d1.

http://docs.oracle.com/cd/E19469-01/819-6562-17/chapter6_preOS.html

Here you would need to modify /etc/vfstab for the mount points to transition from the c0t2d0sx to /dev/md/dsk/d0 and d1 respectively.
Best is if you create new entries for the new reference while commenting out the existing ones by adding a # at the begining of those lines.

You would then need to update the boot record.
Booting using a CDROM and then altering the on disk /etc/vfstab back if the system fails to boot/mount/function.

If this transition works,

You would run
metainit d11 1 1 /dev/dsk/c0t0d0s0
metainit d21 1 1 /dev/dsk/c0t0d0s6
metattach d0 d11
metattach d1 d21
metastat -a
Should reflect the two respectively as synchronizing.
0
 
LVL 76

Expert Comment

by:arnold
ID: 39623301
The different discussion to your question, but deals with modifications related to metadevices and back and forth transitions.
While the issue faced by that user differs from yours the scenario might help in providing context and troubleshooting ideas for future reference.

http://www.experts-exchange.com/OS/Unix/Q_28253655.html
0
 
LVL 22

Expert Comment

by:blu
ID: 39624155
You didn't follow the link I gave to to the Oracle docs. You should go to the format command, select the existing device, and then print the partition information and write it down. Then exit and reenter and select the new device and partition it the same way. Once you have done that, follow the instructions in the link. Specifically, you need to use the raw device of slice 2, i.e. /dev/rdsk/c0t0d0s2 and /dev/rdsk/c0t2d0s2. You left out the s2 in your dd command.

You can use the volume manager as described above, but that is a really heavyweight solution and modifies your existing disk substantially to get there. i definitely wouldn't go that way. And of course, the medium solution is to run newfs on the slice 0 and slice 6 of the new disk and then run ufsdump and ufsrestore. That is all around the safest.
0
 

Author Comment

by:TeknikDev
ID: 39624241
Hi Blu, I did. I got up to step 6 and got those error messages. I just did not format it the way you mentioned. In your previous examples, I don't think you typed the s2, I'll try that this time.

How do you partition it? Can you explain more details? I know type format and then I dont recall the menu, but I assume there's a partition item to select and just select the same sizes?

Arnold, thanks so much for all your help man. I'm going to try two things first.

First, I'll try blu's method of formatting the partitions and then cloning as described on the Oracle website. If that fails, I'll try the second method as Arnold originally suggested.

Second, I've already installed Ubunta 12 on the PC and plugged the other Sunfire hard drive as slaves. I'll then use the dd command to see if it will work.

Lastly, I'll go with the meta device step...this seems very difficult or at least has lots of steps to it...so saving this for last resort if the first two fails. WIsh me luck guys!!! THanks again for your help!
0
 
LVL 22

Expert Comment

by:blu
ID: 39624427
To print out the partition table, enter format, select the source drive. At the prompt, type "p" and return (this is for partition), then type "p" again and return (this time it is for print). Write down everything that is printed. Exit format.

Enter format again, select the target drive and type "p" and return. Then, one by one, type the partition numbers and return to enter into the modification dialog. Answer the questions for each partition. The first three questions should be obvious (tag, perms, starting sector), but the fourth can be tricky because the size is scaled and unless you use the right value and scale rounding can trip you up. I suggest you use the "e" scale which (IIRC) lets you specify the end sector.

Once you get through all of them (truthfully, I think all you need is slice 2, but it doesn't hurt to do them all) type "label" then quit. Actually, it might be a good idea to type "p" first and double check that the numbers match the source disk before doing the label command.

At this point you may need to do a touch /reconfigure reboot to get everything squared away. After that the dd commands should work. I think all you will need is to do the dd command on the /dev/rdsk/c*t*d*s2 devices. That should include the entire disk and clone it exactly. Once you do the dd command, remember to do the fsck on each partition individually (excluding unused and partition 2 this time).  That should do it.
0
 

Author Comment

by:TeknikDev
ID: 39624543
Blu, thanks so much! When you say do the dd command on the /dev/rdsk/c*t*d*s2 devices, are you expecting me to type as you just said or are you just referring to the source and destination harddisks?
0
 
LVL 22

Expert Comment

by:blu
ID: 39624704
The source and destination. Replace the asterisks with the appropriate digits.
0
 

Author Comment

by:TeknikDev
ID: 39625964
Hey Blu, can you tell me why two hard drives of the same model does not have the same parition size? I tried what you told me but I kept getting for one of the partitions that there's not enough space to expand to match the source. :(

Any thoughts? Should I reformat the destination hard disk (how?) and re-partition?
There's just small difference as noted by the colored box
 result
0
 

Author Comment

by:TeknikDev
ID: 39626025
Nevermind, i used a predefined parition from the select menu that matched up with the source fine. Now rebooting after touch /reconfigure and will be going into single user mode to DD command. Fingers crossed...
0
 

Author Comment

by:TeknikDev
ID: 39626031
Now after rebooting in single user mode, this is the error.

Boot device: /pci@1f,0/ide@d/disk@0,0:a  File and args: -s
The file just loaded does not appear to be executable.

However, when I remove the slave drive, it boots fine. (Whew!)

So what's next? If I do cable select on jumper, it fails to boot.
0
 
LVL 22

Expert Comment

by:blu
ID: 39626228
I am pretty sure that when the disk is installed the system is trying to boot off of it. Before the disk didn't look like a Solaris disk so it was skipped, but now it looks like a Solaris disk so it tries to boot it, but I think it is missing the boot block.

Notice that the boot device is 0,0:a which is disk 0 which is your target disk. To install the boot block you need to get the disk on the system but still boot off of the current disk. You need to find out the full device name for the current disk. It will look pretty much like the device name it shows for the boot device above. Then from the ok> prompt, instead of saying "boot", say "boot" followed by the device and the -s. i am sorry, I don't have an openboot prom available, so this is by memory, so apologies if that isn't exactly right. In any case you need to boot off the current disk in single user mode.

Here is a link that talks about specifying a different disk:
http://jackngblog.blogspot.com/2008/04/change-boot-device-target-number.html

Anyway, once you boot single user with both disks you need to run the installboot command.

The command you need to run is this:

 /usr/sbin/installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/c0t0d0s0
0
 
LVL 76

Expert Comment

by:arnold
ID: 39626285
As blu pointed out, you need to update the boot to point to
/pci@1f,0/ide@d/disk@0,2:a
Or
/pci@1f,0/ide@d/disk@2,0:a


Try not changing the boot record, and try to boot.

When you attach the drive and upon boot failure, try boot disk1
To see whether it will bot the system

Make sure to record the current so that you can revert back.
0
 

Author Comment

by:TeknikDev
ID: 39627020
Blu/Arnold,

I manage to get the disk to boot by simply doing "boot drive2 -s". I then was able to see both disk and executed the dd command, it started I assume since the cursor is blinking with no statuses...how do i know its doing sometehing or complete?

I assume s2 is the main partition right? I did not define the bs at the end of dd command. Is that okay?

dd
0
 
LVL 76

Expert Comment

by:arnold
ID: 39627208
It takes a long time to copy using dd.

You could run ps -ef | grep dd
What you are looking for is the process is PID of the dd command.

truss -p <PID>
You will see what it is doing. Note this adds overhead and will slow down.
0
 
LVL 22

Expert Comment

by:blu
ID: 39627280
I don't know if leaving off the blocksize is okay.  You should probably should have just kept it there just to be sure.

I thought you said that you already ran the dd before and that it was after that that you got the message about the file not being executable? If that was not the case, then don't run the installboot unless after the dd you can't boot from the disk.
0
 
LVL 76

Expert Comment

by:arnold
ID: 39627384
Lets say the dd completes the cloning.

What then?
The data on the existing disk2 will be updated while the disk0 will not reflect those changes.
0
 

Author Comment

by:TeknikDev
ID: 39627562
Blu - I followed arnold's instructions of telling the system what hard drive to boot from and it worked. Shucks, if leaving the blocksize off causes an issue, Ill try again with it on. Hopefully not.

Arnold, what do you mean? I thought the dd clone with mirror the source onto the new hard drive and I'll do the fchk on the disk and then it should boot as if it were the original disk? Or at least thats what i thought.
0
 
LVL 22

Expert Comment

by:blu
ID: 39627570
So what? If the source disk was a live database with transactions occurring that would be a problem, but if the dd is taking place in single user mode then by definition there are no application level changes taking place. Changes such as system log files will potentially be out of date, but again, so what?

Whether this is problem or not depends on what is trying to be accomplished. IF you are trying to copy a system disk so that you can create an identical system on different hardware, then this should be just fine.
0
 

Author Comment

by:TeknikDev
ID: 39627721
Ok - update:

After executing the dd command and letting it run for nearly four hours, it seem like it rebooted? The LOMlite message appeared.

Any idea what happened here? It went right into Single User Mode prompt? And is booting from the new HD.  

Should I just power the system down and do a single HD boot with the new HD? Or should I go into Single User Maintenance mode? Any thoughts?

I guess the good news is I'm not seeing a corrupt magic label error this time around booting from the new disk.

DD --> After DD
0
 
LVL 22

Expert Comment

by:blu
ID: 39627985
It looks like you dropped into single user mode because the root disk isn't complete. IT looks like there are a bunch of missing directories and files.

The fact that you were able to boot off of this disk at all indicates that the label and bootblock were written. So, I think that at this point you best bet is to fall back to the ufsdump and restore procedure.

Try to boot disk2 -s again. Once you get there, you have three slices that you need to copy, s0 (root), s6 (usr) and s7 (home). Just run newfs with the raw (rdsk) devices on those three slices on the target disk. That will create emtpy filesystems on those three slices.

Here is a link that goes through the whole process. Remember to use the correct device numbers for your situation since yours will not match the ones used at the link. And we never got that far, but as the link points out the vfstab on the new disk will have incorrect device numbers if you move the disk to another system or leave the disk on the same system along with the original disk.

http://troysunix.blogspot.com/2010/10/disk-cloning-in-solaris.html
0
 

Author Comment

by:TeknikDev
ID: 39628295
Blu/Arnold,

First off , thanks again from all the attention from you two gurus. I would not have gotten this far without your help. I know arnold suggested the meta technique, but a newbie such as myself is intimidated and is looking for the easiest execution option. Hopefully - at the end, I can still get to where I want with both of your help.

Anyways, back to the subject. Blu, how come it never loaded the details of the tasks when dd cloning was complete and it didnt' allow me to do an fsck on the partitions as stated in the oracle instructions? (Just trying to understand the process)

I apologize but I need a little hand holding here since i'm a rookie at this stuff.

================STEPS?===========
So since it's prompting me to enter a password in single user mode, I will enter my password and then try to boot by typing "boot disk2 -s".

Copy s0(root), s6(usr) and s7(home) - how? so from the ok or # do I do this? I read the link and updated with MY drive devices...can you read and confirm if this is correct on how I should execute?
 
1) use prtvtoc and fmthard to partition the second disk

prtvtoc /dev/rdsk/c0t2d0s2 | fmthard -s - /dev/rdsk/c0t0d0s2

2) newfs the slices on the second disk

        echo "y" | newfs /dev/rdsk/c0t0d0s0
        for i in 3 4 ; do echo "newfs /dev/rdsk/c0t0d0s${i}"
                echo "y" | newfs /dev/rdsk/c0t0d0s${i} ; done

3) mount up the root slice, etc, of the alternate disk under /mnt

[ ! -d /mnt ] && mkdir /mnt
        mount /dev/dsk/c0t0d0s0 /mnt

4) change directory to /mnt and mirror the master disk

        cd /mnt ; ufsdump 0uf - /dev/dsk/c0t2d0s0 | ufsrestore rf -
        rm restoresymtable
        [ ! -d /mnt/usr ] && mkdir /mnt/usr
        mount /dev/dsk/c0t0d0s3 /mnt/usr
        [ ! -d /mnt/var ] && mkdir /mnt/var
        mount /dev/dsk/c0t0d0s4 /mnt/var
        cd /mnt/usr ; ufsdump 0uf - /dev/dsk/c0t2d0s3 | ufsrestore rf -
        rm restoresymtable
        cd /mnt/var ; ufsdump 0uf - /dev/dsk/c0t2d0s4 | ufsrestore rf -
        rm restoresymtable


5) update the vfstab to be appropriate for the cloned (alternate) disk

sed < /mnt/etc/vfstab -e s/c0t2d0/c0t0d0/g > /tmp/vfstab.new
        mv /tmp/vfstab.new /mnt/etc/vfstab
                # you should probably verify the contents of /tmp/vfstab.new
                # before moving it into place

6) unmount all new filesystems and fsck each new FS slice

        cd / ; umount /mnt
        fsck /dev/rdsk/c0t0d0s0
        fsck /dev/rdsk/c0t0d0s3
        fsck /dev/rdsk/c0t0d0s4

7) run installboot on the alternate disk to create the bootblock

        installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/c0t0d0s0

           ***** Which one do I use for my Solaris 8 ???****
Note: on Sol10x86 (or previous versions with Grub)(added by colleague (Bill))
        /sbin/installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c0t1d0s0

8) reboot your box and boot from your alternate disk... enjoy
 ================================================================
0
 
LVL 22

Expert Comment

by:blu
ID: 39628380
i don't know why the system rebooted, but it seems to have done so before having finished doing the copy.

The boot disk2 -s only works from the ok> prompt. You will need to get there first.

Once you are booted, double check that you have the right disk. Do df -l and make sure you see c0t2d0s0 and c0t2d0s6 mounted on / and /usr. I notice that the /home directory is not mounted. Do you know if there is data on it that you want to copy? Since it is the largest slice it will take a lot less time if you don't need to copy it. You could just try to mount it to see:

mount -F ufs /dev/dsk/c0t2d0s7 /mnt

If that works, do "df -l /mnt" to see if there are more than the required files on the slice. If it doesn't mount or if it is empty you can skip copying it.  If the mount succeeded, you will need to unmount it again. Run "umount /mnt". Make sure you do not have a process in the /mnt directory or the umount will fail with a filesystem busy error.

Once you are sure that your source is at c0t2d0 and your target is at c0t0d0, then we can get started:

prtvtoc /dev/rdsk/c0t2d0s2 | fmthard -s - /dev/rdsk/c0t0d0s2

echo "y" | newfs /dev/rdsk/c0t0d0s0

echo "y" | newfs /dev/rdsk/c0t0d0s6

echo "y" | newfs /dev/rdsk/c0t0d0s7

mount /dev/dsk/c0t0d0s0 /mnt

cd /mnt

ufsdump 0uf - /dev/dsk/c0t2d0s0 | ufsrestore rf -

rm restoresymtable

cd /

umount /mnt

mount /dev/dsk/c0t0d0s6

cd /mnt

ufsdump 0uf - /dev/dsk/c0t2d0s6 | ufsrestore rf -

rm restoresymtable

cd /

umount /mnt

(if you also want to copy slice 7)
mount /dev/dsk/c0t0d0s7

cd /mnt

ufsdump 0uf - /dev/dsk/c0t2d0s7 | ufsrestore rf -

rm restoresymtable

cd /

umount /mnt

 fsck /dev/rdsk/c0t0d0s0
 fsck /dev/rdsk/c0t0d0s6
 fsck /dev/rdsk/c0t0d0s7

installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/c0t0d0s0

Once you do all of that, you need to edit /etc/vfstab on the new root disk if you want to use the new disk to boot with. You will need to mount s0 of the new disk again, cd to /mnt/etc and then Just edit it and change all of the instances of c0t2d0 to c0t0d0. If you want to leave the current system the same and move the new disk to a different system, then change c0t2d0 to whatever the disk device name will be on the new system. When you are done editing the vfstab file, cd out of the /mnt directory and do the umount /mnt command. At this point you should be done. You will probably want to boot to the new disk to to make sure.
0
 

Author Comment

by:TeknikDev
ID: 39628396
Thank you sir!!!! You are awesome! I appreciate it very much. I will give it a shot later this evening.

I noticed you skipped one or two steps from the link you sent me, I assume its ok to?

The new disk will definately be used to boot on a new machine and not as a slave on the old one. :)
 
I will be back later to keep you posted.
0
 
LVL 22

Expert Comment

by:blu
ID: 39628450
The steps right after the remark about the home slice do that. i.e.:

mount /dev/dsk/c0t0d0s7

cd /mnt

ufsdump 0uf - /dev/dsk/c0t2d0s7 | ufsrestore rf -

rm restoresymtable

cd /

umount /mnt

These mount the slice, copy the files into it from the slice on the source and then unmount it.
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

Author Comment

by:TeknikDev
ID: 39628467
cool! How confident are you that this will work or even possible at this point based on what you've seen and your experience with Solaris cloning.
0
 
LVL 76

Expert Comment

by:arnold
ID: 39628713
what are you looking to accomplish?

What is the end goal?
0
 
LVL 76

Expert Comment

by:arnold
ID: 39628755
Eventually if this is a production system migrating to a metadevice setup provides the redundancy and seamless handling of a single failed drive.
ufsdump|ufsrestore is a much faster cloning process.
0
 

Author Comment

by:TeknikDev
ID: 39628776
Just creating a clone harddisk that is exactly the same and can be used to boot up with another sunfire machine.

Arnold say if what im about to do fails. Can you provide steps to usfdump/usfrestore as is? Can this be done w just source and destination hd?

All hardware models are the same.
0
 

Author Comment

by:TeknikDev
ID: 39628879
Hey Blu,

Here's the update from the "df -l" command.

It doesnt seem like the root was copied over. Only the usr

df -l
0
 
LVL 22

Expert Comment

by:blu
ID: 39628920
I am confused by your last posting. It looks like you have the new disk mounted on / and the old disk mounted on /usr. But if the / wasn't copied, how could you boot it like that? Have you done the ufsdump and restore as I described? You need to boot with both the old disk mounted on / and /usr before you do the procedure I gave before.
0
 

Author Comment

by:TeknikDev
ID: 39628934
not yet- i was just showing you since in your notes for me to check. I am in the process of doing that this instance, however, when i try to get to the ok prompt, by typing init 0, it doesn't allow me.

info
Also, when i type touch reconfigure, it says touch: /reconfigure cannot create

 Any thoughts how I can get to the ok prompt?
0
 
LVL 22

Expert Comment

by:blu
ID: 39628938
How are you connected to the system? Are you at the keyboard connected directly to it? If so, is the keyboard a Sun keyboard? You can drop to the ok> prompt by pressing the "Stop" key (top left) and the "a" key at the same time.
0
 

Author Comment

by:TeknikDev
ID: 39628945
No sun keyboard - but terminal Putty app. I tried sending the break command from Putty with no luck.

- I want to go to Single User mode still right?
0
 
LVL 76

Expert Comment

by:arnold
ID: 39628970
yes, you boot disk2?

The existing boot config points to the first drive in the system by (tx indication).

not sure why you have as blu pointed out /dev/dsk/c0t2d0s0 replaced with a reference/label within /etc/vfstab.

make sure you have a copy of vfstab and then
comment the / line
and add
/dev/dsk/c0t2d0s0 /dev/rdsk/c0t2d0s0 / ufs defaults (make the rest similar to the line it is replacing.)
0
 

Author Comment

by:TeknikDev
ID: 39628976
Its booting from the NEW hard drive. I basically partitioned the new hard drive with the same info as the original source hard drive. Other than that, thats all i did and executed the dd command.

I still cant get to the ok prompt, so I can switch back to disk2 (original disk) so I can run the usfrestore etc.
0
 
LVL 22

Expert Comment

by:blu
ID: 39629015
You can use the eeprom command to set the boot disk. First just type eeprom to see the current values. Then set the boot-device to disk2:

eeprom boot-device=disk2

Once you do that, you can just reboot and it should boot from the disk2 device.

I just realized, you are using putty to connect to the ilom, right? The ilom can force the session to the boot prom if you can get back to the olom. Try the eeprom first though.
0
 
LVL 76

Expert Comment

by:arnold
ID: 39629019
stop-A
send break in putty while the bootup is going on.
if your system was booted, it will drop into the ok prompt where you can update the boot from disk0 to disk2

within the shell
reboot -- -s

it should go into single user mode.
0
 
LVL 22

Expert Comment

by:blu
ID: 39629025
He said he already tried send break in putty, probably the break is swallowed by the ilom. And booting single user is necessary but not sufficient, since he needs to boot from disk2. However, setting the boot-device with the eeprom command *and* doing the reboot -- -s should do what is needed. I forgot to mention the -s before. Sorry.
0
 

Author Comment

by:TeknikDev
ID: 39629029
ok giving it a shot - also noticed the original hd when booting up now says
ufc: NOTICE: realloccg /:file system full.

What does that mean? Wasnt there before
0
 
LVL 76

Expert Comment

by:arnold
ID: 39629037
there might be errors that forced the filesystem to run out of space.
or that partition ran out of space or is in read-only mode.
0
 

Author Comment

by:TeknikDev
ID: 39629042
ok - so I tried the eeprom command.

it was originally:
boot-device=/pci@1f,0/ide@d/disk@0,0

and now I changed it to:
boot-device=/pci@1f,0/ide@d/disk@2,0

and I type init 0 and get the error INIT: Cannot create /var/adm/utmpx


and kicks me back to Single User Mode sign in.

So now, just typed "reboot" and it's booting from disk 2. I forgot to put the "reboot -s"
0
 
LVL 76

Expert Comment

by:arnold
ID: 39629047
reboot -- disk2 -s
might do what you want.
0
 

Author Comment

by:TeknikDev
ID: 39629056
ok here's the new df-l from the original disk from Putty
df -l
new disk from Hyper Terminal
dfl new
0
 

Author Comment

by:TeknikDev
ID: 39629061
So I just mounted the missing 7


# mount -F ufs /dev/dsk/c0t2d0s7 /mnt
# df -l /mnt
/mnt               (/dev/dsk/c0t2d0s7 ):55241980 blocks  3456370 files


Do I unmount now? Is the command

unmount /mnt
0
 

Author Comment

by:TeknikDev
ID: 39629064
Here's the latest:

# mount /dev/dsk/c0t0d0s0 /mnt
mount: /dev/dsk/c0t0d0s0 is already mounted, /mnt is busy,
        or the allowable number of mount points has been exceeded
# cd /mnt
# ufsdump 0uf - /dev/dsk/c0t2d0s0 | ufsrestore rf - rm restoresymtable
  DUMP: Writing 32 Kilobyte records
  DUMP: Date of this level 0 dump: Wed Nov 06 19:29:39 2013
  DUMP: Date of last level 0 dump: the epoch
  DUMP: Dumping /dev/rdsk/c0t2d0s0 (radd6000:/) to standard output.
  DUMP: Mapping (Pass I) [regular files]
  DUMP: Mapping (Pass II) [directories]
  DUMP: Estimated 4014362 blocks (1960.14MB).
  DUMP: Dumping (Pass III) [directories]
NOTICE: alloc: /: file system full
/tmp/rstdir1383784179.pVaWma: No space left on device
abort? [yn] n
/tmp/rstdir1383784179.pVaWma: No space left on device
abort? [yn] n
/tmp/rstdir1383784179.pVaWma: No space left on device
abort? [yn]
0
 

Author Comment

by:TeknikDev
ID: 39629067
Would it be cleaner if we start from scratch again? Do you think using the usfrestore and usfdump method from the ground up would be better?

Unfortunately, I have to retire for tonight and be back on early AM. My kids are in need of daddy's time. LOL

SO please if you could provide solutions and I can follow tomororw. I will definately do so. I am happy because I'm making some lead way. Looks like the structure is screwed up from the original path we took. Thanks again guys!
0
 
LVL 76

Expert Comment

by:arnold
ID: 39629114
do not use the u option for ufsdump.
your ufsdum/ufsrestore might be writing to a / location

df -k
imho
cd /mnt
ufsdump 0f - /dev/dsk/c0t2d0s0 | ufsrestore xf -

your /tmp is likely where the space on / is being consumed.
0
 
LVL 76

Expert Comment

by:arnold
ID: 39629118
How about trying the metadevice way to once and for all transform the existing setup into a redundant setup with fault tolerance for disk failures.
note a partition of about 100MB max on each drive needed for storing meta state info.
0
 

Author Comment

by:TeknikDev
ID: 39629161
Hi Arnold, thanks for the suggestion but that sounds so confusing. Are you able to provide step by step instructions for me to accomplish this? I would be willing to give it a shot. :)

Now your suggestion about the usfdump without using the u option? Can you write it out as you want me to type it?  

Thanks again!
0
 
LVL 22

Expert Comment

by:blu
ID: 39629183
First, from the stuff you you had above, I think you just tried to backup c0t2d0s0 to itself. That's why you ran out of space. Since the mount failed you did not have anything moutned at /mnt so you essentially tried to copy  all of / to /mnt which is still part of /.  You need to do "cd /mnt" and then "ls". If it has anything in it, do a "mount" command to list the moutns and double check that there is nothing mounted at /mnt. If there is nothing mounted at /mnt and there are files under /mnt, then you need to delete them. Just do "cd /" and then, very carefully, run "rm -rf mnt". Double check the command before you hit return. Once that has completed, run "mkdir /mnt".

After that, you need to get the system booted up in single user mode from the old disk with the / and /usr filesystems mounted from the old disk. Once you are there and have verified that you have the old disk mounted, start the whole procedure I gave before, starting from the beginning of the steps and running through them just as I had them. First the prtvtoc, the newfs's, the mount/ufsdump/ufsrestore/umount (all three), the fsck's and editing the vfstab. Once you edit the vfstab, you should be able to boot normally from the new disk (i.e. boot disk1).
0
 
LVL 22

Expert Comment

by:blu
ID: 39629188
I may have been wrong about the backup. Either c0t0d0s0 was already mounted or you already had something mounted on /mnt. Depending on which it was you may have been writing to c0t0d0s0 or c0t2d0s0 but under /mnt. If it was c0t2d0s0 then you will need to do clear out the extra stuff under /mnt on c0t2d0s0. If it was c0t0d0s0, the files are there but in the wrong place, but that doesn't matter because the newfs command erases the whole slice.

It's kind of important that you do not keep going if you get an error at some stage. If you get an error then there is something different from what I expected and if you keep going you could make things worse. So, if you get an error, stop and post what happened here.
0
 

Author Comment

by:TeknikDev
ID: 39629204
Ok I think its all screwed up. Anyway we can start again Blu? I can do the dd command again or usfdump/restore. I can start in the am.

I rather do this first and then meta device what.arnold suggests last because it seems more complicated
0
 
LVL 76

Expert Comment

by:arnold
ID: 39629426
actually, it is fairly straight forward with the minor caveate that deals with updating the boot record to use the metadevice rather than a specific disk.

At this point, you need to look where the data is on /dev/dsk/c0t2d0s0 that causes the system to run out of space.

I think the reason your ufsdump is filling up /tmp, is because you are using the u option (update ufsdump record file in /etc/)
0
 
LVL 76

Assisted Solution

by:arnold
arnold earned 200 total points
ID: 39629456
TeknikDev, I believe I provided a step by step on configuring the two partitions that you have as single concat/slices without loosing the data for the purpose of setting up a single slice meta device metadevice.
make sure that c0t0d0 does not have a system on it. or this drive will be the base on which the system boots.

You need to make sure you have a 100MB slice (some use s7 for the metastate)
Do not create filesystems on these slices.
http://docs.oracle.com/cd/E19683-01/817-0708/6mgg6t7ir/index.html
metadb -a -f /dev/dsk/c0t2d0s7 /dev/dsk/c0t0d0s7
The above creates the meta state databases on the two slices.

Some prefer to attach disks directly to metadevices, some create individual concat slices which are then attached.  as times goes on, you'll decide which option is best for you.
The below will deal with creating concat slices rather than attaching disk (the difference now that I think about is simplicity.  easier to remember to attach d1x to d1 rather than c0t3d0s0 to

i.e. naming convention usually has
the raid volume as dx with the members that make up the raid as dxy
some use dx0 as the root RAID with dx1-9 as the member slices.
 
metainit -f d10 1 1 /dev/dsk/c0t2d0s0 (/ partition)
metainit d1 -m d10 (create a RAID 1 volume whose submirror is d10, in this state the RAID lacks redundancy)

repeating for the other slice

metainit -f d20 1 1 /dev/dsk/c0t2d0s6 (/usr)
metainit d2 -m d20

now you would edit the vfstab replacing /dev/dsk/c0t2d0s0 with /dev/md/dsk/d1
i.e. duplicate the line commenting the prior while modifying the second.  this is so that you can revert back if needed booting using DVD/CDrom/etc.

similarly for /usr
/dev/dsk/c0t2d0s6 with /dev/md/dsk/d2 note the dsk rdsk references in vfstab.

Search for "solstice-disksuite-guide" for a guide that may help you further understand.
refer to the V210 experts exchange link provided earlier.  That person was going from a metadevice configured system down to a single drive boot.
you may not need to change as it will look for the first active disk as your existing setup showed that t2 was booting the system.

cross finger, reboot

The system should come backup booting for disk2 reflecting the partitions as
d1 /
d2 /usr

at this point you would be adding the second drive
since we do not care about the data on /dev/dsk/c0t0d0sx
metainit d11 1 1 /dev/dsk/c0t0d0s0
metainit d21 1 1 /dev/dsk/c0t0d0s6
metattach d1 d11 (RAID 1 setup complete for /)
metastat -a # will reflect d1 as rebuilding with d11 as synchronizing xx% complete)
repeating for the other,
metattach d2 d21 (raid 1 for /usr) is complete
metastat -a # will reflect both d1 and d2 as rebuilding with d11 and d21 as synchronizing each with xx% complete)

if you are separating /home and other partitions and want to create them in a RAID group, you would repeat the prior for d3-x

note it is software RAID if you make many of these RAID volumes, an I/O intensive system mcidy see an impact on performance.

once this is complete, you may want to change the boot device from booting from the second disk to booting for the 0 disk which means the system will boot as long as a boot disk is present. 0, 1, 2, 3, etc.
0
 

Author Comment

by:TeknikDev
ID: 39629861
I'm going to start a new plan to attack this. Do I have to prepare the disk beside formatting the partition to match the source disk? I assume the ufs dump and dd command will overwrite the drive with whatever is on there.

Arnolds method:
1) start the ufsdump from scratch (as listed below in this posting).
2) Final solution is to do the meta device

blu method: these might be redundant since I already did it but I just want to make sure by excluding the bs number, it didnt throw it off and try to do #2 the right way, I have to pay close attention to the details...
1) dd command with bs defined
2) usf restore/dump method if it still doesnt boot

***********************************************************

Hi Arnold - I'm going back to your notes.

I am up to the "Mount each partition that you want to copy"

Could you provide exact syntax on how to mount the partition? I'm not sure if you mean from source or destination.
 
adding a drive hot, you would need to use devsadm to detect it or alternatively
touch /reconfigure
reboot
format

this will enumerate all the drives in the system.
partition the new drive as you see fit
then mount each partition thast you want to copy

Instead of using dd which is a low level and could take a long time, you could use
ufsdump 0f - /dev/dsk/c0t2d0s0 | ufsrestore -xf - /mnt_root_of_new_drive
ufsdump 0f - /dev/dsk/c0t2d0s6 | ufsrestore -xf - /mnt_usr_of_your_new_drive

note you need to modify the fstab
0
 
LVL 76

Expert Comment

by:arnold
ID: 39630624
ok.
starting with only /dev/dsk/c0t2d0sx mounted.
1) you partition the new drive /dev/dsk/c0t0d0 to match.
2)you now need to create a filesystem for ufsrestore since you can not mount a slice without a filesystem on it
3) create a filesystem and copy/clone data.
NOTE only proceed to the next line as long as there are no errors. i.e. if you run mount and get an error, let us know rather than proceeding to the next step.

newfs /dev/rdsk/c0t0d0s0 #create filesystem with default options
mount /dev/dsk/c0t0d0s0 /mnt
cd /mnt
ufsdump 0f - /dev/dsk/c0t2d0s0 | ufsrestore xf -
ls -la /mnt # to see the files are there
cd / #leave the /mnt partitions to allow unmounting
umount /mnt

newfs /dev/rdsk/c0t0d0s6 #create filesystem with default options
mount /dev/dsk/c0t0d0s6 /mnt
cd /mnt
ufsdump 0f - /dev/dsk/c0t2d0s6 | ufsrestore xf -

I think that should do it
0
 
LVL 22

Expert Comment

by:blu
ID: 39631600
We keep posting the same procedures over and over, but I can't tell if you have actually done them as posted or not.
0
 

Author Comment

by:TeknikDev
ID: 39631723
Thanks Arnold, will let you know the results when I get home. Also, I noticed for the s6 partition, you didn't unmount. Shouldn't I unmount after each paritions are mounted like for s0?

And s7 is missing. I'll follow the same steps as the other two partitions.


Blu - sorry man, just that its been difficult with all thats going on. I'll try to keep it cleaner so its easier to follow.
0
 

Author Comment

by:TeknikDev
ID: 39632350
Guys! I stuck to my plan and started from scratch again with the dd command and this time with block space defined. Believe it or not it didn't reboot and showed an actual finish message this time!

 # dd if=/dev/rdsk/c0t2d0s2 of=/dev/rdsk/c0t0d0s2 bs=128k
305298+1 records in
305298+1 records out

Anyways, I then started to follow Blu's advice from the oracle website (http://docs.oracle.com/cd/E19253-01/817-5093/6mkisoqni/index.html) and got up to step #10. This is where I was stuck, the instructions say

"Using a text editor, edit the destination disk's /etc/vfstab file to reference the correct device names. For example, change all instances of c0t3d0 to c0t1d0."

I open the /etc/vfstab with the vi editor using vi /etc/vfstab.
vi
I have no idea how to use vi-editor so will be reading up on it tonight, but my question is if i replace all the c0t2d0s* references with c0t0d0s*, what is the rdsk reference at the top? Where it says c1d0s2? Do I change that to something? I need to figure out exactly WHAT and HOW to edit the /etc/vfstab and save it. I think we are almost there!!!

Thoughts?!

Also, whats the command for shut down? I've been pulling out the powercord when I'm done. I'm assuming shut down.
0
 
LVL 22

Expert Comment

by:blu
ID: 39632451
Ignore the line that line. That line is commented out (see the "#"?).

Remember, you are editing /mnt/etc/vfstab.

Do this:

vi /mnt/etc/vfstab
:s/c0t2d0/c0t0d0/g
:w!
:q
0
 

Author Comment

by:TeknikDev
ID: 39632954
Ah ok - learning the syntax as I'm doing all this. Now it says pattern substitution failed.

That command say pattern string match not found.

How do I edit? I type i and none of the keys work correctly. I assume because I do not have the proper keyboard.
0
 
LVL 76

Expert Comment

by:arnold
ID: 39633202
Escape to return to read mode and to execute commands.
To run a command it must be in read mode and start with a colon (:)
w write
q quit


Editor operation mode changes with
i - insert mode where the courser is
o - start insert mode on new line below the current coups or location.
0
 
LVL 22

Expert Comment

by:blu
ID: 39633268
When you executed the vi command, did the screen display the contents of the vfstab file, or did it say "[New file]"?  If the latter, then perhaps you did not mount the new disk's root partition on /mnt. If the former, you need to look closely at the file and the string substitution, because based on vfstab image you posted, there is no way that the substitution would have failed.
0
 

Author Comment

by:TeknikDev
ID: 39633336
Thanks arnold, I'll try the write command when i get home.

Blu, I originally posted the new file message, but realized I had a typo in the command. When I type the actual path of vfstab, it showed all the listing correctly.

I typed for fstab and NOT vfstab.
0
 

Author Comment

by:TeknikDev
ID: 39635013
Guys -how do I save the changes in vi-editor?
0
 
LVL 76

Expert Comment

by:arnold
ID: 39635034
:w (when the file is opened)
:w! (when the file is opened and is read-only/no write permissions)
:q (to exit when changes were previously save or no changes were made)
:1! (to exit without saving change)
0
 

Author Comment

by:TeknikDev
ID: 39635039
Guys, very confused here. So after editing the vfstab file, and I was able to boot into the destination disk okay!!!  I'm almost done, there are 17 steps.

But then on step 15, it says to Unconfigure the destination disk. The system will shut down after it is unconfigured.

# sys-unconfig
unconfig
Then step 16: Boot from the destination disk again and provide its system information, such as host name, time zone, and so forth.

Do I really want to do this? When it booted up , it was loading from disk 0 okay like it was looking on the source original hard disk. I don't know what I should enter for system info that its referring to. Please advise!

Thanks!
0
 
LVL 76

Expert Comment

by:arnold
ID: 39635126
Sys-unconfig deals with resetting OS configuration (hostname,network, name/directory)

It does not alter drive/partition organization.

When it boots from disk0, does it reflect disk0 c0t0d0sx for the mounted martini ons in response to df -k?
0
 
LVL 22

Expert Comment

by:blu
ID: 39635138
The idea of the sys-unconfig is to get the disk configured for the new system before you move it, or at least to unconfigure the old system before you move it. It just wipes things like the timezone, the hostname/nodename, and forces the new system configure on the next reboot. If you install the disk in another system without first doing the sys-unconfig the new system will come up with the original systems nodename and IP address. If you are making a backup you might want this. If you are trying to make a new system a lot like the old system but with both up and running at the same time, you will want the sys-unconfig.
0
 

Author Comment

by:TeknikDev
ID: 39635148
Well the idea is that this new Hard drive will be placed into an identical Sun Fire machine. I want it to be like the old hard drive exactly.

So based on what Arnold's saying, the unconfiguration will only reset network/hostname/directory....my concern is that the network stuff I'm not familiar with and its going to be on the same network as the old hard disk. Here's the df -k info, how do I know if its mounted or not? It shows the destination disk which is great news.

df-k
Now blu, when you say back up as in creating a hard drive with the same exact information as the old? Yes, thats exactly what I want, the new hard drive will be the backup of the old disk. They will have the same sunfire model, hard disk model and network information.
So do I not resume this step and go to step 16 where it just boots from the disk 0 and see if it works?

boot disk0?

To be safe, I will wait for an answer from the both of you before I resume. What Arnold said about the mounted stuff makes me nervous.
0
 

Author Comment

by:TeknikDev
ID: 39635186
Actually, I did some googling and it appears that I would have to set the ip address, dns, host name , time zone, pc name and domain name stuff like that related to network and system information. I would want this to be the same as the source (old) hard drive so it seems like I do not need to do the sys-unconfig...guys, please confirm.

IF yes, is the next step is to boot drive0 to see if it works?

Should I pull the plug and remove the old drive and see if the single new hard disk will boot like the old?

Thanks in advance for the millionth time!!!!!!! :-)
0
 
LVL 76

Expert Comment

by:arnold
ID: 39635202
If you are creating the drive to create a functional clone of the existing system, then you do need to run sys-unconfig when this drive is used to boot the other machine.
During the bootup process, you would need to provide the hostname for the other system and an IP that is unique.

Your exciting system is hostname1, with IP x.x.x.3
The new system will be hostname2 with IP x.x.x.4
Make sure you check the network for a free IP.

Since you are in the learning process, I would have recommended you actual build the system from scratch.
pkginfo -a to list installed packages, etc.  if you have a system in testing/development on which you can ......

This excersise would show provide guidance on how to troubleshoot the functionality of the system and any application it has.
0
 

Author Comment

by:TeknikDev
ID: 39635213
Its actually not going to be both online at the same time. Only should one fail, just a replacement system.

Can I skip and boot up to see what happens? If I power off the sunfire can I run the same unconfigure command later?  

How do I power the system off so I can detach the old hd?
0
 
LVL 76

Expert Comment

by:arnold
ID: 39635243
How often are you planing on cloning the boot drive onto another.

IMHO, if the other system is just a chassis that will be used when this on fails, returning to what I said before. Setup/configure this system with as much redundancy as possible.
Only when a total hardware failure occurs, you will have an extended downtime which will last just as long as it takes you to pull the two drives that makeup the RAIDed metadevices and inserting them into their respective position in the other system.


Since I have no idea what this system does, I can not say whether it is possible to have both setup, configured, and run at the same time.
0
 

Author Comment

by:TeknikDev
ID: 39635660
Ok here's the latest update:

I detached the old hard drive and made the new hard drive the master and it failed to boot because the application on the old system was configured for the old harddrive, so it is looking for c0t2d0 but the new hard drive is c0t0d0.

But the good news is if I only keep the old hard drive at the same ide slot as a single hd, it boots up fine!!! This is excellent, but I need the old hard drive to become c0t2d0 and not c0t0d0 so I assume I edit the /etc/vfstab file by rebooting in single user mode and replacing all c0t0d0 with c0t2d0 and then moving the new hard drive to the main IDE slot and reboot. However, it didnt work.

Can blu or arnold tell me how I can change the NEW hard drive so that it becomes c0t2d0 and bootable?

Again right now, its c0t0d0. Thanks! If i get it to change, I will be in great shape and we are DONE!
0
 

Author Comment

by:TeknikDev
ID: 39635939
Alright, I figured out how to make the NEW hard drive change from c0t0d0 to c0t2d0. I had to change the jumper on the back of the hard disk to master.

Anyways, it booted up fine as c0t2d0 but I saw this error message. Can either of you tell what's going on?
msg
Looks like its referencing the c0t0d0 drive for savecore or dumpadm?
0
 
LVL 76

Expert Comment

by:arnold
ID: 39635967
Yes, your new drive's VFStab points to c0t0d0s1 as swap while it should point on the new device to c0t2d0s1.

The swap partition is also used for crashdump/core/kernel panic, etc. data collection/reporting handling.
Your VFSTAB should have no reference to c0t0d0 in any entry.


It might be simpler to reclone/copy/dd the c0t2d0s0 partition a new and be done with it.

i.e. only try booting the device after switching this disk from slave to master.
0
 
LVL 22

Expert Comment

by:blu
ID: 39635984
Use dumpadm to specify the new swap device as the dump partition, that will make the savecore and dumpadm messages go away. The message about logging is okay.
0
 

Author Closing Comment

by:TeknikDev
ID: 39636373
Blu and Arnold are what you call real gurus of their trade. They both provide me with extraordinary assistance throughout this process which I am grateful for. While they provided different solutions, I had faith that both were able to guide me to the right solution. I awarded blu with slightly more points because that was the advice that I ultimately was successful with, but they both know their stuff!
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Join & Write a Comment

First I will try to share a design of a Veeam Backup Infrastructure without Direct NFS Access backup. Note: Direct NFS Access backup transport mechanism is only available in Veeam v9 In above I try to design the Veeam Backup flow between i…
Create your own, high-performance VM backup appliance by installing NAKIVO Backup & Replication directly onto a Synology NAS!
This tutorial will walk an individual through locating and launching the BEUtility application and how to execute it on the appropriate database. Log onto the server running the Backup Exec database. In a larger environment, this would generally be …
This tutorial will walk an individual through the process of installing the necessary services and then configuring a Windows Server 2012 system as an iSCSI target. To install the necessary roles, go to Server Manager, and select Add Roles and Featu…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now