Remote Mirroring Using nc and dd
You can use the dd and nc commands for exact disk mirroring from one server to another. The following commands send data from Server1 to Server2:
1 2 | Server2# nc -l 12345 | dd of=/dev/sdb Server1# dd if=/dev/sda | nc server2 12345 |
Make sure that you issue Server2's command first so that it's listening on port 12345 when Server1 starts sending its data.
Unless you're sure that the disk is not being modified, it's better to boot Server1 from a RescueCD or LiveCD to do the copy.
Reference: http://www.linuxjournal.com/content/tech-tip-remote-mirroring-using-nc-and-dd
PowerDNS continually dies after creating a slave zone
Issue:
When PowerDNS is configured for a sqlite or sqlite3 backend and a slave zone is added, the PowerDNS daemon continually dies and respawns. This loop persists until the daemon is forcibly terminated.
My logs showed the following:
Jul 29 12:12:38 localhost pdns[14465]: PowerDNS 2.9.22 (C) 2001-2009 PowerDNS.COM BV (Jul 29 2009, 04:47:43, gcc 4.3.3) starting up Jul 29 12:12:38 localhost pdns[14465]: PowerDNS comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it according to the terms of the GPL version 2. Jul 29 12:12:38 localhost pdns[14465]: DNS Proxy launched, local port 22293, remote 192.168.8.1:53 Jul 29 12:12:38 localhost pdns[14465]: Launched webserver on 0.0.0.0:8081 Jul 29 12:12:38 localhost pdns[14465]: Master/slave communicator launching Jul 29 12:12:38 localhost pdns[14465]: Creating backend connection for TCP Jul 29 12:12:38 localhost pdns[14465]: gsqlite3: connection to '/var/lib/powerdns/pdns.db' succesful Jul 29 12:12:38 localhost pdns[14465]: gsqlite3: connection to '/var/lib/powerdns/pdns.db' succesful Jul 29 12:12:38 localhost pdns[14465]: About to create 3 backend threads for UDP Jul 29 12:12:38 localhost pdns[14465]: gsqlite3: connection to '/var/lib/powerdns/pdns.db' succesful Jul 29 12:12:38 localhost pdns[14465]: 1 slave domain needs checking Jul 29 12:12:38 localhost pdns[14465]: Domain domain.local is stale, master serial 349, our serial 0 Jul 29 12:12:38 localhost pdns[14465]: Initiating transfer of 'domain.local' from remote '192.168.8.40' Jul 29 12:12:38 localhost pdns[14465]: gsqlite3: connection to '/var/lib/powerdns/pdns.db' succesful Jul 29 12:12:38 localhost pdns[14465]: AXFR started for 'domain.local', transaction started Jul 29 12:12:38 localhost pdns[14465]: Communicator thread died because of error: Database failed to start transaction: Error while retrieving SQLite query results
Cause:
The PowerDNS sqlite and sqlite3 backends do not support slave zones as of v.2.9.22
Resolution:
Configure PowerDNS to use a different database backend: MySQL, PostgreSQL, Oracle, etc.
Intel Matrix Storage Console Reports SATA Drives as Generation 1 not 2
Issue:
When launching the Intel Matrix Storage Console and reviewing the disposition of a mirrored pair of Seagate SATA 3.0Gb/s drives, I noted the Serial ATA transfer mode reported as Generation 1.
Cause:
SATA host adapters typically support autonegotiation, however, with the Intel ICH10R this does not seem to be the case with RAID enabled. Note: It does work with standard AHCI mode on this chipset.
Resolution:
Seagate drives ship with a jumper enabled for 1.5GB/s mode. One must remove this jumper to force the drive in 3.0GB/s mode.
Attachment: Seagate ST3500320AS product manual.
Cannot SSH into PIX/ASA firewall
Issue:
When attempting to SSH into a PIX/ASA firewall you receive the following error on the client
Investigating the log on the PIX/ASA will yield a corresponding error:
Cause:
The issue is the result of a corrupt or missing RSA key on the firewall.
Resolution:
You need to generate a new RSA key on the firewall.
Magic juju (from either SDM or a prompt):
ca generate rsa key 1024
wr mem
copy run start
rsync failed to set times on [filename]
This error occurs because the version of rsync on the system cannot preserve modified times for directories.
Run rsync with the following arguments to suppress this warning:
rsync -avPO ./source/* ./destination
Explanation of switches:
1 2 3 4 | a -> Archive mode (do not preserve hard links, ACLs, or extended attributes) v -> Verbose (I like to know what is happening) P -> Equivalent to --partial --progress (for long transfers that may be interrupted) O -> Omit directories from times |
Enable opportunistic locking with Sun SMB service on Solaris Nevada
The primary reason for implementing this is performance.
From Microsoft:
Opportunistic locking (oplock) is a mechanism that allows a server to tell a client process that a requested file is only being used by that process. The client can safely do read-ahead and write-behind as well as local caching, knowing that the file will not be accessed or changed in any way by another process while the opportunistic lock is in effect. The server notifies the client when a second process attempts to open or modify the locked file.
Reference: http://msdn.microsoft.com/en-us/library/dd327670.aspx
The snippet:
svccfg -s smb/server setprop smbd/oplock_enable=boolean: true
Create thumbnails en-masse from a bash prompt
A simple one-liner and ffmpeg, basename, and cut gets this done.
1 | for i in *.f4v; do ffmpeg -i `basename $i` -s 320x240 `basename $i | cut -d'.' -f1`.jpg; done |
Thumbnail output size is configurable with the -s switch.
Install VMware Tools on a Gentoo Guest
- emerge pciutils mkinitrd
- mkdir /etc/rc.d
- cd /etc/rc.d
- for i in `seq 0 6`; do mkdir rc$i.d; done
- File -> Install VMware Tools
- mount /mnt/cdrom
- cd /tmp
- tar xvfz /mnt/cdrom/VMwareTools-3.5.0-158874.tar.gz
- cd vmware-tools-distrib/
- ./vmware-install.pl
- All defaults with the exception of:
/etc/rc.d -> location of the rc.d directories
/etc/init.d -> location of the init scripts - When prompted to run vmware-tools-config, decline
- rc-update add vmware-tools default
- /usr/bin/vmware-config-tools.pl
- Verify that everything compiles without error
- Reboot
- Verify that VMware tools are reported as running in the VI console
Note: This was tested and found working under VMware VI 3.5.x with Gentoo x86_64, kernel 2.6.27-gentoo-r8.
Logical Volume Expansion with Linux
- Add additional storage to the system. Physically or virtually.
- fdisk /dev/newdev - create new partition, set as type 8e (LVM), write partition table
- Create a new physical volume on the newly partitioned disk
- Extend an existing volume group
- Extend the logical volume by the desired amount
- Extend the filesystem on the logical volume
1 | pvcreate /dev/newDevPart |
1 | vgextend tank /dev/newDevPart |
1 | lvextend -L +5G /dev/tank/var |
1 | xfs_growfs /var |