Solved

Solaris block size & disk copy

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
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…
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.

707 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