Cloned drive won't boot ?

Solaris system
version 6

I cloned the drive using the DD command.

Using the format command and examining the partitions, all looks the same as the original drive.

Problem:

When I attach the cloned drive as the master, and only drive in system, it will not boot.

Error messages:

Hostname bstdx-srvr
/sbin/swapadd: expr: not found
/sbin/swapadd: /usr/sbin/swap not found
Warning: /usr/sbin/fsck not found. Most likely the mount of USR failed or the /usr filesystem is badly damaged. The system is being halted. Either reinstall the system or boot with the -b option in an attempt to recover.
Syncing file systems...done
Program terminated
Ok>

When I tried the boot-b from the ok> prompt:

Init - cannot create /var/adm/utmp or /var/adm/vtmp
Init - single user mode

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

Any Advice to this Solaris newbie ? Thanks !! :confused:

can you give the syntax of the dd command that you used? maybe you've taken the wrong slice for cloning....

After the dd command you need to install the boot block also inorder for the new disk to boot corectly.

here is the DD command I used

First I booted to single usermode from CD rom

here is the dd command:

dd if=dev/dsk/c0t0d0s2 of=/dev/dsk/c0t1d0s2 bs=256k

here is more info after the cloning, when I stil had the original as master and the clone as slave:
*****************
Partion of the master drive

# prtvtoc /dev/dsk/c0t0d0s2

  • /dev/dsk/c0t0d0s2 partition map
    *
  • Dimensions:
  • 512 bytes/sector
    
  •  63 sectors/track
    
  •  16 tracks/cylinder
    
  • 1008 sectors/cylinder
  • 17662 cylinders
  • 17660 accessible cylinders
    *
  • Flags:
  • 1: unmountable
  • 10: read-only
    *
  • Unallocated space:
  •   First     Sector    Last
    
  •   Sector     Count    Sector
    
  • 17800272 1008 17801279
    *
  •                      First     Sector    Last
    
  • Partition Tag Flags Sector Count Sector Mount Directory
    0 2 00 0 2048256 2048255 /
    1 3 01 2048256 2048256 4096511
    2 5 00 0 17801280 17801279
    5 4 00 4096512 2048256 6144767 /usr
    6 0 00 6144768 11655504 17800271 /opt
    #
    #

Partition of the cloned slave drive

# prtvtoc /dev/dsk/c0t1d0s2

  • /dev/dsk/c0t1d0s2 partition map
    *
  • Dimensions:
  • 512 bytes/sector
    
  •  63 sectors/track
    
  •  16 tracks/cylinder
    
  • 1008 sectors/cylinder
  • 17662 cylinders
  • 17660 accessible cylinders
    *
  • Flags:
  • 1: unmountable
  • 10: read-only
    *
  • Unallocated space:
  •   First     Sector    Last
    
  •   Sector     Count    Sector
    
  • 17800272 1008 17801279
    *
  •                      First     Sector    Last
    
  • Partition Tag Flags Sector Count Sector Mount Directory
    0 2 00 0 2048256 2048255 /usr/local
    1 3 01 2048256 2048256 4096511
    2 5 00 0 17801280 17801279
    5 4 00 4096512 2048256 6144767
    6 0 00 6144768 11655504 17800271

#
#
# format
Searching for disks...done

AVAILABLE DISK SELECTIONS:
0. c0t0d0 <ST39140A cyl 17660 alt 2 hd 16 sec 63>
/pci@1f,0/pci@1,1/ide@3/dad@0,0
1. c0t1d0 <ST39140A cyl 17660 alt 2 hd 16 sec 63>
/pci@1f,0/pci@1,1/ide@3/dad@1,0
Specify disk (enter its number): 0
selecting c0t0d0
No defect list found
[disk formatted, no defect list found]
Warning: Current Disk has mounted partitions.

FORMAT MENU:
disk - select a disk
type - select (define) a disk type
partition - select (define) a partition table
current - describe the current disk
format - format and analyze the disk
repair - repair a defective sector
show - translate a disk address
label - write label to the disk
analyze - surface analysis
defect - defect list management
backup - search for backup labels
verify - read and display labels
save - save new disk/partition definitions
volname - set 8-character volume name
!<cmd> - execute <cmd>, then return
quit
format> partition

PARTITION MENU:
0 - change `0' partition
1 - change `1' partition
2 - change `2' partition
3 - change `3' partition
4 - change `4' partition
5 - change `5' partition
6 - change `6' partition
7 - change `7' partition
select - select a predefined table
modify - modify a predefined partition table
name - name the current table
print - display the current table
label - write partition map and label to the disk
!<cmd> - execute <cmd>, then return
quit
partition> print
Current partition table (original):
Total disk cylinders available: 17660 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks
0 root wm 0 - 2031 1000.12MB (2032/0/0) 2048256
1 swap wu 2032 - 4063 1000.12MB (2032/0/0) 2048256
2 backup wm 0 - 17659 8.49GB (17660/0/0) 17801280
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 usr wm 4064 - 6095 1000.12MB (2032/0/0) 2048256
6 unassigned wm 6096 - 17658 5.56GB (11563/0/0) 11655504
7 unassigned wm 0 0 (0/0/0) 0

partition> qu

FORMAT MENU:
disk - select a disk
type - select (define) a disk type
partition - select (define) a partition table
current - describe the current disk
format - format and analyze the disk
repair - repair a defective sector
show - translate a disk address
label - write label to the disk
analyze - surface analysis
defect - defect list management
backup - search for backup labels
verify - read and display labels
save - save new disk/partition definitions
volname - set 8-character volume name
!<cmd> - execute <cmd>, then return
quit
format> qu
# format
Searching for disks...done

AVAILABLE DISK SELECTIONS:
0. c0t0d0 <ST39140A cyl 17660 alt 2 hd 16 sec 63>
/pci@1f,0/pci@1,1/ide@3/dad@0,0
1. c0t1d0 <ST39140A cyl 17660 alt 2 hd 16 sec 63>
/pci@1f,0/pci@1,1/ide@3/dad@1,0
Specify disk (enter its number): 1
selecting c0t1d0
No defect list found
[disk formatted, no defect list found]
Warning: Current Disk has mounted partitions.

FORMAT MENU:
disk - select a disk
type - select (define) a disk type
partition - select (define) a partition table
current - describe the current disk
format - format and analyze the disk
repair - repair a defective sector
show - translate a disk address
label - write label to the disk
analyze - surface analysis
defect - defect list management
backup - search for backup labels
verify - read and display labels
save - save new disk/partition definitions
volname - set 8-character volume name
!<cmd> - execute <cmd>, then return
quit
format> parti

PARTITION MENU:
0 - change `0' partition
1 - change `1' partition
2 - change `2' partition
3 - change `3' partition
4 - change `4' partition
5 - change `5' partition
6 - change `6' partition
7 - change `7' partition
select - select a predefined table
modify - modify a predefined partition table
name - name the current table
print - display the current table
label - write partition map and label to the disk
!<cmd> - execute <cmd>, then return
quit
partition> pri
Current partition table (original):
Total disk cylinders available: 17660 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks
0 root wm 0 - 2031 1000.12MB (2032/0/0) 2048256
1 swap wu 2032 - 4063 1000.12MB (2032/0/0) 2048256
2 backup wm 0 - 17659 8.49GB (17660/0/0) 17801280
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 usr wm 4064 - 6095 1000.12MB (2032/0/0) 2048256
6 unassigned wm 6096 - 17658 5.56GB (11563/0/0) 11655504
7 unassigned wm 0 0 (0/0/0) 0

I'll do a search, but after cloning, how do I reinstall the "boot block".....?

Thanks for the help and advice....

Hi,
I do this the last time before Solaris 9, because normal I prefer to use the flash feature!
It is very simple to use!

But as hint and as example:

installboot /usr/platform/sun4u/lib/fs/ufs/bootblk /dev/rdsk/c0t1d0s0

best regards joerg

Thanks....
here is what I tried, it was unsuccessful:

This is a SUN Ultra-10 system

installboot /usr/platform/SUNW,Ultra-5_10/lib/fs/ufs/bootblk /dev/rdsk/c0t1d0s0

the command appeared to go fine.
Ran fsck, did not find any problems on the clone disk first partition.

Next I mounted the cloned disk by itself as master, and rebooted - >

Result: still get the failure to boot completely, and get the same error messages...

Hostname bstdx-srvr
/sbin/swapadd: expr: not found
/sbin/swapadd: /usr/sbin/swap not found
Warning: /usr/sbin/fsck not found. Most likely the mount of USR failed or the /usr filesystem is badly damaged. The system is being halted. Either reinstall the system or boot with the -b option in an attempt to recover.
Syncing file systems...done
Program terminated
Ok>

When I tried the boot-b from the ok> prompt:

Init - cannot create /var/adm/utmp or /var/adm/utmpx
Init - single user mode

Only one think I mention is that I used the the rdsk path for the dd command (use a bigger blk size it is mutch faster!!!) and that there was a / failed inside your command (maybe only a typing error)

joerg

Your problem is not the boot block!
The main problem is the faulty /usr partition.

So you have only two possibility's the first is to boot from cdrom/net inside the singel user mode
OK: boot cdrom -s (With solaris cdrom)
or
OK: boot net -s (if you have a boot server)

The second is to boot with the old master disk and the new disk on the seconded ide port.

then try the fsck command:
fsck -Y /dev/dsk/c0t1d0s5

Please send us the output of this test!

best regards
joerg

Joerg,
Thanks for the help.

I finally got this working, thanks for the advice.
here is what I did, after booting boot cdrom -s :

1) I re-did the DD clone command, using this format:

dd if=/dev/rdsk/c0t0d0s2 of=/dev/rdsk/c0t1d0s2 bs=4096

result:
2225160 + 0 records in
2225160+0 records out

2) then ran fsck on the cloned drive
results:
c0t1d0s0 .1% frag
c0t1d0s5 .2% frag
c0t1d0s6 cannot seek blk 11620448
cannot read blk 11620488
cannot seek blk 11620448
following sectors cannot be read 11620488 11620449 11620450

3) I then connected the clone drive as the only drive in the Ultra-10, as master IDE drive, tried to boot from disk.

eror messages:
checking ufs filesystems
/dev/rdsk/c0t1d0s0: no such device or address
Cannot open /dev/rdsk/c0t1d0s0
/dev/rdsk/c0t1d0s0 : can't check file system
/dev/rdsk/c0t1d0s0: unexpected consistency; run fsck manually
WARNING: unable to repair one or more of the following filesystems
/dev/rdsk/c0t0d0s6 /dev/rdsk/c0t1d0s0
Run fsck manually (fsck filesystem...)

4) Next - I suspected that the original system had 2 hard drives in it, and that trying to run the cloned master drive without the 2nd slave frive was causing this problem. I attached the original 2nd slave drive, and then the cloned master drive now boots OK.

Thank You for the help and advice.
!!!