LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-24-2015, 02:36 AM   #1
dakoris73
Member
 
Registered: Aug 2008
Posts: 43

Rep: Reputation: 0
Question backups and external drives


Hello everyone,

I recently had an issue where I lost my whole backup server due to an electrical overload causing my server to literally explode and fried all 4 of my terabyte drives.... needless to say, I have no more backups because of this, and everywhere I read about backups said that setting up a raid array would allow me to keep good backups.... boy did I learn this lesson the hard way in needing to have some sort of external backup option, which brings me to this post and my questions:

I'm using Ubuntu 14.04 LTS server on an older Dell Poweredge 600sc, and I was thinking of using WD Passport 1Tb external drives to be used as my "offsite" backup option. I don't have a lot of data, and my current backup schedule is only a weekly backup, so thinking that if I have two of these passport drives so that I can have one drive offsite and one attached to the server, and rotate them every 4 weeks so as not to loose all my data.

Here's my question: Ideally, I would love to just be able to unplug the current drive, plug in the new drive and have everything work. However, I don't see this actually working, but if there's a way to do this, that would be totally awesome.... ;-)

So, realistically, I know I will have to unmount the one drive, unplug it, then plug in the new drive and mount it on the system. Is there a way to mount this to the same mount point automatically so that I don't have to rewrite my backup script each time I swap drives out so that the backups go to the same mount point? Or will the UUID's get messed up each time I do this?

Hopefully this makes sense and an easy solution can be found to accomodate this idea.....

Thanks again for all your help. This site is awesome for newbies such as myself........

Mikey
 
Old 01-24-2015, 08:42 AM   #2
replica9000
Senior Member
 
Registered: Jul 2006
Distribution: Debian Unstable
Posts: 1,125
Blog Entries: 2

Rep: Reputation: 260Reputation: 260Reputation: 260
This could be of some help.

http://www.keyboardninja.eu/linux/mo...oint-in-debian
 
Old 01-24-2015, 08:51 AM   #3
cepheus11
Member
 
Registered: Nov 2010
Location: Germany
Distribution: Gentoo
Posts: 286

Rep: Reputation: 91
Recent versions of udev will mount an external drive on a path containung the filesystem label, if the path is not already used. I don't know if this applies to ubuntu, or if udev recognizes different drives, but try it: Name the filesystem on both disks "backup" while creating, like

Code:
mkfs.ext4 -L backup /dev/...
or rename the existing filesystems using tune2fs (if you use ext... filesystem).

Then they should be mounted on /run/media/<username>/backup. Do not mount both at the same time, of course.
 
Old 01-24-2015, 09:40 AM   #4
J Martin Rushton
Member
 
Registered: Jan 2015
Location: England
Distribution: Mainly CentOS
Posts: 31

Rep: Reputation: Disabled
If you put an entry in fstab, udev leaves it alone. I have a line similar to:

LABEL=Backup /backup ext3 ...

So with any of my backup disks "# mount /backup" will put it where I expect. I don't want it mounted except during the backup cycle, and can dismount it (or shut down the machine) at the end. Don't use a physical device like sdj1, it may not always be the same, and of course a UUID is useless if you are switching disks around. This technique works equally well on memory sticks.

I run Amanda at home with the three backup disks each configured with 10 slots. Every week or so the current backup goes to work and the oldest comes back. Amanda works out that the "tapes" are expired and overwrites them.
 
Old 01-26-2015, 08:06 PM   #5
selfprogrammed
Member
 
Registered: Jan 2010
Location: Minnesota, USA
Distribution: Slackware 13.37, 14.2, 15.0
Posts: 635

Rep: Reputation: 154Reputation: 154
I use the same fstab system previously mentioned, but I have the mount points as root directories ( /usb1, /usb2, /cdrom, /dvd ) and have configured fstab to mount them.
For my memory sticks.
>> mount /usb1
>> mount /usb2
>> tar -c --bzip2 -f /usb1/backup/xxxx xxxx

The same system would work for any media.

I have had weekly backups, but also had monthly backups and yearly backups.
The weekly backups are configured to get the changed files.
The monthly and yearly backups cover more of the entire system. They save all files as current state. Older versions are saved because users make mistakes and may have to go back a few months to get an old copy of a file.
Yearly backups save /etc/ and all config, so the system can more easily be recreated.
There are also event backups, triggered by system changes. These are customized to what got changed.
 
Old 01-26-2015, 09:43 PM   #6
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
I think that the UUID system of naming partitions is an awkward mess. I give all of my disks labels and use the label to mount drives. The situation is even worse with systemd which has conniption fits if I misspell a UUID. I have a directory called /media/usb.hard.drive and here is a typical mount command for a partition labeled charlie in one of my backup scripts.

# Mount the USB hard drive
if ! (mount -t ext4 -L charlie /media/usb.hard.drive);
then
echo "mount failed for USB hard drive on charlie partition"
exit
fi

These commands say to mount charlie on /media/usb.hard.drive. If the mount fails then issue an error message and exit the script. The mount will fail if charlie is not plugged in or is not powered on. I plug charlie in and wait for KDE to tell me charlie is available before I start the backup script. At the end of the backup the script does a umount for the external drive and issues a finished message. Then I unplug the external drive.

I only plug in an external backup drive when I am doing a backup or recovery. This minimizes the possibility of accidental destruction of the backup data.

--------------------------
Steve Stites
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Switching from dump tape directory backups to NAS disk backups on RHEL 6 Jerry_C Red Hat 0 06-05-2013 12:44 AM
External hard disk for backups alaios Linux - Hardware 8 03-02-2013 04:39 AM
How to do backups to external USB drive webwired Linux - Newbie 3 03-06-2010 03:57 PM
Install DSL 3.0 to HD and use KDAR to backups all netowrk drives. MurX DamnSmallLinux 0 07-24-2006 04:06 AM
External Drives (iPod and Pen Drives) dhbiker Slackware 13 04-08-2004 06:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:12 PM.

Main Menu
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