LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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, 03:36 AM   #1
dakoris73
LQ Newbie
 
Registered: Aug 2008
Posts: 29

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, 09:42 AM   #2
replica9000
Member
 
Registered: Jul 2006
Location: USA
Distribution: Debian, FreeBSD, Android
Posts: 999
Blog Entries: 2

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

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

Rep: Reputation: 83
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, 10: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, 09:06 PM   #5
selfprogrammed
Member
 
Registered: Jan 2010
Location: Minnesota, USA
Distribution: Slackware 13.37
Posts: 290

Rep: Reputation: 55
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, 10:43 PM   #6
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Jessie, Linux Mint 17
Posts: 7,750

Rep: Reputation: 271Reputation: 271Reputation: 271
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 01:44 AM
External hard disk for backups alaios Linux - Hardware 8 03-02-2013 05:39 AM
How to do backups to external USB drive webwired Linux - Newbie 3 03-06-2010 04:57 PM
Install DSL 3.0 to HD and use KDAR to backups all netowrk drives. MurX DamnSmallLinux 0 07-24-2006 05:06 AM
External Drives (iPod and Pen Drives) dhbiker Slackware 13 04-08-2004 07:36 AM


All times are GMT -5. The time now is 09:11 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration