Solved

Solaris block size & disk copy

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
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 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…
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.

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now