Friday, July 31, 2009

FreeBSD with ZFS filesystem

My notes to remember different zfs commands.

The FreeBSD Handbook is a good starting place.

or

The OpenSolaris.org website.

zpool create zfsstorage /dev/ad0

zfs create zfsstorage/compressed

zfs set compression=on zfsstorage/compressed

zfs set compression=gzip-4 zfsstorage/compressed

zfs list

zfs set sharenfs="-maproot=root -network 10.1.41.0" zfsstorage/compressed

zfs get compressratio zfsstorage/compressed

zs get all

Wednesday, July 1, 2009

Using Ubuntu as a backup server

  1. Install Ubuntu 8.04 LTS with a minimal install
  2. Use apt-get update to update the repositories
  3. Use apt-get upgrade to make your new server current with security patches
  4. Use apt-get install rsnapshot, rsnapshot will be the backup technique we will use
  5. Configure your raid volume where your backups will be stored
  6. I use a hardware raid card, so all I need to do is make the partition.
  7. Use fdisk to create the partition.
    fdisk /dev/sdb
  8. I use jfs for my backup storage filesystem
  9. Use mkfs.jfs –L raid5 /dev/sdb1
  10. Add the new partition to /etc/fstab
    LABEL=raid5     /mnt/raid5      jfs     rw,atime        0    0
    If you want you can use blkid to get the UUID of the new partition and use UUID instead of LABEL in /etc/fstab
  11. If you try to mount the partition, you will probably get an error relating to there is not a /dev/ created yet.
  12. You now need to run partprobe to create the new /dev
  13. Now you can mount the partition
  14. mount /mnt/raid5
  15. Now we can edit the rsnapshot file located at /etc/rsnapshot.conf
  16. Set snapshot_root to be on your newly created partition like below
    snapshot_root   /mnt/raid5/rsnapshot/
  17. Skim thru the rest of /etc/rsnapshot.conf and modify as needed.
  18. Update here about ssh-keygen –t rsa
  19. Update here about sftp id_pub to server 2
  20. Update here about server 2 path in /etc/rsnapshot.conf
  21. Update here about running rsnapshot daily
  22. Update here about adding cron entries
  23. Update here about adding a samba share to access the backup from windows.