Posts tagged backup
Partiton Full? Move your Stuff Somewhere Else
Mar 6th
If you run out of space on a particular partition, but you have excess space on another partition you can relocate your data. Lets say you have 100 Megabytes left on /dev/hda1 but your have 10 gigs left on /dev/hda2. Lets say you have a folder on /dev/hda1 /home/user/backup that is over 2 gigs. Lets transfer these files to /dev/hda2 and then create a symbolic link at the original location so the folder can be accessed from the exact same location. For the example /dev/hda1 is mounted at /home/user/backup and /dev/hda2 is mounted on /home/user/backup2.
1) Create a new folder and move the contents.
cp -r /home/user/backup/* /home/user/backup2
Then check that the files have been successfully copied to the new directory. Then delete the original backup directory.
rm -r /home/user/backup
Then create a symbolic link to the backup directory.
ln -s /home/user/backup2 /home/user/backup
Now when you navigate to /home/user/backup you wont be able to tell the difference except that you have now alot of space on the /dev/hda1 partition.
Your partitions may be mounted to different locations, just apply the above example to your particular configuration.
Reasonable Backup Routines – Service and Desktop Integrity
Jan 27th
You should have backups of all your files all the time. For a desktop machine always have a backup of your entire /home partition. Use a cronjob and rsync. Mount a usb drive to the /media directory. Use a cronjob as follows:
1 1 0 0 0 rsync -r /home/user /media/backup/user
The above rsync will recursively transfer all folders and files from the user directory to /media/backup/user directory.
You should have at least 1 backup. You can also implement a raid 1 array in case of a hardware failure, which is highly unlikely but does indeed happen. My configuration involves a usb backup drive, mounted as above, and another machine that I rsync the backup to via the network.
Spin Down USB Hdd – Ehh I don’t Think Its Working
Dec 23rd
Oh, given my previously elabored backup configuations I have one further thing I would like to do. Since backup 1, and 2 are only used once per day I would like to spin down the hard drivers to increase longevity. I figured dismounting the drive would be effective, but I have encountered several things. First, usb drives are auto mounted, therefore there is no entry in fstab, and no folder in /media. If you dismount backup1:
sudo umount /media/backup1
Now just before issuing the backup rsync I would like to mount the hdd and spinup the hard drives:
sudo mount /dev/sdg1 /media/backup1
But the platters still feel like they are spinning. There is a hum to the disk, and it remains warm as if the partition was still mounted. Maybe I’m confused as to what a spindown is? I would like the hdd to be pseudo disconnected, even the the cable is connected, and then pseudo connected when data transmission is required just before the backup routine.
Server and Backup Layout
Dec 22nd
Both the master and slave servers reside on a host machine. Clearly the servers are virtual machines. Its strategic to use virtual machines because the host machine remains useful for a variety of other tasks. The virtual server compartmentalize the functions to a discretely backupable file. In my particular arrangement the master server is synchronized with the slave server. The slave server has the same applications installed as the master. A fully functional apache web server with php and mysql support. The mysql database is synchronized as a replicate in real time, and rsync is used to sync the apache web root. In the rsync function I skip the wordpress and wiki config files, in which I reference the mysql server on the slave machine. Doing so allows server2 to be a drop in replacement for the master just by switching the port forwarding settings in the router. I would have to reconfigure my.cnf as the master in such a transplanation. The mail server has spamassassin and clamav installed on master and slave and /var/mail are synchronized to keep a relatively real time backup.
Then once a day the slave server is backed up. Vboxtool handled this seamlessly. Vboxtool stops the virtual machine, transfers it, and automatically restarts it. The initial backup is done to backup1. Then rsync is used to backup the home folder on my host system. I also use the computer for my own personal things, which are effectively backed up to backup1. Then, subsequently, the host initiates an rsync of backup1 to backup2, then to backup3. I have a rsync duplicate of backup1 on backup2 and backup3.
The host also is a MythTV server, and backup3 is the client that is subsequently connected to the TV. I have my various hosts relatively diversified and multitasked.

![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=089adc0a-a090-44e1-badd-5eea1850fa32)

