- > sis start -s /vol/$volume
- This fixes very slow normal dedup operations due to this bug http://support.netapp.com/NOW/cgi-bin/bol?Type=Detail&Display=657692
- > sis status
- Shows the status and a few settings of all of your volumes
- > df -s /vol/$volume
- Shows some space savings
- > sysstat 1
- Shows you some basic performance stats updated once per second
Saturday, June 29, 2013
A few Netapp dedup commands
Tuesday, June 4, 2013
Compare two files and show the additional lines in one that aren't in the other.
In typical linux fashion there is a tool that does exactly what I need very quickly called join.
Here is a quick example: join -1 3 -2 1 -v 1 < file1 < file2 > output
That is saying use column 3 on file1 ( -1 3 ), and column 1 on file2 ( -2 1 ). It will then show only the lines that are in file1 but not file2 ( -v 1 ).
The files must already be sorted on those columns before you run join.
Sunday, June 2, 2013
Way to create an rpm
It is called fpm and I'm starting to look into it now.
Wednesday, January 16, 2013
Running Parallel Commands on a group of Linux boxes
Wednesday, September 12, 2012
What is taking up all this space?
>>lsof | grep deleted
That showed me the app that was holding on to the space.
>>lsof | grep deleted | awk '{print $1, $2, $7, $9}'
Then on the PID of the app I ran:
>>kill -HUP 8787
Presto, that freed up all the disk space.
Tuesday, December 13, 2011
Issue starting a VM on Citrix Xen after an outage
[root@XENSERVER1 ~]# xe vm-start uuid=4dc9528c-0eb7-38fc-7246-66b387d6aa0e
Error code: SR_BACKEND_FAILURE_46
Error parameters: , The VDI is not available [opterr=VDI aae84c26-4520-45cd-ad66-5e379874f5dd already attached RW],
After a lot of poking and prodding the VM's disks seemed fine.
I tried to export the VM and received this message:
[root@XENSERVER1 ~]# xe vm-export uuid=4dc9528c-0eb7-38fc-7246-66b387d6aa0e filename=/var/run/sr-mount/3184f86f-9743-b819-5cd5-e84ccf7e7c6c/win-server-export.vdi
The server failed to handle your request, due to an internal error. The given message may give details useful for debugging the problem.
message: Failure("The VDI aae84c26-4520-45cd-ad66-5e379874f5dd is already attached in RW mode; it can't be attached in RO mode!")
That got me on the right track and I did this:
[root@XENSERVER1 ~]# xe-toolstack-restart
Stopping xapi: .. [ OK ]
Stopping the v6 licensing daemon: [ OK ]
Stopping the memory ballooning daemon: [ OK ]
Stopping perfmon: [ OK ]
Stopping the fork/exec daemon: [ OK ]
Stopping the multipath alerting daemon: [ OK ]
Starting the multipath alerting daemon: [ OK ]
Starting the fork/exec daemon: [ OK ]
Starting perfmon: [ OK ]
Starting the memory ballooning daemon: [ OK ]
Starting the v6 licensing daemon: [ OK ]
Starting xapi: ....start-of-day complete. [ OK ]
done.
And presto the VM booted:
[root@XENSERVER1 ~]# !250
xe vm-start uuid=4dc9528c-0eb7-38fc-7246-66b387d6aa0e
The problem was that XENSERVER1 was the only one that was not rebooted during the outage since it was the master.
Tuesday, December 6, 2011
Simple log/file rotation
In the past I have written scripts that would check how many files were there or used find to delete
old only.
I wondered if I could use logrotate to handle this since it is installed on most systems and is simple to use.
Unfortunately it doesn't understand the term hourly and only does daily and monthly.
I wrote my backup script and created a simple logrotate.conf file but left out the section that said
how often to run.
[root@server1 bin]# cat backup-www-db.logrotate
/var/database_backup/mysql_dump.sql {
# hourly
rotate 24
compress
delaycompress
missingok
create 640 root adm
}
Then I just told the backup script to run logrotate as the first thing it does giving it that config file:
/usr/sbin/logrotate /usr/adm/bin/backup-www-db.logrotate
It rotates the previous database dump and compresses them.
It only runs when the script runs so I set cron to run every hour and we have a nice simple solution.
Cloning Redhat Servers in Vmware and networking
I found that udev had the MAC's for the old server hard coded and did not clean them up on the reboot.
Commenting out the old lines and rebooting forced udev to recreate new entries and away we went.
{ krkardlnxapp2 } [ /etc/udev/rules.d ]$ cat 70-persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.
# PCI device 0x15ad:0x07b0 (vmxnet3) (custom name provided by external tool)
#SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:56:b5:00:c9", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x15ad:0x07b0 (vmxnet3)
#SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:56:b5:08:a0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
# PCI device 0x15ad:0x07b0 (vmxnet3)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:56:b5:08:a0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
Monday, November 22, 2010
Solaris Ldom's
I installed version 1.3 of the Ldom software which I downloaded directly from Oracle. ( LDoms_Manager-1_3.zip )
The software has an installer that sets up many of the things you need.
One thing I found after looking around was that the networking inside a guest couldn't talk to the outside world.
I adjusted the networking including plumbing the virtual switch and giving it the same MAC as the underlying nxge4 ( 10G ) interface.
ifconfig nxge0 down
ifconfig nxge0 unplumb
ifconfig vsw0 plumb
ifconfig vsw0 X.X.X.X netmask 255.255.255.0
ifconfig vsw0 up
mv /etc/hostname.nxge4 /etc/hostname.vsw0
ldm remove-vswitch primary-vsw0
ldm add-vsw mac-addr=0:14:4f:c1:c2:c8 net-dev=nxge4 primary-vsw0 primary
Now on to the guest:
First I created two zfs zvols. One for the OS and one for a zpool.
zfs create -V 12000m pool0/vdomains/ldom2
zfs create -V 100g pool0/vdomains/zpool-ldom2
To install solaris inside the guest I am going to use the 10u9 iso image and have it in /tmp/iso/sol-10-u9-ga-sparc-dvd.iso
I gave it 4G of RAM and 1 virtual CPU:
ldm add-domain ldom2
ldm stop test1
ldm add-vcpu 1 ldom2
ldm add-memory 4096m ldom2
ldm add-vnet vnet1 primary-vsw0 ldom2
ldm add-vdsdev /dev/zvol/dsk/pool0/vdomains/ldom2 zdisk2@primary-vds0
ldm add-vdisk zdisk2 zdisk2@primary-vds0 ldom2
ldm add-vdsdev /dev/zvol/dsk/pool0/vdomains/zpool-ldom2 zdisk3@primary-vds0
ldm add-vdisk zdisk3 zdisk3@primary-vds0 ldom2
ldm add-vdsdev /tmp/iso/sol-10-u9-ga-sparc-dvd.iso iso_vol@primary-vds0
ldm-vdisk vdisk vdisk_iso iso_vol@primary-vds0 ldom2
ldm bind-domain ldom2
ldm set-variable autoboot\?=false ldom2
ldm start ldom2
Now I can telnet to port 5000 on the localhost and I'll will be on the console but the machine will be at the OK> prompt.
Type: show-disks to find the ISO, or CDROM link and then type boot and the long path to boot off the ISO.
I did a typical Solaris install for the guest and actually used a flar.
Once the install was done I created a zpool on the second disk and I had a fully working solaris guest with zfs inside.
To get the guest to book automatically and not stop at the OK> prompt each time I changed the autoboot to true from false.
Thursday, October 14, 2010
Look at the latest patch number in solaris
showrev -p | perl -lane '($p,$rev) = ($F[1] =~ /(\d+)-(\d+)/); $has{$p}=$rev if $has{$p}<$rev; END { map { print "$_-$has{$_}" } sort keys %has }'
Friday, August 27, 2010
Deleting all the blastwave packages on a Solaris node
Friday, February 5, 2010
ludelete problem in Live Upgrade
Thursday, February 4, 2010
Solaris PCA patch utility
Thursday, January 21, 2010
Bash History
Thursday, January 14, 2010
How to convert a mac from Cisco/Foundry format to Unix format
Tuesday, July 14, 2009
Updating the file extension association in OSX
I wanted to change the association of the .avi extention on my MacBook Pro running Leopard to VLC.
To do it, right click on the file and click Get Info. Then at the bottom of the drop down menu change the program from the list. Then click "Change All" button if you want to change it for every file.
Sunday, July 12, 2009
Linksys WAP54G and DD-WRT
I am staying in a place that has a nice connection and wireless. Perfect for my Macbook Pro, not so good for the desktop. I found a v3 WAP54G and thought I would just hook it up as a wireless client and put my desktop behind that. Well, it turns out that isn't as easy as one might hope.
All is not lost, welcome DD-WRT. I went here: http://www.dd-wrt.com/wiki/index.php/Installation
and downloaded this firmware: http://www.dd-wrt.com/dd-wrtv2/downloads/stable/dd-wrt.v24%20SP1/Consumer/Linksys/WAP54G_v3/dd-wrt.v24_micro_generic.bin
I uploaded it on to the Linksys through their firmware upgrade page and when it was done I pulled the plug and waited about 15sec ( I was impatient! ).
After some trial and error ( and wondering ) I found it at http://192.168.1.1
I set wireless to be client, put in the house SSID, and under Wireless Security, I set the Security mode and entered the house WPA Shared Key.
I also made sure my internal LAN network ( 192.168.1.0/24 ) was NOT the same as the house LAN network. The house is set to be 192.168.0.0/24 so I was okay, however I changed it to a 172.16.1.0/24 network just to make sure there wasn't any confusion.
I set up the DHCP server for the LAN, told it to use the House Router as it's primary DNS and then use OpenDNS http://opendns.com ( 208.67.222.222 and 208.67.220.220 ) as the second and third. I've been very happy with OpenDNS and highly recommend it.
So now, my workstation is behind the WAP54G which is acting like a firewall/router to the house network and all is happy.
I'll probably set up some port forwarding so I can talk to my workstation from the office but that is trivial under DD-WRT.
I am very pleased with how well it is working and how easy it was to set up. There is a tone of info in the interface and I'm going to enjoy playing around with it.
Friday, July 10, 2009
Clock setting in Linux
In almost all applications time being in sync is very important. Even simple logging needs accurate time to keep the logs in tune.
Servers have a hardware clock and an OS software clock and both need to be in sync as well as in sync with a certified time source.
If you already use NTP to keep your software clock in sync with a certified time source it is pretty easy to keep your hardware clock up to date with the OS time.
Here are some basic commands:
To set the syste/OSm clock from the hardware clock:
#> sudo hwclock --hctosys
Likewise if your hardware clock is set incorrectly (for example, if you replaced the
CMOS battery on your motherboard), you can set the hardware clock from your system clock as follows:
Likewise, set the hardware clock from the software/OS clock:
#> hwclock --systohc
As always, there are a lot more options available so check out the man pages.
Tuesday, July 7, 2009
How to add a disk to a vmware linux guest without rebooting
Today I wanted to add another disk to a running guest and couldn't reboot it.
ESX let me add the disk but the CentOS 5.3 guests didn't see it automatically.
I ran this command:
echo - - - > /sys/class/scsi_host/host0/scan
and then the disk showed up under fdisk -l
Put a new LVM on it, added a filesystem, and mounted it.
Vlan tagging between HP and Cisco switches
- On the HP set traffic on the trunk port to be tagged for every VLAN you want to propagate
- Allow access to the VLAN on the non-trunk ports but set them to be untagged