Cloning Solaris 10 perdicament

Hello and let me say at first, thank you for viewing this problem I have.

From the top!

Where I work, we have a Dell PowerEdge T300 X86 system running Solaris 10 8/07 s10x_u4wos_12b X86, and we realized, if this machine went down, we would be in trouble. So to fix that situation, I took it upon myself to remove the second drive (with the machine off, of course) from this server, which has a SAS, 2 drives, in RAID 1, and each at 147GB. I attached a 500GB Western Digital to available SATA port and booted up a copy of gparted (live cd) and was able to, at the CLI use the dd command. Here is the command I use:

dd if=/dev/sda of=/dev/sdb bs=32M

sda was the one lone sole drive remaining on the PCI-E SAS controller and also the SATA drive on the SATA port from the motherboard. I was sure this was the corrected device assignments because I ran "fdisk -l" prior to the cloning. The /dev/sda has the Solaris partition and the 500Gb had no partitioning at that point. In about 45 minutes, the process stopped and I moved the copied drive over to another Dell T300 we have, which is not in use, and I plugged the drive up and as expected, the GRUB menu loads and I get this:

Solaris 10 8/07 s10x_u4wos_12b X86
Solaris failsafe

When I press enter on the first selection, the machine hard drive activity runs a little and in 10 seconds, the machine reboots. Now, if I go for the Solaris failsafe, the machine will boot up and I get this:

SunOS Release 5.10 Version Generic_118855-33 32-bit
(other stuff related to no network connection)
Solaris 10 8/07 s10x_u4wos_12b X86 was found on /dev/dsk/c0d0s0.
Do you wish to have it mounted read-write on /a? [y,n,?]s:

I notice the disk is being listed as a IDE device now, due to the /dev/dsk/c0d0s0. Is my assumption correct?

Here is my current vfstab:

#device  device   mount  FS fsck mount  mount
#to mount       to fsck   point  type pass at boot  options
#
fd - /dev/fd fd  - no -
/proc - /proc proc  - no -
/dev/dsk/c0t0d0s1 -  - swap - no -
/dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0  / ufs 1  no
-
/dev/dsk/c0t0d0s6 /dev/rdsk/c0t0d0s6  /usr ufs 1  no
-
/dev/dsk/c0t0d0s4 /dev/rdsk/c0t0d0s4  /var ufs 1  no
-
/dev/dsk/c0t0d0s5 /dev/rdsk/c0t0d0s5  /tmp ufs 2  yes
-
/devices - /devices  devfs - no -
ctfs - /system/contract  ctfs - no -
objfs - /system/object objfs  - no -

Here is my partition table if it helps:

Total disk cylinders available: 17747 + 2 (reserved cylinders)
Part Tag Flag Cylinders  Size  Blocks
0 root wm 1021 - 1275  1.95GB  (255/0/0)   4096575
1 swap wu 1 - 1020  7.81GB  (1020/0/0)  16386300
2 backup wm 0 - 17746  135.95GB (17747/0/0) 285105555
3 unassigned wm 0   0  (0/0/0)  0
4 var wm 1276 - 1785  3.91GB  (510/0/0)   8193150
5 unassigned wm 1786 - 1849  502.03MB (64/0/0)    1028160
6 usr wm 1850 - 17746  121.78GB (15897/0/0) 255385305
7 unassigned wm 0    0  (0/0/0)     0
8 boot wu 0 -     0  7.84MB  (1/0/0)     16065
9 unassigned wm 0   0  (0/0/0)     0

I will assume that there is some misdirection going on here and the system can't find the previous SCSI drive and the SATA drive isn't taking the form of the previous. In the Dell T300 BIOS, there is no AHCI, only ATA, so that's why it's IDE.

What I need to know, has this thing been a no go from the start or can I correct the needed entries in the vfstab and just to let you know, that the block device cmdk@0,0 does not exist in the /devices/pci@0,0/pci-ide@1f,2/ide@0/ on the original configuration, only sd@0,0 sd@0,0:q sd@1,0 and sd@1,0:q . Also no c0d0s0 in /dev/dsk or /dev/rdsk.

If you can help in giving some information, I would be appreciated.

Thank you

-nitrolinux

Cloning can be quite a complicated job.

I suggest that you read this thread as it may prove beneficial.

As they say, "here's one I made earlier".....

Do post your thoughts after this; I'm sure there are people on Unix.com who can help. As I say in the thread above, my expertise is SPARC not x86. However, I recommend you read this first and hope it helps.

Hello, I am finally back with the results of what has happened and the
things that I have done to successfully clone a Solaris 10 8/07
s10x_u4wos_12b X86 system.

Thank you hicksd8 for you help and I am sorry I haven't told you sooner. Let
me say quickly, you were the final key in completing this task for me. The
magic command:

devfsadm -r /a -p /a/etc/path_to_inst

That you suggested in a previous post:

<NOT ALLOWED TO POST URL>

Is what ultimately fixed my problem.....Thank you, but it didn't fix it
initially.

So not to bore anybody with gruesome details here is the back story.

We have a server running Solaris (you already know the version) and we
realized that we would be in trouble if we ever lost this machine.
So I spoke up and said that I believe that this machine could be cloned if
we would stick with the same hardware, and we did. We purchased another Dell
T300 PowerEdge. The only difference was the the production machine that we
are running has a SAS Raid card in it with two 146GB SAS Hard Drives. I
still believed it could be done. Until now, I didn't realize what kind of
challenge it would present to me. I have been laboring over this for about
two weeks now. Until today, I finally made progress. Remember, I was going
from a Raid 1 SAS system to a simple 500GB SATA drive.

I booted up a copy of GPARTED, a live image of Linux and cloned one of the
drives in the production system to a new 500GB SATA drive with the dd command.
That went good...so I thought. With ignorance, and not knowing nothing about
Solaris, assuming it was like Linux, I booted it up, the cloned image, and
there was the GRUB screen I have seen many times over. Since I am a 15
year old Linux user. I can still remember LILO. Well, with a giddy laugh, I
press enter on the first entry, the non-failsafe one, and attempted to boot
Solaris 10 up. A FAIL scene meant for Youtube. That's when I had to take
a crash course on Solaris 10. I learned quickly that there were conflicts
from the previous config to the one I was trying to implement. The long
journey began and many google searches and other post relating to this task.

I finally learned that once you clone a system, there were files on the system
that played a huge part in telling the Kernel where the system lived. This is
where I spent a lot of time in failsafe mode!

For example:

vfstab file in the /etc directory

With much laboring, more in re-learning how to use vi, I had to learn a
command to make vi work properly:

TERM=vt100
export TERM

Once vi was usable, I edited the vfstab to match the current drive.
Instead of /dev/dsk/c0t0ds0 I went to /dev/dsk/c0d0s0, and so on.

Try to reboot. No go!

Then I did some more googling and I ran into a post talking about the
/etc/path_to_inst file. Try to rename and rebuild. Did not work.

Then I began to fork off and began to start coming up with theories and
started to think that the capacity of the drive was effecting the booting
of the system??????? Yeah, I know. Although, this was not the case, this did
allow me to claim the full capacity of the drive which was 500GB. That's when
I became acquainted with the 'format' command and doing a new partition that
used the complete drive. Prior to the creation of the new partition, I
took note of the current layout by accessing the 'partition' command and 'print'
command, giving me the list of all the "slices/partitions" setup on the
system. I partition the drive just like the original setup, using the same
number of cylinders for each partition, which on this drive was about double
the size of the original capacity. Especially for the /usr slice. Once
finished with that I use the 'label' command to write partition map and label
the disk. Once that was done, I mounted all the partitions on newly created
folders in the /tmp folder. As such:

mkdir -p /tmp/new/root

Then I:

mount /dev/dsk/c0d0s0 /tmp/new/root

and so on ...

Then I began to copy data over from partition to partition by creating
mount points in the /tmp folder for the old drive:

mkdir -p /tmp/old/root

Then I:

mount /dev/dsk/c0d0s0 /tmp/old/root

and so on ...

Here is the original command I used to copy.

tar cf - * | ( cd /target; tar xfp -)

Seemed to work, but I don't think this is or was superior to this command:

ufsdump 0f - / | ( cd /mnt ;ufsrestore xvf - )

Matter-of-fact, the above command came from a site that ultimately put me
on the right path in getting this fixed. What you read in this explanation
is the exact way you should to do. So I wont retype those steps. Here
is the site:

<NOT ALLOWED TO POST URL>

Thank you sir!

Once I did what I would call a thorough transfer of the data to all the
partitions(/ , /usr , /opt, /var , /tmp), then I install Grub back to the
MBR:

installgrub -fm /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c0d0s0

I then adjusted the /etc/vfstab to reflect the drive changes. Try to boot.
No Go! More research ensued, and then I got cued in on a config file in
/boot/solaris called: 'bootenv.rc' Within this file is a line that
contains boot information:

bootpath='/pci@0,0/pci-ide@1f,2/ide@0/cmdk@0,0:a'

I had to modify this line to fit my setup. Again, this is a ATA setup.
That's how the BIOS of this machine identifies the drive in this
server. As a IDE drive, thus 'cmdk@0,0:a"

Try to boot the machine, and my first taste of success. But an error occurred.

It could not mount the /usr directory. It wanted me to put in the root
password for System Maintenance. Unfortunately, we don't know the root
password, because this is a closed system, administered by a group
that we are under contract with. After rebooting back into failsafe, I
began to inspect items such as the vfstab, bootenv.rc, and looking at
the partition table again. I then navigated over to /a/dev/dsk area and
after running the simple command:

ls -l c0d0s0

It returned:

c0d0s0: No Such file or directory

Wow, how did I miss that? Well, with that said, I did
as suggested by hicksd8:

rm -f /a/dev/rdsk/c*
rm -f /a/dev/dsk/c*
rm -f /a/dev/cfg/c*
devfsadm -r /a -p /a/etc/path_to_inst

It booted! A perfect clone of the previous system. I inspected the
/etc/path_to_inst file and I noticed the entries added:

"/pci@0,0/pci-ide@1f,2" 0 "pci-ide"
"/pci@0,0/pci-ide@1f,2/ide@0" 0 "ata"
"/pci@0,0/pci-ide@1f,2/ide@0/cmdk@0,0" 0 "cmdk"

Maybe one day, I sit down and write out a more step-by-step document,
but this is how it worked for me.

Thank you!

-nitrolinux

1 Like

@nitrolinux.......thank you too for providing such great details on the solution. This is what a great forum is all about. I'm sure that your post will be very useful to future readers.

That's quite a "training course" you've been on!

Good work and thanks for the writeup.

Thanks guys too! Maybe I can get enough post in so I can post the URLS that I needed to. I would be important to other readers.

-nitrolinux