Maintaining the same data on two hard drives, without raid

Soldato
Joined
22 Dec 2008
Posts
10,369
Location
England
Hey. I'm trying to work this one out through virtualbox at present, but perhaps I'm missing something obvious.

I want to have two hard drives, which are as close to identical as possible. Either bootable. This is as a backup, so when I damage one OS too much or if a hard drive fails, I just plug in the other one and continue as before. I don't want raid 1 since I'd like one of the drives to be outside the computer, this isn't exactly offsite but it's still better than both drives on the same controller.

So far, I'm setting up one drive, Imaging the entire thing across to the other from a livecd, then hoping a weekly rsync will keep everything matching. The main concerns are windows not working on the drive being update after rsync, though I've not got as far as trying to boot from it yet. I'm not really sure how to test this idea either.

Presumably some people on here do something similar, how did you proceed?
 
If I'm reading you correctly you want to be able to have a backup of your virtual machine from virtualbox onto another drive?

Although I don't know a versioning method so that only changed data is copied over I have used VBoxManage clonevdi in Virtualbox which allows you to make a clone of a machines vdi image, then import it later, on the same or another computer, and it's exactly the way you left it. It takes about 15mins to backup and the same to import it though. I've used it several times and it works flawlessly, here's what I use:

Export
--------

Code:
sudo VBoxManage clonevdi ~/.VirtualBox/VDI/some_vdi_image.vdi /media/some_backup_harddrive/

then simply copy it into the .virtualbox machines folder later or on another computer etc:

Code:
cp /media/some_backup_harddrive/some_vdi_image.vdi ~/.VirtualBox/HardDisks/

If you have no HardDisks folder just put it in ~/.VirtualBox/

Then finally import your machine into virtualbox by going to File>Virtual Media Manager then select your .vdi harddisk from the list. Hit ok then go to new then go through all the steps, when you reach the part to select your harddisk check "use existing" and use your one you just setup.

Maybe thats what your looking for. You could also check out the virtualbox user docs its's really good, it may have something better than what I use.

http://download.virtualbox.org/virtualbox/3.0.6/UserManual.pdf

The vBoxCloneManage section from page 100 is where most of the stuff is at
 
Last edited:
I don't do this myself - but we create BCVs (business Continuity Volumes) of the system drives of some of out most critical systems in the office.

Basically, we have these boxes on RAID 1 (therefore two disks), we add an extra disk to the mirror (making it three metas in the array) and this syncs up, then the third meta is removed and we hang onto it in case we have something castastrophic happens to the array, in which case we can just bung in the third drive as a single (unmirrored) disk.

Shouldn't be too difficult to set up with LVM/cron - and obviously, you don't need three disks for this, as you won't need the initial mirror.
 
Last edited:
Cheers for the replies

I'm afraid I'm trying to do this to a real hard drive, and only testing ideas with virtualbox. Well, I would be if I didn't keep on having to go to work.

lvm looks like it may well be the answer, I will read up on this. I like that approach walls. Perhaps raid 1 with one unplugged is what I want after all, I didn't realise the disks were individually bootable. I'd have to delete the damaged date/partition before connecting the second drive up again to avoid overwriting good with bad, but this is the most promising approach yet. Cheers
 
Take a look at the DD command. You can do a bitwise copy of the drive.

That also needs to be done offline.

EDIT: also relies on the disks being the same size (usually the same make and model) for it to be completely successful.
 
Last edited:
Solid link, appealed to my sense of humour. I didn't realise rsync could leave you with a bootable volume, though the link doesn't really help with that. If initially dd is run, grub will be on both disks. There may be issues with uuid, I'm not sure about that yet.

"Imaging from a livecd" would be with dd, as I'm fond of the command and don't see the need for more exciting software to achieve the same result. Don't mind that it's offline, I'll do it from a different install anyway.

Linux raid can't do this if there's a windows partition, which unfortunately there is. Autocad is not going to work under wine, and it isn't going to be usable in virtualbox, so my hands are tied. The issue is I don't know if rsync can maintain a copy of a windows partition without stopping windows booting from it, and if so what I need to do in terms of options.

The windows vs linux permissions issue still confuses me. As far as I can tell either group completely ignore the permissions of the opponent. So will rsync preserving permissions reliably maintain a working copy of windows? I'm unsure, though testing this.

I suppose I was hoping for a more obvious answer than dd, then rsync, and not backing up windows.
 
Back
Top Bottom