Home | Hardware | Internet News |Web Hosting |IT Management |Network Storage
LinuxPlanet
Search 
  Power Search | Tips 

 Front Door
 Discussion
 LinuxEngine
 Opinions
 Reports
 Reviews
 Tutorials
 News
 Technology Jobs

 Browse by subject.
Free Newsletter

Linux Planet
Linux Today
More Free Newsletters

Be a Commerce Partner


















internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

Print this article
Email this article

   LinuxPlanet / Tutorials







Linux Backups For Real People, Part 1
Persistent Backup Device Names

Carla Schroder
Thursday, November 1, 2007 10:18:12 AM

Depending on how your particular flavor of Linux has customized udev, it is possible that removable USB devices won't always be assigned the same names when you plug them in. You need them to always be the same when you run backup programs. The correct way is to configure udev to handle this. Ubuntu, Fedora, Red Hat, Mandriva, PCLinuxOS, and doubtless many more have an easy way to control this: simply add a unique device label to your backup partition. For example, suppose you're using a Compact Flash card for your backups. You'll need the tools specific to your filesystem to do this, so for FAT16/32 fetch the mtools package. First add an entry like this to /etc/mtools.conf to map a Windows-style drive letter to your filesystem. You may use any letter:

# Lexar compact flash
drive u: file="/dev/sdc1"

Then create your new device label:

#  mlabel u:
 Volume has no label
Enter the new volume label : backup1

Verify it this way:

$ mlabel -s u:
 Volume label is BACKUP1

Now when you plug in your Compact Flash card it will automatically be mounted at /media/BACKUP1. (Sorry, I don't know how to make MS-DOS disklabels not shout at you; you're stuck with uppercase.)

***
Update: Robyn Willson tells how to make DOS disklabels in lowercase using mkfs:

# mkfs.vfat -n labelname /dev/sdb1

-n is the option for volume name and labelname is the disklabel in lowercase.
***

What if your particular flavor of Linux does not do this? Writing good udev rules is something we'll cover in detail soon, so in the meanwhile you can resort to good old /etc/fstab. First create the /media/backup1 directory, then make an entry in /etc/fstab like this:

# Lexar 2G compact flash, backup1
LABEL=BACKUP1 /media/backup1 vfat user,noatime,noauto,rw,dev,exec,suid 0 0

You'll have to mount it manually. Any user should be able to mount and unmount the device like this:

$ mount /media/backup1
$ umount /media/backup1

Don't worry, our ace backup scheme can handle this with ease. Come back next week to find out how.

Resources

« Back: Backup Hardware

Skip Ahead

1 Backup Hardware
2 Creating a Filesystem With GParted
3 Persistent Backup Device Names





Linux is a trademark of Linus Torvalds.


internet.com home | search | help! | about us

Jupiter Online Media

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers