LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Doin a weekly tape backup - multiple questions - VERY important - Please help (https://www.linuxquestions.org/questions/linux-general-1/doin-a-weekly-tape-backup-multiple-questions-very-important-please-help-56558/)

WorldBuilder 04-24-2003 08:17 AM

Doin a weekly tape backup - multiple questions - VERY important - Please help
 
Hi all,

I am getting better at Linux, but still kind of a :newbie: !! Ok, here's what I have for a network setup:

RH 8.0 Pro as a server (Cable modem Router, DNS, Samba, Sendmail, etc.), and about a dozen Windoze client machines. The RH 8.0 server has a 120GB HDD in it, but about a total of 30GB is actually used, and I don't expect that it will get to 40GB. I only have a 120GB drive in there because it was cheap when I got it. Anyway, the RH 8.0 machine is also dual-proc. I have recently addes an external SUN DLT 4000 drive to it. The drive is 20/40GB tape capacity. It is hooked up to an Adaptec 2940 SCSI card. So, here's what I want to do:

A weekly FULL backup (Say on Sunday nights at midnight). I mean everything on the RH 8.0 box. Also, the tape needs to rewind at the end of every backup. Ok, so what is the best way to do this, and then, how do I actually do it? I run 2 SETI command lines 24/7, so when I go to back up the system, should the 2 SETI processes be stopped first? How could I have them restart after the backup was done. I guess what I am asking is: How do I set up an automatic weekly backup that will have to be compressed (remember the tapes are 40GB compressed, 30GB on the HDD now), and how can I kill SETI automatically when the backup starts, only to restart it after it is done? How would this script look, and where would it go?

I have already tried "mt rewind /dev/st0" just to identify the tape drive, but when I tun that command, I get "mt: too many arguments for the command 'rewind'." How can I identify the tape drive so I know where to backup to?

Basically, I don't know squat about backups, scripts, cron jobs, etc. If someone could help me out, I'd be most grateful. I NEED to get a full working backup, as I have already lost the server once, and I can't let it happen again. Thanks all!!!

Oh, please feel free to explain this to me like I'm a five year old, lol!


Chris

michaelk 04-24-2003 09:21 AM

Check man pages for correct mt command options.
mt -f /dev/st0 status

There are lots of different backup applications. See www.freshmeat.net, www.linuxapps.com or sourceforge.net etc for ideas. Of course you could use tar which should be already on your system.

Have you searched this website for ideas?

Consider creating a backup plan. You might want to consider incremental backups everyday and a full backup on weekends. Include planned tape rotation. Practice restoring and verifing your backups every so often. Its not just creating backups that is important, its also knowing that you have good backups and a proven method to restore your system.

jharris 04-24-2003 09:24 AM

I wouldn't worry about stopping the seti jobs there's little point as they won't effect the backups.

Why do you want to actively rewind the tape? The DLT will handle all this for you, although if you do want to I think you want to use something like
Code:

mt -f /dev/st0 rewind
You should be able to back the entire box with something like
Code:

tar cf /dev/st0 /
This is assuming that the hardware compression is active (it nearly always is). If you do want to run the backup through gzip them change cf for cfz. If you want to be able to see whats getting backed up (if you run this from cron root will get an email containing the list of files) make cf into cvf or cvfz to have both compression and the file listings.

To execute this every Friday you can run
Code:

crontab -e
as root and add
Code:

0 10 * * fri /bin/tar cvfz /dev/st0 /
to the file. The editor you'll be using to do this is vi. If you don't know how to use vi then search on the web for a vi tutorial first!

HTH

Jamie...

WorldBuilder 04-24-2003 11:33 AM

Thanks guys,

I am now running a manual backup of the system using "tar cf /dev/st0 /" It seems to be going right now, but when I ran that command, I got the following:

tar: Removing leading '/' from member names
tar: /dev/log: socket ignored
tar: /dev/gpmctl: socket ignored

Now, I haven't pressed "enter" or anything so these messages are still on the screen, and I don't want to do anything until the backup is done, or someone here tells me it's ok. A few more questions?

When this backup is done, will the tape rewind automatically?
Can I work on the machine while it is being backed up, or is this not a good idea?
When I put the backup job in cron, how can I set it up to go at a certain time, not just a certain day?
When the backup is done, is it possible to browse its contents? How do I know it has backed up everything indeed?

You guys were most helpful, thanks!!! I still have a lod of reading to do, but I like to ask questions like these here, because it gives me the opportunity to get step by step instructions from people like you. There are some Linux things that I know very well, and other things I am still clueless about. Thanks a million, fellas!

Chris

michaelk 04-24-2003 01:11 PM

Yes you can work on the PC during the backup process. I wouldn't burn CD's.

Yes it will rewind the tape.
/dev/st0 rewind tape
/dev/nst0 does not rewind tape

Removing lead / is normal because it removes absolute path reference. Don't know about the others. Check man pages for tar options to verify.

jailbait 04-24-2003 03:06 PM

sockets and such
 
Linux uses file names for a lot of purposes in addition to naming files.

tar: /dev/log: socket ignored
tar: /dev/gpmctl: socket ignored

means that /dev/log and /dev/gpmctl are socket names, not file names. Backing up a socket is a meaningless concept. So tar skips over those names without doing anything.

WorldBuilder 04-24-2003 03:17 PM

Ok, thank you for the further information. Would anyone know the answers to my other questions?

When I put the backup job in cron, how can I set it up to go at a certain time, not just a certain day?
When the backup is done, is it possible to browse its contents? How do I know it has backed up everything indeed?

Also,the backup is now done, but there seems to have been a problem. On the screen, I see:

tar: /dev/st0: Wrote only 0 of 10240 bytes
tar: Error is not recoverable: exiting now

I don't understand this, for one thing, it would seem that the entire backup failed, but what's even more strange is that it seems to be telling me that it only had 10240 bytes to backup in the first place. There is around 30GB used on the hard drive! Any thoughts? Also, say I were to experience a catastrophic syatem failure. How do I restore?

Many continued thanks, fellas!

Chris

jailbait 04-24-2003 03:52 PM

restore
 
------------------------------------------------------------------------------
Also, say I were to experience a catastrophic syatem failure. How do I restore?
------------------------------------------------------------------------------

You restore with tar. To use tar you need a workable linux that includes tape support. I use a home grown rescue CD to restore my backups which I keep on CD-RW. You could try Knoppix. Whether Knoppix supports tapes is iffy so you should make a trial restore with Knoppix before committing to it as a rescue system.

Restoring the entire tape will work for a complete disaster but it is very cumbersome for a missing file or two. I suggest that you also have a backup set on CD-RW or hard disk where you can restore just a few missing files.


------------------------------------------------------------------------------
tar: /dev/st0: Wrote only 0 of 10240 bytes
tar: Error is not recoverable: exiting now
------------------------------------------------------------------------------
I am not sure what this means. It may mean that you are using a block size of 10240 bytes and tar was unable to write a block. Yes, if tar failed to write a block and quit then the backup tape is useless. I used to use tape backup before I went to CD-RW. I found that the tapes aged very fast and soon had so many I/O errors that they were useless.

------------------------------------------------------------------------------

rnturn 04-24-2003 05:04 PM

Quote:

Originally posted by cjwsb
When I put the backup job in cron, how can I set it up to go at a certain time, not just a certain day?
The first two fields in the crontab entry determine hour and minute. I think `man 5 crontab' will explain that.
Quote:

When the backup is done, is it possible to browse its contents? How do I know it has backed up everything indeed?
Yes. If you can rewind the table and request a listing of all the files on the tape you'll probably be alright. Try `tar tvf /dev/nst0' or similar.

Quote:


tar: /dev/st0: Wrote only 0 of 10240 bytes
tar: Error is not recoverable: exiting now

My guess is that the tape device has not been initialized. You'll need to run `stinit' with a suitable config file to initialize the tape drive before you can use it. I ran into this a few years ago and it drove me bonkers for a couple of evenings until I ran into that command. Just seeing the `st' device in /proc and being able to run a couple of simple `mt' commands ain't enough.
Quote:

I don't understand this, for one thing, it would seem that the entire backup failed, but what's even more strange is that it seems to be telling me that it only had 10240 bytes to backup in the first place.
If memory serves, 10240 bytes is the size of tape I/O buffer that's typically used. It looks like the first write to tape bombed. See the comment above about `stinit'.
Quote:

Also, say I were to experience a catastrophic syatem failure. How do I restore?
Well, once you get to the point of being able to copy something onto tape and read it off, I'd take some of that unused space on your 120GB hard disk space and set up a couple of partitions that you can practice backups and restores on. They don't need to be big; they're just for practice. If you backup using something like

cd /mnt/mydata1
tar cf /dev/nst0 .

you should be able to restore using

mt -f /dev/nst0 rewind
cd /mnt/newfilesystem
tar xf /dev/nst0

There are probably additional switches you'd want to use (like `B') but the above are pretty basic. You could also look into other backup programs like `cpio' and `amanda' (I think that's the name; it comes on the RH CDs but I haven't tried it yet).

If you're using multiple filesystems -- IMHO an excellent idea that can help reduce the extent of data damage should there be some awful filesystem error -- you'll want to use the non-rewinding tape device (nst0) as opposed to the rewinding device (st0) and backup individual filesystems without rewinding the tape between backup/archive commands. Then you can select the correct archive using the file movement commands in `mt' when you need to restore. (Obviously, you need to know what order things were archived onto the tape so you'll know where to position it before restoring.)

Good luck,

Rick

michaelk 04-25-2003 03:36 AM

I don't need to run stint with my Quantum DLT 4000 tape drive.

Try coping small files from your home directory and restoring to a practice partition. The v option is for verbose. As in the other posts try:

tar -zcvf /dev/st0 /home/user/*


To restore


cd /practice/directory
tar -zxvf /dev/st0

More info on tar.
http://www.gnu.org/manual/tar/html_mono/tar.html#SEC16

rnturn 04-25-2003 03:12 PM

Quote:

Originally posted by michaelk
I don't need to run stint with my Quantum DLT 4000 tape drive.
Ooh, that's interesting. My experience has been mainly with DDS tape drives and running stinit seems to be mandatory (as well as making sure no tape is online when you run stinit lest the system hang). I have been given an older DLT drive that I've yet to get put into service (need to buy media) and it's nice to know I won't have to tear out what hair I have left in order to get it up and running.


All times are GMT -5. The time now is 03:27 AM.