-C, --cvs-exclude auto-ignore files in the same way CVS does
Wednesday, April 22, 2009
Beware of rsync -C option.
Monday, July 31, 2006
Backing-up OSCAR 5 Data
tar cf /backup/oscar.tar /opt/kernel_picker /etc/systemimager /etc/dhcpd.conf /etc/profile.d/00-modules.* /etc/profile.d/c3.* /etc/profile.d/oscar_home.* /etc/profile.d/ssh-oscar.* /etc/systeminstaller /opt/env-switcher* /opt/lam* /opt/maui /opt/modules /opt/mpich* /opt/pbs /opt/perl-Qt /opt/sync_files /tftpboot/initrd.img /tftpboot/kernel /tftpboot/pxelinux.* /usr/lib/systemimager /usr/lib/systeminstaller /var/lib/ganglia /var/lib/mysql /var/lib/oscar /var/lib/systemimager /var/log/systemimager /var/spool/pbs /opt/oscar /etc/httpd/conf.d/ganglia.conf /etc/ssh
Backing-up OSCAR 3 Nodes by Hand
rsync -avxHS --numeric-ids --delete --exclude 'lost+found' --exclude '/tmp/*' --exclude '/var/spool/clientmqueue/*' --exclude '/var/spool/pbs/aux/*' --exclude '/var/spool/pbs/mom_logs/*' --exclude '/var/spool/pbs/mom_priv/jobs/*' --exclude '/var/spool/pbs/spool/*' --exclude '/var/spool/pbs/undelivered/*' --exclude '*.pid' --exclude '*.lock' --exclude 'swapfile0' / 10.0.0.254:/usr/cluster/nodes/oscar3/root/and also this:
rsync -avxHS --numeric-ids --delete --exclude 'lost+found' --delete-excluded /boot/ 10.0.0.254:/usr/cluster/nodes/oscar3/boot/Done. (Update: please be careful about the directories that has been ignored... I don't trust the exclude expression.)
Reimaging OSCAR 3 Nodes by Hand
Hard drive failure and irreparable filesystem are pretty common during the operation the cluster, the first thought that comes to us always is to re-imaging the pre-stored image from the server. However in OSCAR (at least in v3 as well as v4) you need to flush the OpenPBS setting or restart the PBS server. That causes a lot of problem if you have a lot of jobs running on the rest of the computing nodes. Here is my notes to reimage OSCAR 3 nodes manually:
- pxe boot into fc2 installation untill load into gui(stage2)
- alt-F2 enter the shell
- To erase the previous partition, do:
parted -s -- /dev/sda mklabel msdos parted -s -- /dev/sda print
- Then build the partition table:
parted -s -- /dev/sda mkpart primary ext2 0 24 parted -s -- /dev/sda mkpart extended 24 76319 parted -s -- /dev/sda mkpart logical 24 2072 parted -s -- /dev/sda mkpart logical ext2 2072 76319
- Format the partition:
mke2fs /dev/sda6 mkswap /dev/sda5 mke2fs /dev/sda1 mkdir -p /a/boot mount /dev/sda6 /a/ mount /dev/sda1 /a/boot/
- FC2 boot disk doesn't have rsync, retrieving from the server:
scp 10.0.0.254:/usr1/cluster/nodes/rayl3/root/usr/bin/rsync /usr/bin/
- Copy:
rsync -avxHS --numeric-ids --exclude 'lost+found' \ 10.0.0.254:/usr/cluster/nodes/oscar3/root/ /a/ rsync -avxHS --numeric-ids --exclude 'lost+found' \ 10.0.0.254:/usr/cluster/nodes/oscar3/boot/ /a/boot/ - Create swapfile since we have extra swap requirement for gaussian and didn't enlarge the swap size at the first place:
dd if=/dev/zero of=/a/var/vm/swapfile0 bs=1M count=1024 mkswap /a/var/vm/swapfile0
- Modify the files /etc/sysconfig/network, /etc/sysconfig/network-scripts/ifcfg-eth0, /etc/pfilter.cmds, /etc/pfilter.src for ip address
- Restoring GRUB
chroot /a/ grub root (hd0,0) setup (hd0) quit exit
- Reboot, Change the BIOS boot sequence if necessary.
Thursday, December 29, 2005
Rsnapshot on Fedora Linux
I've been evaluating possible deployment of rsnapshot since the RAID0 catastrophe we had on our lab portal. I need an automatic backing-up scheme with historical copies on different time frames. This can prevent failing filesystem from destroying the master copy. Of course, we cannot guarantee anything without diligent monitoring the logs.
According to the website,
- "rsnapshot is a filesystem snapshot utility for making backups of local and remote systems. Using rsync and hard links, it is possible to keep multiple, full backups instantly available."
There are two way to backup the data on the workstations from the backup server, you can actively push the backup to the server or suck the backup on the workstations from the server. Due to the security concerns on the workstations, opening a read-only, exclusive NFS export for the server or opening exclusive rsync access seem to be more secure.
I am not familiar securing rsync:// server at this point, and I am a little bit lazy designing new procedure in the meantime. Without hesitation, I chose to use NFS on the workstations.
In Redhat/Fedora flavored Linux, there is a default autofs rule on /net directory that can mount remote NFS volumes without writing the autofs configurations for mount points and locations. So the rsnapshot configuration is very easy under this setup, I only need to specify interval and backup rules. These are my part of configuration...
--- /etc/rsnapshot.conf.default 2005-04-09 15:59:25.000000000 -0700 +++ /etc/rsnapshot.conf 2005-12-28 22:44:36.000000000 -0800 @@ -23,7 +23,8 @@ ########################### # All snapshots will be stored under this root directory. -snapshot_root /.snapshots/ +#snapshot_root /.snapshots/ +snapshot_root /backup/ # If no_create_root is enabled, rsnapshot will not automatically create the # snapshot_root directory. This is particularly useful if you are backing @@ -49,7 +50,7 @@ cmd_rsync /usr/bin/rsync # Uncomment this to enable remote ssh backups over rsync. -#cmd_ssh /usr/bin/ssh +#cmd_ssh /usr/bin/ssh # Comment this out to disable syslog support. cmd_logger /usr/bin/logger @@ -63,7 +64,7 @@ # i.e. hourly, daily, weekly, etc. # ######################################### -interval hourly 6 +interval hourly 3 interval daily 7 interval weekly 4 #interval monthly 3 @@ -105,6 +106,8 @@ #include ??? #exclude ??? #exclude ??? +exclude 'swapfile*' +exclude 'lost+found' # The include_file and exclude_file parameters, if enabled, simply get # passed directly to rsync. Please look up the --include-from and @@ -115,8 +118,9 @@ # Default rsync args. All rsync commands have at least these options set. # -#rsync_short_args -a +rsync_short_args -a #rsync_long_args --delete --numeric-ids --relative --delete-excluded +rsync_long_args --bwlimit=1024 --delete --numeric-ids --relative --delete-excluded # ssh has no args passed by default, but you can specify some here. # @@ -145,14 +149,27 @@ ############################### # LOCALHOST -backup /home/ localhost/ -backup /etc/ localhost/ -backup /usr/local/ localhost/ +#backup /home/ localhost/ +#backup /etc/ localhost/ +#backup /usr/local/ localhost/ #backup /etc/passwd localhost/ #backup /home/foo/My Documents/ localhost/ #backup /foo/bar/ localhost/ one_fs=1, rsync_short_args=-urltvpog #backup_script /usr/local/bin/backup_pgsql.sh localhost/postgres/ +# NFS +#backup /net/KOON/ QUEEN/ +#backup /net/PARTHENON/home/ PARTHENON/ +backup /net/ATROPOS/ ATROPOS/ +backup /net/LACHESIS/ LACHESIS/ +backup /net/CLOTHO/home/ KLOTHO/ +backup /net/MARJAR/ MARJAR/ +backup /net/TOKI/ TOKI/ +backup /net/SSIZZ/home/ SSIZZ/ +backup /net/MACHI/homedisk/ MACHI/ +backup /net/KYO/usr/home/ KYO/ +backup /net/AUXO/home/ AUXO/ + # EXAMPLE.COM #backup root@example.com:/home/ example.com/ #backup root@example.com:/etc/ example.com/also don't forget the crontab:
0 0,8,16 * * * rsnapshot hourly 50 23 * * * rsnapshot daily 40 23 1,8,15,22 * * rsnapshot weekly 30 23 1 * * rsnapshot monthly
The foreseeable problem is the bandwidth and intensity of local I/O, that's why I use "--bwlimit=1024" to use only 1Mbps for single rsync session. Also only 3 hourly backup will be performed for one day to avoid overlapping slow backing up progress.
Wednesday, August 17, 2005
Software RAID on FC4
This is my configuration: 1GB*3 for /dev/md0 as RAID1 mirror on /boot while 36GB for /dev/md1 as RAID5 on the root (/). So in the end I have 1G for /boot (actually too much) and 71G for the root. I tested two scenarios as followed:
- One disk removed then reconnected.
- First disck failed.
To reconnect a raid member back to RAID1/RAID5, use this example: mdadm /dev/md0 -a /dev/hdb2, before doing this, a mdadm -D /dev/md0 can give you more idea. Every time you disconnect a disk and boot it up, you have to re-add the missing disk next time. Damn you software raid....
One the problem we can see is that if the first disk fails, the machine cannot continue its service because the grub is still on the first disk (e.g., /dev/hda). To solve this, we can install grub in any disk other than first one. Why? Because if two disks fail, it dies. Then we can run grub to setup.
grub> device (hd1) /dev/hdb grub> root (hd1,0) grub> setup (hd1)Use exit or quit to leave grub. Now edit the /boot/grub/grub.conf, add this line before the first title line:
fallback=1(supposed that you have only one boot menu, if the first menu fails, it goes to the second menu.) and copy the first menu and append after first menu, but replace hd0 to hd1. Now it's done. This is my grub.conf:
default=0
faillback=1
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Fedora Core (2.6.11-1.1369_FC4)
root (hd0,0)
kernel /vmlinuz-2.6.11-1.1369_FC4 ro root=/dev/md0 rhgb quiet
initrd /initrd-2.6.11-1.1369_FC4.img
title Fallback Fedora Core (2.6.11-1.1369_FC4)
root (hd1,0)
kernel /vmlinuz-2.6.11-1.1369_FC4 ro root=/dev/md0 rhgb quiet
initrd /initrd-2.6.11-1.1369_FC4.imgNow we can allow the first disk failing and still boot ....
Monday, October 27, 2003
Proposal: Lab computing environment
- Remember, we are in labs for computing, not computer labs.
- Your lab might fall apart after you leave (, so why bother? @_@).
- Avoid sharing desktops.
- Never try to improve boss' system unless required.
- Everyone should be responsible for backing up his or her data.
- Never mount each other between two hosts!!!!
- Always use automount(8)/autofs(8) for users' machines
- Never give others root nor even sudo permission unless he or she is capable to do things.
- There gonna be a central file server with RAID (level 1 or 5).
- Never activate auto-update features if the users can not figure out the problems when an update fails.
- NIS is not a good idea unless there are some other administrators available. (Systems always crash after the adms are in vacation.)