Solaris / OpenSolarisThis forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Sure there is an eom, but no way to directly get how much space there is from some point to the end of tape.
The easiest way is to calculate the difference (size_of_tape - total_size_of_data_written).
Anyway, I must advise you to not rely in one single tape to have several instances of a full backups in a single tape as you are doing.
If this tape goes bad you will lost all full backps on it at once !
Do NOT use non-rewind devices and start each backup session in a different tape.
If you make daily backups, use at least 2 tapes and alternate the tapes 1 and 2.
Depending on how critical is the data you can use a tape per day or even more.
Otherwise, you may have a false sense of protection.
Did you ever have checked if the tape contents is good for restore ? It is very common to write data to a tape that you can't read it back. So, another advice is to test the media just after the backup session ends.
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197
Rep:
hmm. So, that tape is just sitting in the drive indefinitely. You're using the no-rewind device. Assuming that no one or thing has touched the tape. If the system rebooted and the device reset and rewound (bit of a power bump last night, say), then your ufsdump would overwrite the tape and all the previous dumps would be lost.
Sounds pretty risky. I would at least put in some logic and checking. Use `mt status` to see where you are and either `mt fsf <n>` or `mt eom` to ensure that the tape is actually positioned to the end and you know where that is.
I also second the comment not to rely on a single tape this way.
I got always only ufsdump of the /dev/md/rdsk/d2 on tape. So it overwritten. mt -f /dev/rmt/0 fsf just doesnt work
The only way to put more than one backup on a tape is to use /dev/rmt/0n.
But what choogendyk noticed is that after reboot, tape will start from the beginning - that is a little bit crappy for me :/
So, may you please advice me how to put more than one backup on a tape ?
(Lets just dont care for now that puting all week backup on 1 tape is not a safe solution).
Later you should try to restore a system. It is very common that companies do backup, and when they try to restore, nothing works. They missed something.
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197
Rep:
OK, a bunch of things.
`mt status` cannot tell you what is on the tape. It only tells what file number you are at. You have to look at the output of the ufsdump. There should be a line like:
DUMP: 71314 blocks (34.82MB) on 1 volume at 447 KB/sec
(that's from a DDS tape, so the performance is crummy by current standards).
Then, as marozsas said, add up all the data written to the tape and subtract it from the size of the tape. This may even be harder than it sounds. You have to take into account compression. If you are using hardware compression, then all bets are off. You will be guessing. But at least you will have a rational guess. You'll have to have some idea as to how compressible your data is. And you may just run off the end of the tape anyway.
/dev/rmt/0n is cool. Use it. That's what I have always done. Otherwise, the tape will rewind in response to everything that you do to it. An fsf will immediately be followed by a rewind, which is useless.
If you don't care about previous backups, then just issue a rewind before the day's backups.
If you want to stack as many backups as possible on the tape, and be meticulous about knowing the tape is where you want it to be, then issue a rewind followed by an eom. So, e.g.
The "c" (in 0cn, if you were to use that) will give you hardware compression. That's good, but doesn't help your calculations, as I already mentioned. If you are doing typical unix/linux sort of stuff that has lots of text files, it may compress 2:1 or even better. But throw in some dense, non-compressible files, such as images or already compressed source stuff like tiff files or, say, gcc-huge.tar.gz, and you may not get much compression, or, worse yet, some hardware compression algorithms will actually increase the size because of the added table space required for the compression.
Because of that issue, you'll have to go by experience and intelligent guessing.
Keep a log of the sizes of your backups from the ufsdump output, and do the best you can with it. DDS/3 claims 12G/24G (12G native capacity, 24G with compression). My experience with them was typically 14-18G, depending. I never got anywhere near 24G.
HTH
Last edited by choogendyk; 07-17-2008 at 09:31 AM.
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197
Rep:
With regard to the use of /dev/rmt/0cn (with c for compression), I should note that some drives will recognize how a tape has been used and will only use it that way. So, if you wrote a tape without compression, and then try to write to it with compression, the drive may silently do as it pleases regardless of what you said.
I don't know if that is true of DDS. I've heard people on lists go through contortions with more modern higher capacity drives trying to force them. I believe erasing the tape and writing it may have been the solution. But, that's a whole 'nother topic. Could be found by searching some of the backup lists archives. I think I saw it discussed at length on the Bacula list.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.