copy / partition with dd command

Posted on 2003-03-21
Medium Priority
Last Modified: 2013-12-27
It's been awhile since I've used dd, so I wanted some input; I'm planning on installing a new hard disk to my E250 server, using dd to dump the / partition to it, and then modifying vfstab, etc. and rebooting.  Does dd maintain permissions and ownership of files/devices, or do I need to run some command afterwards to restore them?  I vaguely remember being prompted with some type of permissions/ownership question last time I ran it, but this being the / partition and all, I want to be very sure before I do it.  Thanks
Question by:xjman251x
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

Accepted Solution

SumeshDaftary earned 1000 total points
ID: 8181769
Well, as you whow dd takes phsical backup so

you just say

# dd if=/dev/dsk/c0t0d0s0 of=/dev/rmt/0 (necessay output device)

Yes, dd keeps the all permission as it is.


Author Comment

ID: 8181883
Thank you very much.  That's all I needed to know; just wanted to be sure.

Expert Comment

ID: 8181920
dd will copy an entire image of the root partition, including partition tabel and boot block.  You may have a problem writing the partition tabel onto the new driver, first partition you new disk, make sure root slice (s0) is at least as large as the original, and then either (assuming new c0t1d0)
 dd if=/dev/rdsk/c0t0d0s0 of=/dev/rdsk/c0t1d0s0 skip=1 seek=1
 dd if=/dev/rdsk/c0t0d0s0 of=/dev/rdsk/c0t1d0s0 skip=1 seek=1 bs=8k
 /usr/sbin/installboot /usr/platform/`uname -`/lib/fs/ufs/bootblk /dev/rdsk/c0t1d0s0
The second option should be faster.  However after either of these, the copied filesystem must be fsck'ed
  fsck /dev/rdsk/c0t1d0s0
If the new partition is larger, grow the filesystem into it, using growfs (snaffled from ODS/SDS), or,
  devinfo -p /dev/rdsk/c0t1d0s0
The third from last value is the size in blocks of the partition, and then use mkfs_ufs to grow it,
  /usr/lib/fs/ufs/mkfs -G /dev/rdsk/c0t1d0s0 size-form-above


Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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…
Suggested Courses

752 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