Reset Master Boot Record (MBR)

Since I’ve been playing with my AutoYAST setup for the last few days, working out the kinks (for example SLES10 not being able to install into the MBR), I needed a way to zap the MBR (as in remove grub to see whether or not the installation would install a new loader). So after quickly googling, I found this: 1 dd if=/dev/zero of=/dev/hda bs=512 count=1 That actually does the trick. The loader as well as the partition table are gone after wards!

August 8, 2014 · 1 min · 82 words · christian

Enabling multipathing in autoyast installations

As I mentioned before, we’re starting to utilize Boot-from-SAN as a means to strip the blades of their local disk. As the title says, after trying a manual installation of SLES 11.1 via CD/HTTP I wanted to automate the process, in order to get a reproducible, consistent installation method. As you might have figured, AutoYaST doesn’t have any built in support for configuring multipathing (hey, that’s what Novell says here). Now, they also provide a comprehensive how-to on how to “add” this to your AutoYaST, using a DUD (or D river U pdate D isk). ...

August 8, 2014 · 3 min · 631 words · christian

NetApp FAS/Data ONTAP public key authentification with CIFS/NFS license

Well as the title says, sadly we bought our FAS6210 without CIFS/NFS license. Thus, in order to create the folder structure/add the authorized_keys file, you’ll have to work for your money a little bit. First, you need to run cifs setup / cifs passwd somewhere. I did it on our Data ONTAP simulator, which comes in handy for things like that. You’ll get a cryptic looking password (no clue which format that is), looking like this: _OnWddr)xa. ...

August 8, 2014 · 2 min · 304 words · christian

IBM SVC: Copy VDisk Host-Mapping from one host to another

As I wrote a few days ago, I started a new job. One of my first (voluntary) tasks was writing a shell script which would copy a VDisk Host-Mapping from a given host to another. This is useful, if you do have a lot of ESX servers for example and a few roaming ones. Now, if say, you need to do some ESX-Updates and you would like to add the roaming one to a given farm, you would be in a dark an deary place. You would be required to either click through the GUI a dozen times (in my case, it might have needed ~200 clicks) or type svcinfo lshostvdiskmap and svctask mkhostvdiskmap -force (these are incomplete command references) a few times. ...

August 8, 2014 · 2 min · 404 words · christian

NetApp - Copy LUN mappings

Well, today I had another idea (basically like the one I wrote for SVC’s VDisk mappings a while back) for a script: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 #!/bin/bash KEY_FILE="/root/.ssh/netapp.dsa" SSH_OPTS="/root/.ssh/netapp-ssh_config" if [ $# -ne 3 ] ; then echo "fas-copy-lunmap: FAS_CONTROLLER SOURCE_IGROUP TARGET_IGROUP" echo echo "Copy the LUN map from one igroup to another, ie for ESX reinstallation" echo echo " Usage:" echo " - FAS_CONTROLLER: Hostname/IP-adress of the DATA ONTAP controller" echo " - SOURCE_IGROUP: igroup that is used as a reference for the copy process" echo " - TARGET_IGROUP: igroup that is actually modified" echo exit 1 fi FAS_CTRL=$1 SOURCE=$2 TARGET=$3 ssh_fas() { # $@: commands for Data ONTAP COMMANDS="$@" /usr/bin/ssh -i $KEY_FILE -l root -F $SSH_OPTS $COMMANDS } #set -x # Get the lun list. for lun in $( ssh_fas $FAS_CTRL lun show -g $SOURCE | awk '{ print $1 }' | sort -u ); do # Get the LUN number its mapped LUN_ID="$( ssh_fas $FAS_CTRL lun show -m $lun | grep "^/vol" | awk '{ print $3 }' )" # If the LUN id is 0, skip otherwise we would copy the boot LUN if [ "$LUN_ID" != "0" ] ; then # Actually map the lun to our host echo "Mapping $lun to $TARGET as LUN_ID $LUN_ID" ssh_fas $FAS_CTRL lun map $lun $TARGET $LUN_ID fi done #set +x I’ll post the counterpart of the script (to remove the LUNs) in a second post later on.

August 8, 2014 · 2 min · 279 words · christian

Installserver: Regenerate PXE base menu

Well, here’s the promised script to regenerate the main PXE menu based on the menu entries created by register-suse and register-vmware. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 #!/bin/bash TFTP_DIR=/srv/tftpboot/pxelinux.cfg mkdir -p $TFTP_DIR &>/dev/null # Iterate through the pxelinux.cfg directory and recreate the index menues. for dir in $( find $TFTP_DIR -mindepth 1 -maxdepth 1 -type d ); do echo "Generating summary menu for: $dir" count=1 cat > $dir.menu << EOF MENU TITLE Linux Installationservices MENU BACKGROUND addons/background.png MENU COLOR screen 37;40 #80ffffff #00000000 MENU COLOR border 0 #ffffffff #ee000000 std MENU COLOR title 0 #ffffffff #ee000000 std MENU COLOR unsel 0 #ffffffff #ee000000 std MENU COLOR sel 0 #ffffffff #85000000 std MENU COLOR scrollbar 30;44 #40000000 #00000000 MENU COLOR tabmsg 0 #ee000000 #ffffffff std MENU COLOR cmdmark 0 #ff00ff00 #00000000 std MENU COLOR cmdline 0 #ee000000 #ffffffff std MENU COLOR timeout_msg 0 #ee000000 #ffffffff std MENU COLOR timeout 0 #ee000000 #ffffffff std MENU COLOR disabled 0 #ffffffff #ee000000 std MENU COLOR pwdheader 0 #ff000000 #99ffffff rev MENU COLOR pwdborder 0 #ff000000 #99ffffff rev MENU COLOR pwdentry 0 #ff000000 #99ffffff rev MENU COLOR hotkey 0 #ff00ff00 #ee000000 std MENU COLOR hotsel 0 #ffffffff #85000000 std EOF for file in $( find $dir -mindepth 1 -name "*.menu" | sort -r ); do FILE_LABEL="$( grep ^#LABEL $file | cut -d -f2- )" FILE_OSARCH="$( grep ^#OSARCH $file | cut -d -f2- )" cat >> $dir.menu << EOF LABEL $count MENU LABEL $FILE_LABEL ($FILE_OSARCH) KERNEL addons/vesamenu.c32 APPEND pxelinux.cfg/${dir##*/}/${file##*/} EOF count=$(( $count + 1 )) done done 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 Tue Jul 24, 17:18:35 [0] > ll -R /srv/tftpboot/ /srv/tftpboot/: total 28K drwxr-xr-x 2 root root 4.0K Jun 20 2011 addons/ drwxr-xr-x 7 root root 4.0K Jun 24 2011 boot/ drwxr-xr-x 6 root root 4.0K Jul 20 13:14 pxelinux.cfg/ -rw-r--r-- 1 root root 15K Oct 7 2009 pxelinux.0 /srv/tftpboot/addons: total 280K -rw-r--r-- 1 root root 16K Dec 28 2009 background.png -rw-r--r-- 1 root root 23K Dec 28 2009 background-sles.png -rw-r--r-- 1 root root 24K Dec 28 2009 background-suse.png -rw-r--r-- 1 root root 20K Dec 28 2009 background-vmware.png -rw-r--r-- 1 root root 48K Oct 7 2009 mboot.c32 -rw-r--r-- 1 root root 142K Oct 7 2009 vesamenu.c32 /srv/tftpboot/boot: total 20K drwxr-xr-x 3 root root 4.0K Jun 24 2011 esx/ drwxr-xr-x 2 root root 4.0K Oct 14 2009 firmware/ drwxr-xr-x 5 root root 4.0K Dec 14 2011 opensuse/ drwxr-xr-x 10 root root 4.0K Mar 9 17:28 sles/ drwxr-xr-x 3 root root 4.0K Oct 7 2009 tests/ /srv/tftpboot/boot/esx: total 4.0K drwxr-xr-x 2 root root 4.0K Jun 24 2011 4.1-348481/ /srv/tftpboot/boot/esx/4.1-348481: total 81M -r--r--r-- 1 root root 79M Jun 24 2011 initrd.img -r--r--r-- 1 root root 1.5M Jun 24 2011 vmlinuz /srv/tftpboot/boot/firmware: total 4.3M -rw-r--r-- 1 root root 1.5M Oct 14 2009 fdboot.img -rw-r--r-- 1 root root 20K Oct 14 2009 memdisk -rw-r--r-- 1 root root 1.5M Oct 14 2009 qmh2462_1.76.img -rw-r--r-- 1 root root 1.5M Oct 14 2009 qmh2462_1.81.img /srv/tftpboot/boot/opensuse: total 12K drwxr-xr-x 4 root root 4.0K Jun 20 2011 11.3/ drwxr-xr-x 4 root root 4.0K Jun 20 2011 11.4/ drwxr-xr-x 4 root root 4.0K Dec 14 2011 12.1/ /srv/tftpboot/boot/opensuse/11.3: total 8.0K drwxr-xr-x 2 root root 4.0K Jun 20 2011 x64/ drwxr-xr-x 2 root root 4.0K Jun 20 2011 x86/ /srv/tftpboot/boot/opensuse/11.3/x64: total 32M -r--r--r-- 1 root root 28M Jun 20 2011 initrd -r--r--r-- 1 root root 3.8M Jun 20 2011 linux /srv/tftpboot/boot/opensuse/11.3/x86: total 32M -r--r--r-- 1 root root 28M Jun 20 2011 initrd -r--r--r-- 1 root root 3.7M Jun 20 2011 linux /srv/tftpboot/boot/opensuse/11.4: total 8.0K drwxr-xr-x 2 root root 4.0K Jun 20 2011 x64/ drwxr-xr-x 2 root root 4.0K Jun 20 2011 x86/ /srv/tftpboot/boot/opensuse/11.4/x64: total 37M -r--r--r-- 1 root root 33M Jun 20 2011 initrd -r--r--r-- 1 root root 4.1M Jun 20 2011 linux /srv/tftpboot/boot/opensuse/11.4/x86: total 37M -r--r--r-- 1 root root 33M Jun 20 2011 initrd -r--r--r-- 1 root root 3.9M Jun 20 2011 linux /srv/tftpboot/boot/opensuse/12.1: total 8.0K drwxr-xr-x 2 root root 4.0K Dec 14 2011 x64/ drwxr-xr-x 2 root root 4.0K Dec 14 2011 x86/ /srv/tftpboot/boot/opensuse/12.1/x64: total 43M -r--r--r-- 1 root root 39M Dec 14 2011 initrd -r--r--r-- 1 root root 4.5M Dec 14 2011 linux /srv/tftpboot/boot/opensuse/12.1/x86: total 43M -r--r--r-- 1 root root 38M Dec 14 2011 initrd -r--r--r-- 1 root root 4.4M Dec 14 2011 linux /srv/tftpboot/boot/sles: total 32K drwxr-xr-x 4 root root 4.0K Jun 24 2011 10.2/ drwxr-xr-x 4 root root 4.0K Sep 28 2011 10.3/ drwxr-xr-x 4 root root 4.0K Jun 17 2011 10.4/ drwxr-xr-x 4 root root 4.0K Jun 17 2011 11/ drwxr-xr-x 4 root root 4.0K Jun 17 2011 11.1/ drwxr-xr-x 4 root root 4.0K Jun 17 2011 11.1-vmware/ drwxr-xr-x 3 root root 4.0K Mar 9 17:28 11.2/ drwxr-xr-x 4 root root 4.0K Jul 24 17:04 11.2-vmware/ /srv/tftpboot/boot/sles/10.2: total 8.0K drwxr-xr-x 2 root root 4.0K Jun 24 2011 x64/ drwxr-xr-x 2 root root 4.0K Jun 24 2011 x86/ /srv/tftpboot/boot/sles/10.2/x64: total 11M -r--r--r-- 1 root root 9.0M Jun 24 2011 initrd -r--r--r-- 1 root root 1.4M Jun 24 2011 linux /srv/tftpboot/boot/sles/10.2/x86: total 11M -r--r--r-- 1 root root 8.9M Jun 24 2011 initrd -r--r--r-- 1 root root 1.3M Jun 24 2011 linux /srv/tftpboot/boot/sles/10.3: total 8.0K drwxr-xr-x 2 root root 4.0K Sep 28 2011 x64/ drwxr-xr-x 2 root root 4.0K Sep 28 2011 x86/ /srv/tftpboot/boot/sles/10.3/x64: total 12M -r--r--r-- 1 root root 11M Sep 28 2011 initrd -r--r--r-- 1 root root 1.4M Sep 28 2011 linux /srv/tftpboot/boot/sles/10.3/x86: total 12M -r--r--r-- 1 root root 11M Sep 28 2011 initrd -r--r--r-- 1 root root 1.3M Sep 28 2011 linux /srv/tftpboot/boot/sles/10.4: total 8.0K drwxr-xr-x 2 root root 4.0K Jun 17 2011 x64/ drwxr-xr-x 2 root root 4.0K Jun 17 2011 x86/ /srv/tftpboot/boot/sles/10.4/x64: total 13M -r--r--r-- 1 root root 12M Jun 17 2011 initrd -r--r--r-- 1 root root 1.4M Jun 17 2011 linux /srv/tftpboot/boot/sles/10.4/x86: total 13M -r--r--r-- 1 root root 12M Jun 17 2011 initrd -r--r--r-- 1 root root 1.3M Jun 17 2011 linux /srv/tftpboot/boot/sles/11: total 8.0K drwxr-xr-x 2 root root 4.0K Jun 17 2011 x64/ drwxr-xr-x 2 root root 4.0K Jun 17 2011 x86/ /srv/tftpboot/boot/sles/11/x64: total 24M -r--r--r-- 1 root root 21M Jun 17 2011 initrd -r--r--r-- 1 root root 2.5M Jun 17 2011 linux /srv/tftpboot/boot/sles/11/x86: total 23M -r--r--r-- 1 root root 21M Jun 17 2011 initrd -r--r--r-- 1 root root 2.4M Jun 17 2011 linux /srv/tftpboot/boot/sles/11.1: total 8.0K drwxr-xr-x 2 root root 4.0K Jun 17 2011 x64/ drwxr-xr-x 2 root root 4.0K Jun 17 2011 x86/ /srv/tftpboot/boot/sles/11.1/x64: total 27M -r--r--r-- 1 root root 23M Jun 17 2011 initrd -r--r--r-- 1 root root 3.1M Jun 17 2011 linux /srv/tftpboot/boot/sles/11.1/x86: total 26M -r--r--r-- 1 root root 23M Jun 17 2011 initrd -r--r--r-- 1 root root 3.1M Jun 17 2011 linux /srv/tftpboot/boot/sles/11.1-vmware: total 8.0K drwxr-xr-x 2 root root 4.0K Jun 17 2011 x64/ drwxr-xr-x 2 root root 4.0K Jun 17 2011 x86/ /srv/tftpboot/boot/sles/11.1-vmware/x64: total 27M -r--r--r-- 1 root root 23M Jun 17 2011 initrd -r--r--r-- 1 root root 3.1M Jun 17 2011 linux /srv/tftpboot/boot/sles/11.1-vmware/x86: total 26M -r--r--r-- 1 root root 23M Jun 17 2011 initrd -r--r--r-- 1 root root 3.1M Jun 17 2011 linux /srv/tftpboot/boot/sles/11.2: total 4.0k drwxr-xr-x 2 root root 4.0K Mar 9 17:29 x64/ /srv/tftpboot/boot/sles/11.2/x64: total 36M -r--r--r-- 1 root root 33M Mar 9 17:29 initrd -r--r--r-- 1 root root 3.7M Mar 9 17:29 linux /srv/tftpboot/boot/sles/11.2-vmware: total 8.0K drwxr-xr-x 2 root root 4.0K Mar 9 16:52 x64/ drwxr-xr-x 2 root root 4.0K Jul 24 17:05 x86/ /srv/tftpboot/boot/sles/11.2-vmware/x64: total 36M -r--r--r-- 1 root root 33M Jul 20 12:46 initrd -r--r--r-- 1 root root 3.7M Jul 20 12:46 linux /srv/tftpboot/boot/sles/11.2-vmware/x86: total 35M -r--r--r-- 1 root root 32M Jul 24 17:17 initrd -r--r--r-- 1 root root 3.6M Jul 24 17:17 linux /srv/tftpboot/boot/tests: total 4.0K drwxr-xr-x 2 root root 4.0K Oct 7 2009 memtest/ /srv/tftpboot/boot/tests/memtest: total 164K -rw-r--r-- 1 root root 157K Oct 7 2009 memtest86+-4.00 /srv/tftpboot/pxelinux.cfg: total 48K -rw-r--r-- 1 root root 2.0K Jun 20 2011 default drwxr-xr-x 2 root root 4.0K Jun 24 2011 esx/ -rw-r--r-- 1 root root 1.3K Jul 24 17:18 esx.menu drwxr-xr-x 2 root root 4.0K Jun 20 2011 esxi/ -rw-r--r-- 1 root root 1.1K Jul 24 17:18 esxi.menu -rw-r--r-- 1 root root 423 Oct 20 2009 firmware.menu drwxr-xr-x 2 root root 4.0K Dec 14 2011 opensuse/ -rw-r--r-- 1 root root 1.8K Jul 24 17:18 opensuse.menu -rw-r--r-- 1 root root 2.6K Jun 4 2010 rescue.menu drwxr-xr-x 2 root root 4.0K Jul 24 17:05 sles/ -rw-r--r-- 1 root root 2.7K Jul 24 17:18 sles.menu -rw-r--r-- 1 root root 329 Oct 20 2009 tests.menu /srv/tftpboot/pxelinux.cfg/esx: total 8.0K -rw-r--r-- 1 root root 1.9K Jun 24 2011 esx-4.1-260247.menu -rw-r--r-- 1 root root 1.9K Jun 24 2011 esx-4.1-348481.menu /srv/tftpboot/pxelinux.cfg/esxi: total 4.0K -rw-r--r-- 1 root root 1.7K Jun 20 2011 esxi41.menu /srv/tftpboot/pxelinux.cfg/opensuse: total 24K -rw-r--r-- 1 root root 1.8K Jun 20 2011 opensuse-11.3-x64.menu -rw-r--r-- 1 root root 1.8K Jun 20 2011 opensuse-11.3-x86.menu -rw-r--r-- 1 root root 1.8K Jun 20 2011 opensuse-11.4-x64.menu -rw-r--r-- 1 root root 1.8K Jun 20 2011 opensuse-11.4-x86.menu -rw-r--r-- 1 root root 1.8K Dec 14 2011 opensuse-12.1-x64.menu -rw-r--r-- 1 root root 1.8K Dec 14 2011 opensuse-12.1-x86.menu /srv/tftpboot/pxelinux.cfg/sles: total 60K -rw-r--r-- 1 root root 1.8K Jul 24 16:58 sles-10.2-x64.menu -rw-r--r-- 1 root root 1.8K Jul 24 16:57 sles-10.2-x86.menu -rw-r--r-- 1 root root 1.8K Jul 24 16:57 sles-10.3-x64.menu -rw-r--r-- 1 root root 1.8K Jul 24 16:57 sles-10.3-x86.menu -rw-r--r-- 1 root root 1.8K Jul 24 16:57 sles-10.4-x64.menu -rw-r--r-- 1 root root 1.8K Jul 24 16:57 sles-10.4-x86.menu -rw-r--r-- 1 root root 1.8K Jul 24 16:58 sles-11-x64.menu -rw-r--r-- 1 root root 1.8K Jul 24 16:58 sles-11-x86.menu -rw-r--r-- 1 root root 1.8K Jul 24 16:59 sles-11.1-vmware-x64.menu -rw-r--r-- 1 root root 1.8K Jul 24 16:59 sles-11.1-vmware-x86.menu -rw-r--r-- 1 root root 1.8K Jul 24 16:59 sles-11.1-x64.menu -rw-r--r-- 1 root root 1.8K Jul 24 17:00 sles-11.1-x86.menu -rw-r--r-- 1 root root 1.8K Jul 24 17:00 sles-11.2-vmware-x64.menu -rw-r--r-- 1 root root 1.8K Jul 24 17:17 sles-11.2-vmware-x86.menu -rw-r--r-- 1 root root 1.8K Jul 24 17:00 sles-11.2-x64.menu

August 8, 2014 · 9 min · 1882 words · christian

NetApp: Archive SnapManager SQL snapshots

As I wrote before, we’re using SnapManager (for SQL/Oracle) to create consistent snapshots. However my database guys don’t want to name their snapshots daily. (which I can understand), as once you archive those snapshots to a secondary (and tertiary) system, the names become junk. So, they’re naming the snapshots like snap__vcsrv_29_12_2012-10.00.01. Sadly, when it comes to SnapVault, it expects the names in form of daily. otherwise you won’t be able to transfer the snapshots with the CLI (none that I have found anyway). But we didn’t want to move away from naming the snapshots the way they are, so I ended up writing a PowerShell script, that once triggered archives the Snapshots needed for a set of databases. It took me a while to figure a bunch of stuff out, but in the end I think I have a working way of archiving custom-named snapshots.

August 8, 2014 · 14 min · 2887 words · christian

Implementing SnapVault backups - the hard way

Well, I recently had the pleasant task of implementing SnapVault backups, that are being shipped to an offsite location with SnapMirror. That in itself isn’t the bad thing, however we decided against Protection Manager (since it was a charged product back when we decided on this). So I basically had the three tasks: Actually implement the SnapVault stuff (and learn my way around it and also document it) Write a bunch of scripts, that help us in creating scheduled backups of our databases Create a monitoring script, that’ll fit into our Nagios environment already in place Well, two months later (sadly it still has some kinks - I can’t figure out this one bug though for the life of it) and a few hundred hours of working on/with it and out came four things: ...

August 8, 2014 · 1 min · 188 words · christian

NetApp: Establishing SnapVault relations

I’ve been spending a lot of my time the last week on getting SnapVault with out FAS-filers to work. Out came a script, which does this for a given volume (and of course SnapVault Primary and Secondary). The script expects, that SSH public key authentification has been set up.

August 8, 2014 · 7 min · 1405 words · christian

Nexus 5000: Configure CEST

Since I’m living and working in Germany, most of my hardware is using timezone configuration for CEST (or Europe/Berlin). This here is the simple configuration for our Nexus 5000’s: 1 2 3 4 5 conf t clock timezone CET 1 0 clock summer-time CEST 5 Sun Mar 02:00 5 Sun Oct 03:00 60 exit copy running-config startup-config

June 24, 2014 · 1 min · 57 words · christian