Security Consulting
  Unix Administration     Firewall     Intrusion Detection     Network Security     Hacking     MORE     HOME    

Solaris Harddisk

Adding a second Harddisk

I just added a second harddisk to a SUN. The following had to be done to get it working:
  • Change the SCSI ID on the drive
  • start Solaris and run devfsadm to create the devices in /dev
  • use
    prtvtoc /dev/rdsk/c0t3d0s0
    to see the partition table of disk one and
    prvtvtoc /dev/rdsk/c0t1d0s0
    for disk two.

    Copying a Harddisk

    c0t3d0 is the source
    c0t1d0 is the target
    The fast way would be to:
      dd if=/dev/rdsk/c0t3d0s2 of=/dev/rdsk/c0t1d0s2 bs=10000k obs=10000k ibs=10000k
    Remember that partition 2 (s2) is the backup partition spanning the entire harddrive.

    For more manually oriented people, go with the following approach:
      format
      0 (for c0t1d0)
      part
      {0,1,3,4,5,6,7} change sizes (it's all in cylinders!!)
      print	(show table)
      label 	(write to disk)
      q
      q
      
    Things to note: Partition 2 is the backup partition, don't do anything to it!
    Partition 1 is normally swap (don't put a filesystem on it!)
    Use either dd to copy:
      dd if=/dev/rdsk/c0t3d0s0 of=/dev/rdsk/c0t1d0s0 bs=1000k obs=1000k ibs=1000k
    Or you can go via ufsdump 0f - /dev/rdsk/c0 ... | (cd /root2; ufsrestore xf -) and creating mountpoints, ... See here for instructions on this.

    The version with dd worked very well for me. Don't bother dd-ing partition 2 and don't bother about anything else like mountpoints, ... that is all dd-ed with the rest!


    CopyLeft (l) 2003 by Raffael Marty