?
Solved

Solaris block size & disk copy

Posted on 2000-03-19
4
Medium Priority
?
590 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 40

Accepted Solution

by:
jlevie earned 200 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
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.
Suggested Courses
Course of the Month15 days, 6 hours left to enroll

770 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