Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I have a tape drive on /dev/nst0 which I've been tarring my filesystems two for over a year now.
The tar command I use to write to tape is
tar -cvpf /dev/nst0 --label="Backup:`date '+%d-%B-%Y'`" --directory / --exclude=mnt --exclude=proc --exclude=dev --exclude=tmp --exclude=root . > /tmp/Backup-`date '+%d-%B-%Y'`-Log
Which writes the tar file to the tape and puts a log file in /tmp. After that I rewind the tape with
mt -f /dev/nst0 rewind
and take it offline with
mt -f /dev/nst0 offline
This has been working fine for ages however when I try to dothis now I ge the error
tar: /dev/nst0: Wrote only 0 of 10240 bytes
tar: Error is not recoverable: exiting now
From looking at the log file this tar command generates sometimes this happens after only a few files, sometimes after almost the whole backup is written, however it invariably always happens and something is not backed up. Oh the other thing is it always says 10240 bytes? Mabye this is signitficant?
Can anyone fill me in on what this means. Is the drive bad or is this something to do with a configuration perhaps? Each time I try to backup its on a different tape so Idont think its dodgy tapes.
The commands look fine as long as you position the tape at the right location before you start archiving.
The 10240 is just the default blocksize. If you look at the tar man page you will see the default is 20 blocks (block is 512 bytes).
Have you tried just archiving just one file to make sure reading and writing to the tape works. You could do something like:
mt -f /dev/nst0 rewind #rewind tape
mt -f /dev/st0 weof #quick erase and rewind when done
tar cvf /dev/st0 /etc/services #archive /etc/services and rewind
tar tvf /dev/st0 #display contents of the archive