We have relaunched: What's new at ZDNet Asia?

Quick backups to tape on Linux systems

Summary

Vincent Danen shows you how to make quick backups on Linux systems with the mt-st suite of tools.

Events

Microsoft MSDN/Developer Event
25 Mar 2010

One Marina Boulevard, Microsoft Singapore

IT Architect Regional Conference Singapore 2010
20 - 21 Apr 2010

Singapore Management University, Singapore

The Internet Show 2010
21-22 Apr 2010

Suntec Singapore

Before the days of writable CDs, DVDs, and cheap hard drives, the preferred medium for backing up systems was tape. Tape systems are very reliable, although perhaps less convenient than using optical media. They are also very easy to manipulate and make for great re-writable backups.

Most tape drives use a SCSI interface, which means that nearly every tape drive available will work out of the box on any Linux system using nothing more than the mt-st suite of tools. These tools are provided with most Linux distributions and are very easy to use. Using mt-st and tar with a tape drive provides you all of the tools required to make a quality backup.

If the driver for your SCSI interface card is loaded, perusing the dmesg output will show you what SCSI devices are attached and what device nodes they are assigned to. Typically, a tape drive will be assigned /dev/st0.

The mt program in the mt-st suite is used to manipulate the tape drive and the tape inside it. To erase a tape use:

# mt -f /dev/st0 erase

The typical syntax for mt is mt [-f device] [command] so you would use the following to rewind a tape:

# mt -f /dev/st0 rewind

The mt manpage has a lot more information on all of the available commands. To actually back data up onto the tape, use tar. Tar can write to devices as well as files:

# tar cvplf /dev/st0 / /usr/local

The line above will back up the / and /usr/local filesystems. Using the "l" option for tar tells it not to back up directories that exist on other filesystems, so if you only specified / and /usr/local was on a separate partition, it would not be backed up (thus the additional specification).

The time it takes to back up the system will depend entirely upon the size of what you are backing up and the speed of your tape drive.

To extract data, use tar again:

# mkdir /restore
# cd /restore
# tar xvpf /dev/st0

That would restore everything on the tape into the /restore directory. To extract a single file from the archive:

# tar xvpf /dev/st0 etc/fstab

That would restore only the /etc/fstab file from the tape.

As you can see, working with a tape drive is no more difficult than working with and creating local tar archives, which makes it flexible, scriptable, and easy to manipulate.

Talkback

Add your opinion

In order to post a comment, you need to be registered. (Sign In or register below)

Post your comment
Transform your business interactions with real-time voice, video and telepresence solutions.
Tech Vendor: Cisco

ZDNet Asia Live

It was just a matter of time until google was marginalised anyway. I'm afraid this will be forgotten in China very quickly. Still, it...

1 hour 22 minutes ago by robinsmith on Report: Google to leave China on April 10

High performance computing (HPC) most-wanted job in Asia http://bit.ly/9vFC3i (via @zdnetasia) #singapore

He doesn't care if her shoes are of glass, All he wants to see is a huge rack and nice a*s. Sleeping beauty's not awoken by true ...

1 hour 51 minutes ago by warlowdavies on One pair of 3D glasses to rule them all

RT @zdnetasia: EMC COO, Pat Gelsinger, on bridging gaps in the organization and its cloud ambitions in Asia. (cont) http://tl.gd/i5jjd

EMC COO, Pat Gelsinger, on bridging gaps in the organization and its cloud ambitions in Asia. http://bit.ly/9etOZW

Spoke to EMC COO, Pat Gelsinger, earlier, and here's the account of the interview: http://bit.ly/9etOZW

2 hours 33 minutes ago by kevinzdnetasia on topsy

Asian SMBs need to pay more attention to disaster recovery planning http://bit.ly/bDet08 via @zdnetasia

Asian SMBs need to pay more attention to disaster recovery planning http://bit.ly/bDet08

Experts: social media guidelines good for upcoming Youth Olympic Games, but focus on cooperation, not enforcement. http://bit.ly/d9M0BQ

3 hours 4 minutes ago by zdnetasia on topsy

Asian SMBs need to pay more attention to disaster recovery planning http://bit.ly/bDet08

3 hours 6 minutes ago by kevinzdnetasia on topsy

ZDNet Asia features IBM collaboration roadmap story from LCTY Singapore - http://bit.ly/9CuSbZ #lotusknows

3 hours 59 minutes ago by lotusknows on topsy

[TECH] URL Shorteners slow Web redirection. - http://bit.ly/bySnWK @zdnetasia

URL shorteners are great but they can slow web redirection & you pray it would never go down http://bit.ly/bySnWK via @zdnetasia

Temasek Holdings eyeing tech stocks, indicating optimistic outlook on IT sector. http://bit.ly/aM7VwU

URL shorteners slow Web redirection. http://bit.ly/bySnWK

Chinese agencies cry foul over Google. http://bit.ly/by6rwV

Philippine antipiracy drive focuses on enterprises. http://bit.ly/aWryDC

Gartner: China to become world's fastest-growing enterprise software market. http://bit.ly/bqJTtb

all of sg's isps have been practising compulsory invisible proxy for all home subscribers at their backend since many years back alre...

1 day 1 minute ago by melvinchia on Web filters mean bad news for business

it is not to good for china.
Proactol

1 day 46 minutes ago by nathonastle on Chinese ad partners beg Google for information

RT @zdnetasia: HP touts new products and management and productivity tools to address business computing pain points. http://bit.ly/dudgA6

For those with a computer science background, or interested in the high performance computing scene: http://bit.ly/9vFC3i

HP touts new products and management and productivity tools to address business computing pain points. http://bit.ly/dudgA6

Very good explanation of JMX

2 days 51 minutes ago by Babith B on Managing applications with JMX

The reaction to a report issued Tuesday by Flurry Analytics managed to completely overlook some interesting news--the Android-based Motorola Droid outsold the original iPhone over the same period of time following their respective launches--to focus instead on the sales numbers for the Nexus One.

2 days 54 minutes ago by lonemavericks on diggs

Another ZTE story....

2 days 56 minutes ago by Moderate Your Greed on Philippines opens bid for final 3G license

We at www.fifosys.com have also seen a growth in IT outsourcing and anticipate it as a growing field.

2 days 30 minutes ago by sarah Jane on Companies' outsourcing spend to increase

I agree with you. The iSiVaL is super portable and TVs can't expand their image size. I recorded a video that might bring some ideas to...

2 days 241235 seconds ago by Jesse B Andersen on Buying a projector? Try an LED TV instead

hermm... he deserved it.. he shud not talk abt sensitive things like tat, well, he shud think twice before saying all those things, event...

2 days 38 minutes ago by ... on Facebook user charged in Malaysia

Password manager tools are potential security threat. Criminals who hack into the computer can use the password manager to log onto any s...

3 days 38 minutes ago by ohanae on What defaults should random password generators use?

I've found the cross platform utility unetbootin to be rather handy for this kind of thing as well.

3 days 12 minutes ago by Jim on Use Live USB Creator to install Fedora 12 from a USB stick

Thanks for the article. I think the debug command has an "\" after "C:" it should say w32tm /debug /enable /file:C:\l...

3 days 13 minutes ago by Roger Biefer on Manage time accuracy with W32Tm

available in singapore now
http://www.portablemall.com.sg/goods-71-Microsoft+Zune+HD+32GB+-+Platinum.html

3 days 50 minutes ago by steve on Microsoft coy on apps for Zune HD

How about just using http://www.random.org/strings/? It is very configurable, satisfies all of the flexibility requirements you have ment...

3 days 55 minutes ago by Varun V Nair on What defaults should random password generators use?

Wi-Fi as the "Rodney Dangerfield of wireless", is a catchy metaphor, but it's already been used. In fact, it was the title of a...

3 days 54 minutes ago by Martin Suter on Selina Lo: Wired up for Wi-Fi in Asia