Posts

Showing posts with the label backup

Large Hidden Files

I'm working on another backup script. I admit it had been over a year since I had backed up my home hard drive. In that time, the stuff my old script had been backing up from my home directory got a lot bigger. Why? I found a couple obvious culprits that I should have seen right away, but then it was less obvious. Running du | sort -rn is always insightful when this problem comes up, and I found that I had a .local directory that was 2.3 GB in size and a .cache that was almost 1 GB. Ouch. Looks related to tracker . The other biggie that I had totally missed was that I had played around with VirtualBox , and it stores its hard drive images in the hidden .VirtualBox directory. What is with these programs stashing huge amounts of data in hidden directories? In the case of VirtalBox, it could be very important data. Is that smart to hide it from the users like that? I don't like it.

Playing With Dar

I'm playing with backups again. Most recently, I'm looking at dar . Some quick notes: To backup just /etc , become root, make sure your pwd is / , and type this: dar -v -c /path/to/etc-backup -g etc This will create a file named etc-backup1.dar at the path you specified. The -v is optional. To do the same but encrypt the archive do this: dar -K passphrase -v -c /path/to/etc-backup -g etc Where "passphrase" is your sneaky passphrase. To list the contents of the archive: dar -K passphrase -l /path/to/etc-backup Of course, you leave out the -K passphrase if you didn't encrypt it in the first place. Notice that you don't give it the full filename, ever. Getting more advance, to write the backup to a file on a remote machine over ssh, do this: dar -c - -g etc | ssh user@host dd of=/path/to/etc-backup.1.dar You tell dar that the backup file is stdout, pipe that to ssh, and use dd on the remote side to put the backup into the file. Note that yo...

Resize a QEMU/KVM Windows Disk Image

After playing with kvm and qemu during my knee surgery recovery , I got hooked. I have a working windoze XP install running under kvm on my Core 2 Duo, Ubuntu Gutsy Gibbon box, and it flies. It almost, almost feels like native speed (I also got help here and here ). It's great. Except, not being a regular windoze user, I'd lost track of how much space a windoze installation (and all the service packs and security updates) needs. When I created my original hard drive image file I made it 6 GB, which, it turns out, is too small. I didn't want to just create a new disk image and re-install, it took a lot of work to get this image up to it's full 6 GB glory. I hunted and found some instructions for resizing qcow (qemu copy-on-write) disk images , but they just didn't work for me. Once I converted from qcow (qcow2 actually) to raw, windoze wouldn't boot on the raw image. Gparted didn't show any partitioned drive space either. Then I remembered I'...

Edgy to Feisty Horror

As mentioned previously, I upgraded my work machine to Feisty Fawn without much trouble, but waited on doing my home machine because I knew it would be a bit trickier. The reason is I run a family website from that machine. It's basically a blog built with Django and it uses a PostgreSQL database backend. It also has a photo gallery with tons of family photos. I would hate to lose either of those. I had a bunch of free time last night, and I had backed up important stuff to some DVDs recently, so I decided to go for it. I clicked upgrade in the Update Manager and off it went. About then a good friend of mine called. We hadn't talked for a long time, and we had a lot to catch up on. Perfect. I let the install run while we chatted. It was taking a while to progress, but I didn't think too much of it. After we hung up and said goodbye, I started reading a book. It was finally to the configuration and setup part and occasionally asked me some questions. I was e...

Dump for Backups

This was originally posted on my family blog on 4/10/06. I will be slowly moving the geeky stuff from there to this blog. Not willing to wait any longer (two whole days already!?!) for a fixed mondo rpm, I tried to compile it myself. No luck, make complained about no target for the man pages or something. So in the meantime, I'm looking at good ol' dump . It looks kind of handy, and I think I could get it to almost do what mondo promises with a little scripting. It wants to backup whole filesystems. It will do a sub-directory, but if you do that it won't do differentials. You can have it exclude files and directories, but you have to supply it the inode numbers of what you want it to exclude. Apparently a simple file or directory name isn't good enough for dump, you have to use stat yourself. Also, it won't split the backup file up like mondo, unless it runs out of tape. That means that if you are backing up to CDs, you'd have to manually use split and ...

Mondo Bug

This was originally posted on my family blog on 4/8/06. I will be slowly moving the geeky stuff from there to this blog. I finally got to where I'm confident mondo is going to work for my backup needs, and I got the command-line that I want all figured out to backup just the stuff I need. Here it is, for posterity's sake: mondoarchive -O -i -I "/home /etc" -d '/mnt/home/backup2' -E '/home/pub /home/bryan/.mozilla/firefox/6ytxpczd.default/Cache /home/bryan/backgrounds /home/bryan/downloads /home/bryan/glazba /home/bryan/roms /home/bryan/src /home/bryan/tmp /home/bryan/video /home/bryan/vmware/Browser-Appliance /home/bryan/vmware/test' -g -s '700m' The '-I' option I'm using is straight from the mondoarchive man page. However, mondo gives this error message when I try the above: Fatal error... ERROR ! You specified a directory to include which doesn't exist ---FATALERROR--- ERROR ! You specified a directory to include which does...

A Differential Backup with Mondo

This was originally posted on my family blog on 4/7/06. I will be slowly moving the geeky stuff from there to this blog. I broke out the mondo man page. To verify my little backup, and see what has changed since I made it, I ran this: mondoarchive -V -i -I "/home/bryan/Documents" -d '/mnt/home/backup3' -g -s '700m' I had made a little change in a text file, and it flagged it and told me. I just noticed that it says the -I switch is ignored if you are just verifying. Oh well. Now, to do the actual differential backup I ran this command: mondoarchive -O -i -D -I "/home/bryan/Documents" -d '/mnt/home/backup3' -g -s '700m' For backing up one little text file it still took a while because it seemed to re-generate the boot disk. I think I saw an option in the manual to not do that, but it was highly recommended that you don't use that option. Anyway, looking at the backup directory, it seems to have overwritten the full backup iso ...

A Small Backup with Mondo

This was originally posted on my family blog on 4/6/06. I will be slowly moving the geeky stuff from there to this blog. I tried backing up just the Documents directory in my home directory with mondo. It went much much faster, of course, but at the end it wouldn't restore. Weird. So I tried again and used less compression this time. It gave a strange error message at the end: Boot+data floppy creation failed. However, FYI, you may burn /root/images/mindi/mondorescue.iso to a CD and boot from that instead if you wish. But the restore still worked fine. I think I got the same error the first time too. The differences the second time were, I used the default iso file name of mondorescue, and I used minimum compression. Why didn't the boot disk creation work? Maybe it couldn't make the boot disk because I didn't back up anything under /. Who knows. I guess if I stick with mondo I'll have to double check each backup and make sure it works. I just ran the exact ...

Home Backup with Mondo Rescue

This was originally posted on my family blog on 4/5/06. I will be slowly moving the geeky stuff from there to this blog. I'm playing with Mondo Rescue for backing up my hard drive. Here are some quick notes of the experience so far. I ran a basic mondoarchive "gui" session, and accepted all defaults, except that I excluded /mnt from the backup. It asked for a max iso size, I didn't ever plan to burn these to anything, but I put in 700 MB because I didn't know what else to do. I backed up to hard drive (the unused hd on my system). It spent about 13 hours working, created 50 isos and then quit. I didn't see it quit, and from the log it looks like it gave up with the message "too many isos." No kidding. Now I'm attempting to restore a single file. I typed mondorestore. The "gui" started up and told me to insert the boot disk. I just hit enter and it went to a menu asking what to restore from. I chose harddrive. It asked for the...