Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dd command

Status
Not open for further replies.

bdssbrd

MIS
Oct 24, 2002
14
US
I am having a problem copying a hard drive. I need to create an image of a drive(D1) from Solaris. I cannot get root access to this drive. So here is what I did: I installed Solaris 8 on another drive (D2), moved the original drive to target 0 unit 1. I also hooked up a sun external drive cage with another drive(D3) in it (to copy to).

Now, when I go to open boot, and do a probe-scsi-all, I get responses from all 3 drives. However, when I go into the OS I can only see the new drive(D2). What am I doing wrong? I am hoping it is something simple. I am a rookie at unix, so please forgive me.

Rick
 
Rick, have you tried boot -r from the OK prompt. This should see your drives and make them available to the OS.
 
rick,

The disk is very well available in the machine.(according to you probe-scsi-all shows up).

Assumption :
1. you have booted from D2
2. you want to copy /usr from D1 to some dir in D2

since you are booting from one disk, all the partitions from these disks are mounted by default.(its from your /etc/vfstab).

your other disks will not show up unless you mount it.

say you have a partition called /usr (from which you want to copy the files) in your previous disk (d1) then mount that partition in your new disk (d2) in any of the mount points (eg: /olddisk/usr).

similarly you can mount the other disk also.

if you want to find the #'s in c#t#d#s# of your disk, use format command.

if you intend to select any specific partition only (/usr) then select the disk in the format command and give a verify. you will get the partitions of that disk.

hope this helps
 
Thanks, boot -r worked. I can now see my drives.

Problem number 2: when I type the dd command I am getting an error. Here is what I am entering:
dd if=c0t1d0 of=c1t4d0
I get a response back that c0t1d0 open: no such file or directory. I have tried putting /dev/ in front of it.

Is this sytax correct?

Thanks for the help
 
There are entries in both /dev/dsk and /dev/rdsk. When mounting a disk slice, you specify the one in /dev/dsk. When accessing the slice directly such as to back up the slice, use the entry in /dev/rdsk.

Also, c0t1d0 is not the full device name. You have to specify s2 as well:

Code:
dd if=/dev/rdsk/c0t1d0s2 of=/dev/rdsk/c0t4d0s2

HOWEVER, before you do this, you need to make sure that the source and destination disks are the same physical size, i.e. they have the same number of total sectors. If you're sure of this, you first want to output the partition table of the source disk and write it to the destination disk:

Code:
prtvtoc /dev/rdsk/c0t1d0s2 | fmthard -s - /dev/rdsk/c0t4d0s2

If you want the new disk to be bootable as well, you also want to do this to install the boot block:

Code:
installboot /usr/platform/`uname -m`/lib/fs/ufs/bootblk /dev/rdsk/c0t4d0s2

Dennis
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top