dd - imaging drives. Oh boy!

Hello,

Yes, it's me again. Running around getting this done! My current problem is I'm trying to image one drive 0 (/dev/dsk/c1t0d0s0) to drive 1 (/dev/dsk/c1t1d0s0). I know that drive1 came out of a Sun Server and it is a Sun drive. Solaris 10 recognized drive1 after the devfsadm command. The commands "dd" and "mount" both react the same.

# mount /dev/dsk/c1t1d0s0 /a
mount: I/O error
mount: Cannot mount /dev/dsk/c1t1d0s0
 
# dd if=/dev/rdsk/c1t0d0s0 bs=1024 of=/dev/rdsk/c1t1d0s0
dd: /dev/rdsk/c1t1d0s0: open: I/O error
 
I attempted to prepare a list of answers to possible questions:
 
# echo | format
Searching for disks...done

AVAILABLE DISK SELECTIONS:
       0. c1t0d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>
          /pci@1c,600000/scsi@2/sd@0,0
       1. c1t1d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>
          /pci@1c,600000/scsi@2/sd@1,0
Specify disk (enter its number): Specify disk (enter its number):

# df -k | grep c1t1d0
#

 
 

AVAILABLE DISK SELECTIONS:
       0. c1t0d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>
          /pci@1c,600000/scsi@2/sd@0,0
       1. c1t1d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>
          /pci@1c,600000/scsi@2/sd@1,0
Specify disk (enter its number): 1
selecting c1t1d0
[disk formatted]
 
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
        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
        inquiry    - show vendor, product and revision
        volname    - set 8-character volume name
        !<cmd>     - execute <cmd>, then return
        quit
format> format> label
Ready to label disk, continue? y
format> save
Saving new disk and partition definitions
Enter file name["./format.dat"]:
format> quit

Thank you in advance. I love the community here. :slight_smile:

c1t0d0s0 isn't a drive but a slice (i.e. partition).
Have you copied the label from the source to the destination drive (prtvtoc/fmthard) ?
Why are you using dd and not ufsdump/ufsrestore if your goal is really to copy a file system as it seems ?

Normally on a Sun drive slice 2 is the whole disk. Did you use the wm subcommand to make the disk writeable and mountable? What is the output from the print subcommand?

First of all, the purpose of using "dd" is to completely image the drive, directly from one to another without the use of single user mode or an interim media.

Thanks to jlliagre, I was able to make it mountable. I'm currently waiting on the dd command to finish up. It's been running for awhile. What time should I expect on an otherwise idle server?

dd stays at about .27% of use. Not too much of a variant.

Sidebar: I plan on using ufsdump/restore in the future when I have an interim media (SAN) to store the fssnap's and when there's a need for incremental backups. I heard there's a way to do it in single-user mode to do it using stdout and two commands seperated with a semicolon. Is it as simple as that?

With a 72G disk, typically a dd of the disk in single user mode would only take 10-15 minutes.

What do you mean without single user mode ? Is the source drive mounted and in use ?

That obviously depends on the disk size and the i/o performance.

??

Ufsdum can do full backups.

Likely.

I solved my problem. Just gave it some time.

Yes. The source drive is indeed mounted and in use. As it was the acting operating system.

It was about 1-2 hours on a V210 with 2Gb of RAM and 4g swap.

That was Total Percentage of processor consumption based on the application "top"

Yes I know. But after this image, I would need only incredmental backups.

Thanks for all of your help and I hope that this assists others in the future.

-Adel

Running dd from a device containing a mounted filesystem is absolutely unreliable, i.e. will likely lead to a corrupted destination filesystem.

I know and agree. It was a proof of concept.