Archive for the ‘Linux’ Category

RAID and external USB backup on NetBSD 5

2010/01/23 1 comment

I recently had to change my “storage policy”…

A failed drive in my RAID1 set of 2 disks, and brand new disks coming up forced me to 😉 So here I am sharing two facts that have wasted my time recently. Hopefully it would help some to avoid these hassles, or at least plan more time for it.

First : I followed the NetBSD guide to setup my RAID back when I was on NetBSD3 probably. Things where a bit different from now that I have a 5 fully upgraded version, but anyway it still works. Problems is to be that I have the right same geometry for my disks in the RAID1, I did as they say on the official guide, which is copy the disklabel of disk 1 onto disk 2. and it works perfectly. Problem is : When you want to change the disk, both disklabels have same name and identifier, and if on top of that you have for some logistic reason to change the way the disks are plugged into the machine, it get much trickier to find out which drive you wanted to keep and which one you wanted to remove… So I had to “fix” my disklabels, and put different meaningful identifiers, so I could use them to properly identify which disks I wanted to pull out of my RAIDset.

Second : For my backup strategy, as my RAID set was previously “under-used”, meaning there was a lot more free space than I actually needed, I used to backup stuff inside the RAID itself. Even if it is discouraged for obvious reason, a RAID1 mirroring was enough to ensure my data, so I just wanted to be able to go dig up old configuration files and revert some setup, so just keeping the files, even in the same disk, made some sense.
Now that my disk usage is getting higher, and hard drive prices are getting lower, it s becoming worth it to get an external USB drive. I naively thought that just plugin it, and pointing my rsnapshot config to the appropriate mount point would be enough. Error.
RSnapshot uses hardlinks in order to minimize the duplicates of files into the different backups, and therefore cannot work on the preconfigured FAT partition on that drive. I expected that, so I plug that USB dirve in my ubuntu laptop, uses gparted to make a big ext2fs partition, and unplug it. From there I expected i would work. Well it didnt. As stated in the mailing list, at the time I am writing this, ext2fs has problem being mounted on the netbsd-5-0 branch, although this has been fixed in netbsd-5. I really wanted to use ext2fs for my external backup just because it would make it so easier to retrieve data on another “non-BSD” computer, I now have to upgrade to a netbsd-5 branch, rebuild everything, install the newly built OS, and reboot. Extremely easy to do since I document and script all these tasks. Just time consuming…

Categories: Linux, NetBSD Tags: , , ,

First Post, and Saving backup remotely

2010/01/08 1 comment

Hi everyone,

I used to blog on my home server, and talk mostly about travels, posting pictures and so on… it was fun 😉

But recently I lost my passport, and lots of things went wrong, including a RAID failure on my home server that I visit once every 2 years, so I decided it wouldn’t hurt to blog somewhere else, and talk about all the geek stuff that I am used to do on my free time, such as fixing my RAID, and re-organise my backup strategy for example ;). Hopefully it will help others with similar troubles…

So here you go, I recently found that I can use a combination of cpio and ssh, to export my rsnapshot backup directory ( with hardlinks ) from a BSD machine to a Linux one !

On my NetBSD 4.0 box :
# find /home/.snapshots/ -depth -print | cpio -c -o -H ustar -v | ssh user@remotehostname "cat > snapshots.cpio"

And then on my Ubuntu box 09.10 :
$ mkdir snaps && cd snaps && cpio -imdv -H ustar -I ../snapshots.cpio

Worked like a charm 🙂

Happy me, my old server will be saved, and all backups restored as soon as I can hold a couple of new disks 🙂

Categories: Linux, NetBSD Tags: , , ,