Solved

Solaris block size & disk copy

Posted on 2000-03-19
4
575 Views
Last Modified: 2013-12-21
I have a Sparc 2 with Solaris 2.5 and 2 4gb drives.  I need to replace a 4gb drive with a 9gb drive.  Assuming the old and the new drives are online, what is the best method for copying the data from drive to drive?  I heard about "dd", but not sure about the parameters.  How can I tell what by blocksizes are on the drives?  What about "cp -r" or "tar".
Thanks
Jak
0
Comment
Question by:j_k
  • 2
  • 2
4 Comments
 
LVL 40

Accepted Solution

by:
jlevie earned 50 total points
ID: 2633483
Once you've gotten the new disk up and a filesystem made on the drive, the best method of transferring the data is with ufsdump/usfrestore. As an illustration, assume that the existing 4Gb drive has one filesystem on it and it's mounted on /disk1, and the new drive has one filesystem and is /dev/dsk/c0t4d0s0. The process looks like:

root> mount /dev/dsk/c0t4d0s0 /mnt
root> cd /mnt
root> ufsdump 0f - /disk1 | ufsrestore rf -
root> rm restoresymtable
root> cd /
root> umount /mnt

That sequence copied everything from /disk1 to the new drive. You can then shut the system down, reboot to single user mode and change /etc/vfstab to mount the new drive at the same place in the filesystem the old drive was.

Now, if there's more than one filesystem on the 4Gb drive, you'd need additional partitions/filesystems on the 9Gb drive and you'd repeat the process for each filesystem, changing the slice number and source filesystem accordingly.
0
 

Author Comment

by:j_k
ID: 2636083
ok, I understand this.  Curosity, what led you to use ufsdump/ufsrestore than the other tools i've seen floating around, like dd & tar?
jak
0
 
LVL 40

Expert Comment

by:jlevie
ID: 2636467
You can only use dd if the input and output devices are identical. They have to have exactly the same number of disk blocks, which pretty much means that they have to both be the same make/model. That's because dd just does a block for block copy.

Tar is useful for a lot of things, but it won't necessarily copy everything. In particular it can't deal with special files like fifo's or named pipes and may have problems restoring sparse files. For those reasons you don't want to do system backups with tar... If disaster strikes and you have to restore a system disk, the result from a tar restore won't run because all of the special files (/dev & others) won't be restored.

Every Unix vendor provides a filesystem dump/restore utility that can correctly deal with their filesystem. Sun's implementation is ufsdump/ufsrestore and it's the recommended tool for backups, or in this case, combination backup from one device and a restore to another. You can use cpio to do it also, but getting the options just right is a pain.

You might want to peruse the manpages for dd, tar, cpio and ufsdump/ufsrestore.
0
 

Author Comment

by:j_k
ID: 2636486
Thank you
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question