How can I set data compression in Solaris 9?

We have a SunFire V480 server running Solaris 9 (36GB HD) that has a external HP SureStore DAT tape drive attached.  The tape drive is DDS4; native 20GB capacity with 40GB compressed. We have exceeded the 20GB capacity.  

How can I set the data compression so I will be able to use all of the tape drive capacity?
I was told to change "/dev/rmt/1n" (1n is what we use now) to "/dev/rmt/1un" (ultra) but that did not work.  

Your help will be greatly appreciated!
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Didn't work or didn't give you any compression? What backup utility are you using?

As I understand it the un (ultra compressed) and cn (compressed) devices are identical but try with /dev/rmt/1cbn just in case.

Check that your tape device is featured in the tape device config file /kernel/drv/st.conf. If the device is being picked up correctly then device type should show up in the /var/adm/messages file - and indeed if you call 'mt -f /dev/rmt/1cn status'.

Finally is there a significant amount of compressed data on the drive you are backing up (.Z, .zip etc. files)? If the data on disk is largely compressed (database_dumps.Z etc) then you won't get an awful lot of compression on the tape.



Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial

n = not rewint

c = compression
if you tape driver support compress (hardware compress) than you can use /dev/rmt/1nc as the above comments.

if you don't have a tape device with that capability you can, use "usfdump + compress + dd" to do the backup :


ufsdump 0f - /fs | compress | dd of=/dev/rmt/1n obs=20480

And the corresponding rstores would look like:
dd if=/dev/rmt/1n | compress -d | ufsrestore -

use GNU tar with -z (compess option) to do the job, you can download GUN tar from:
use GNU tar:
If you used Gnu tar to back up whatever in mydir the with something like:

cd /path-to/mydir
tar cvzf /dev/rmt/1n .

then you would restore the data with:

cd /path-to/mydir
tar xvzpf /dev/rmt/1n

Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

The /dev/rmt/1cbn device should do the job, but if you require any compressed files to be made smaller, I'd suggest getting a copy of gzip from and using that to compress your files. HTH.
dee43Author Commented:

dev/rmt/1cbn worked!  BTW, we are using ufsdump to do our backups. What does the "b" stand for and will I have to decompress files when I do a restore (ufsrestore)?

b stands for Berkeley-style device, leaving it off reverts to At&T-style as explained here:

When a file open for reading only is closed and the no-rewind bit is not set, the tape is rewound.  If the no-rewind bit is set, the behavior depends on the style mode.  For AT&T-style devices, the tape is positioned after the EOF following the data just read.  For Berkeley-style devices, the tape is not repositioned in any way.

You can leave the b off and it should still work. Some backup systems, like Legato, require the b option since they use record rather than file level repositioning.

Under normal circumstances the two modes seem pretty interchangable unless the application specifies otherwise.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Unix OS

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.