Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I need to back up a (virtual) Ubuntu server. The backup media (an external USB disk) is mounted on the Windows (Hyper-V Server) host. The Windows servers on the same host can simply back up using Windows Backup over SMB.

How should I go about backing up the Linux box, given that it'll end up on an NTFS-formatted disk?

Update

I'm not so sure that Samba will work -- it won't preserve symlinks, devnodes, permissions, etc. Similarly, it's not going to preserve filename cases and other odd characters.

I'd like it to be full-fidelity, so that I can use it for disaster-recovery...

share|improve this question
    
what vm environment are you using? vmware has the ability to provide access to USB devices on the host to guests, you could mount the USB stick directly within the VM. –  shufler Sep 17 '09 at 19:16
    
In addition to my answer - one of the best reasons for using a VM is that you can easily make an image of the filesystem for disaster recovery. Consider using that to make a VM disk image to save to your USB drive. –  Dave Drager Sep 17 '09 at 19:54
    
Windows Server Backup on Hyper-V doesn't (stupidly) provide for single-file backup. So it'll be difficult to just backup the VHD for the Ubuntu guest. –  Roger Lipscombe Sep 17 '09 at 20:07

4 Answers 4

up vote 3 down vote accepted

You're going to use Samba as the transport-I suggest using tar to create the actual backup. Tar will honor the symlinks and store the permissions as well.

HERE is a good website I use for understanding tar as a backup program

share|improve this answer

If you make a tarball of your data first, and backup the tarball to the cifs mount like described in other answers, you'll preserve symlinks and whatnot.

share|improve this answer

Installing (and configuring) Samba will allow you to back up the Linux host just like your other Windows servers.

share|improve this answer

You only need the samba client on Ubuntu - most likely this is already installed. Mount the share with:

sudo mount -t cifs //netbiosname/sharename /media/sharename -o username=winusername,password=winpassword,iocharset=utf8,file_mode=0777,dir_mode=0777

You can then perform your backup using cp, rsync, or your program of choice.

Alternate: If you can't use samba, you may want to just create a file on the samba filesystem (or directly, since the USB Drive is on the host, you should be able to access it in your VM) then create a "loopback" filesystem on the drive to do your backup.

dd if=/dev/zero of=/tmp/test-img bs=1024 count=10000000 # 10G filesystem
mkfs -t ext3 -q /tmp/test-img
mkdir /mnt/image
mount –o loop /tmp/test.img /mnt/image
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.