LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Blogs > your_shadow03
User Name
Password

Notices


Rate this Entry

Linux BackUp through mt and Tar

Posted 01-12-2009 at 12:44 AM by your_shadow03

Magnetic tape is a non-volatile storage medium consisting of a magnetic coating on a thin plastic strip. Nearly all recording tape is of this type, whether used for video, audio storage or general purpose digital data storage using a computer.

Linux (and other Unixish system) use mt command to control magnetic tape drive operation. You need to use mt command while working with tape drive. It allows you to reading and writing to tape.

The default tape drive under Linux is /dev/st0 (first SCSI tape device name). You can read more about tape drives naming convention used under Linux here. Following paragraph summaries command you need to use control tape drive for backup/restore purpose.

Rewind tape drive:# mt -f /dev/st0 rewindBackup directory /www and /home with tar command (z - compressed):# tar -czf /dev/st0 /www /homeFind out what block you are at with mt command:# mt -f /dev/st0 tellDisplay list of files on tape drive:# tar -tzf /dev/st0Restore /www directory:# cd /
# mt -f /dev/st0 rewind
# tar -xzf /dev/st0 wwwUnload the tape:# mt -f /dev/st0 offlineDisplay status information about the tape unit:# mt -f /dev/st0 statusErase the tape:# mt -f /dev/st0 eraseYou can go BACKWARD or FORWARD on tape with mt command itself:
(a) Go to end of data:# mt -f /dev/nst0 eod(b) Goto previous record:# mt -f /dev/nst0 bsfm 1(c) Forward record:# mt -f /dev/nst0 fsf 1 Replace /dev/st0 with your actual tape drive name
Posted in Uncategorized
Views 3425 Comments 0
« Prev     Main     Next »

  



All times are GMT -5. The time now is 02:21 AM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration