Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3979
  • Last Modified:

copy / partition with dd command

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
0
xjman251x
Asked:
xjman251x
1 Solution
 
SumeshDaftaryCommented:
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.

0
 
xjman251xAuthor Commented:
Thank you very much.  That's all I needed to know; just wanted to be sure.
0
 
ecwCommented:
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
or
 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


0

Featured Post

Technology Partners: 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!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now