Solved

Solaris block size & disk copy

Posted on 2000-03-19
4
577 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
reinstall 1 85
UNIX SCP 5 83
Unix Script: Loop over all days of a month 17 106
ORA-00972: identifier is too long from Unix but not from Windows in SQLPLUS 17 100
Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

808 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