Red Hat Linux USB backup solution.

Hello everyone,

I am looking for a way to set up a USB backup solution on my Red Hat box. I am curretnly using the PC as a webserver and I would like to have the internal hard drive mirrored to an External USB harddrive that I can swith to in Case my original harddrive crashes.

What I want is:
1) Have a USB haddrive hooked up to my webserver.
2)  Have the drive mirror the original drive inside the computer.
3) If the internal harddrive fails I can just, replace the internal haddrive with the now detached usb drive (which would become internal)
and have the webserver up again in no time.

Any recommendations?

Thanks in advanced!
Who is Participating?

Improve company productivity with a Business Account.Sign Up

nociConnect With a Mentor Software EngineerCommented:
That can work too, but you have to understand that it's not autorecovering like the mirrored disks
and you might miss some data:

- diskdown during a copy operation might ruin some files
- all updates between the last copy operation and the diskdown event are lost.

Most important is that you choose something you can manage.

For the future setup something resembling your system in vmware or qemu
and toy around with it. The worst that could happen then is that you
have to install / test something new again.
(vmware is free for use (without support)) atm.

nociSoftware EngineerCommented:
The problem might be performance...

Is the USB drive of roughly the same type as your internal drive? When writing to a mirrored pair (mirrorred by the kernel, not by rsync & the like)
a write succeeds when both writes are done, so if you have f.e. a 10K rpm disk internaly and a 5400 rpm disk in the USB driver that might
create a bottleneck.

Otherwise mirroring can be done between any 2 equal sized partitions. jast have a look at mdadm etc.
caragolAuthor Commented:
Well I have not even bought the USB drive yet. I am just looking for solutions to create a mirror image of my current drive, as easy as possible. I am no expert at linux and I would appreciate if the solution was easy to implement.

Right now the web server is on production so it's hard for me to open up the computer and install drives etc. Even more, I have never done this on a  Unix Machine so bare with me and try to explain as much as possible. If you think there are other easier or more reasonable solution to my problems and I am open for suggestions.

Eitherway I am looking for a fail safe way to replace my webserver in 10 minutes or less in case it crashes.
A proven path to a career in data science

At Springboard, we know how to get you a job in data science. With Springboard’s Data Science Career Track, you’ll master data science  with a curriculum built by industry experts. You’ll work on real projects, and get 1-on-1 mentorship from a data scientist.

>Any recommendations?

Don't use USB!

Use something like this:

It fits into an open 5.25in enclosure, and the hard drive can be pulled out manually without opening up your system. If you have 2 of them, then your main hard drive is configured as a primary (and your CD as the secondary) on one interface, and the second enclosure can contain your backup. to which you image the original. In the event of a drive failure, you shut down, replace the original with the image, and put a new hard drive in for imaging.

Similar enclosures exist for SATA drives. (or indeed if you need better performance, then you might start to look at scsi RAID with 'hot swap'.

(   (()
(`-' _\
 ''  ''
nociSoftware EngineerCommented:

first look into the time it takes to replace parts...,

You'll probably want to go for some rackmounted disks that can be hotswapped. (ie. replaced without powerdown).
That are not tightly screwed inside your system.

Then place 2 (or if expenses allow) 3 disk in that rack, 2 will be mirrored the 3rd will be hot standby, that means the
lowlevel drivers will pull that disk in place of the failing one. (Of course you can also put 2 -> 3 disks inside your system)
You can sleep on to notice next morning you have to order a replacement disk if one fails.
Replace the defective one with the new arrival and configre that one as a spare. When you don't have a diskrack,
then you can at least plan your downtime to replace a defective disk).
BTW Most Diskracks are SCSI, although firewire also exists.
Prefereably members of a mirrorset are on different controllers so you also cover controller failure as well as disk failure,
and gain some performance benefits for being able to do update to both devices at the same time.

Info about mirroring:

These are gentoo oriented but should be applicable to a wider audience. ( emerge is the gentoo package manager,
equivalent to rpm + up2date on RedHat) If the docs tell you to emerge a package you should be able to find an equivalent one.

If you have more specific questions fire ahead
caragolAuthor Commented:

Ok So how hard would it be to set up this software RAID solution? I just need to install another HD on my computer plug it in, boot, and configure it?
I need minimal downtime because this server is live and bringing it down is terrible. That's why I was looking at USB because this way I don't have to turn it off.

Also as said above, the easier the better, because I truly don't have much linux experience.

best regards.
nociSoftware EngineerCommented:

Easiest would be to first create the raid1 set(s) needed on a spare set of disks.
and copy all your data over.

First choose your options for the hard drives:
  External rack or the encosures pjedmond described.
  preferably in a external rack. (you would then have down time for installing the controller(s). and plugging them in.
  look for controllers that are bootable.

partition types are not (83/82) ext2/swap but fd (raidmember)

Starting a raidset from scratch is relatively easy
  create the partitions and define them as raid partitions,
  combine them to raid volumes,
  copy data over,  (part can be done during production, static data), parts that can change during production
  have to be done during downtime.
  see that the grub/lilo loader is on BOTH members bootsectors!!! [possibly the hotspare too]
    (this is not mirrorred at all)
    grub is a little easier on the maintenance as the grub.conf file resides within the (/boot) filesystem.
  reboot from your raid rack.
  optionaly add old disk as a spare member.
Cheapest on disks:
More trouble some:
  insert a new disk into your system,
  partionit, as you would do for a raid set,  but with your new disk configured corectly and a nonexistent! device for second disk
  copy all data over
  boot from the single member raid1 set and replace the bogus member with the old drive
  when a disk fails
caragolAuthor Commented:
To be honest I don't think I have enough linux knowledge or am confortable enough with linux to pull that solution off.
Right now I am looking at some of these solutions which seem to be fairly easy and documented:

caragolAuthor Commented:
well noci for your efforts you take the 300 points... even though I am still looking for options.
; )
nociSoftware EngineerCommented:
I'll stay subscribed,
but now I am on holiday for a few weeks...

Please ask along if you need more info
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.