Here's an example of mounting and umounting a slice on the backup hard drive. In this example, a configuration file and a home directory will be recovered. I'm copying both items to /tmp on the active disk to review.
Assume active disk is /dev/dsk/c0t0d0s0
#cd /
#mount /dev/dsk/c0t1d0s0 /mnt
#cp -p /mnt/etc/someconfig.cfg /tmp
#mkdir /a
#mount /dev/dsk/c0t1d0s6 /a
#cp -pr /a/USERS/esofthub /tmp
#umount /mnt
#umount /a
#rmdir /a
#cd /tmp
This blog covers Unix system administration HOWTO tips for using inline for loops, find command, Unix scripting, configuration, SQL, various Unix-based tools, and command line interface syntax. The Unix OS supports tasks such as running hardware, device drivers, peripherals and third party applications. Share tips/comments. Read the comments. But most importantly: Read Disclaimer - Read Disclaimer.
Subscribe to:
Post Comments (Atom)
2 comments:
Tip:
While `cp -p` will preserve permissions, sparse files, symbollic and hard links will be handled incorrectly. Because of this, it is recommended to use the following to copy large amounts of data from one slice (or disk) to another:
mkdir /mnt/src/
mkdir /mnt/dst/
mount -F ufs -o ro.largefiles /dev/dsk/c#t#d#s# /mnt/src
mount -F ufs -o rw,largefiles,logging /dev/dsk/c#t#d#s# /mnt/dst
cd /mnt/src/
( find . -depth -print | cpio -pvdmu /mnt/dst/ > /tmp/cpio.log ) 2> /tmp/cpio.err
cd
umount /mnt/dst
umount /mnt/src
rm -rf /mnt/src /mnt/dst
And while the above example will also not handle sparse files correctly, as far as I know, short of Joerg Schilling's `star` or perhaps `gtar`, there is really no tool on Solaris that does know how to handle those files; and `gtar` is only recommended for sparse files as the last resort, as he also does not copy them 1:1.
As always, thanks for the tip ux-admin.
Post a Comment