Archive for the ‘Tutorials and guides’ Category

vmware-disklock

IF you have seen this err0r, you’re somehow trully fucked-up. Probably a third party appliance or software made a lock on your stored in datastore *.vmdk files creating -delta ones. There are couple of methods how you could fix this… . Actually this is not a big or major err0r in vmWare environment, but can be a quite pain in the ass if you don’t have any DSR site enabled.

Let’s talk about diagnosis:

DIAGNOSIS

First of all you need to try to power on the vm. You will see one of these err0rz:

Failed to add disk scsi0:1. Failed to power on scsi0:1
Unable to open Swap File
Unable to access a file since it is locked
Unable to access a file  since it is locked
Unable to access Virtual machine configuration

In the /var/log/vmkernel log file, you see entries similar to:

WARNING: World: VM xxxx: xxx: Failed to open swap file : Lock was not free
WARNING: World: VM xxxx: xxx: Failed to initialize swap file 

The purpose of locking is to prevent changes of concurent vm files and FS. Sometimes locks cannot be released because of other handler still wants to do something with files. Even if machine is powered off. There are couple of methods how you can dislock it by yourself.

TROUBLESHOOTING

You need to locate which files, which machine in which realm is doing bad things. For this to do I suggest you to enable SSH on the ESXi/vCenter host.  Log in to a vCenter using the vSphere Client. Go to Inventory > Configuration > Security Profiles > Services > Properties > choose…

ESXi Shell
SSH
Direct Console UI

Good. Now c0nnect via Pussy through SSH and obtain full path to your VM and navigate to the f0lder, through dis c0mmands:

# vim-cmd vmsvc/getallvms
# cd /vmfs/volumes/vm-datastore/vm-dir/

Check which filez have been locked (*-delta.vmdk created) but plz remember that it can be misguiding, because these files could be obsolete. Better method is to check /var/log/vmware.log for corresponding consolidation errors on which files.
From this part you need to use vmfstools to check the used *.vmdk files.

# vmkfstools -qv10 vm-disk-000009.vmdk
* Repeat this command for every disk file used by VM (You can check it in Edit Settings tab on Hard Disk n parameter) which is actually used as a snap.

This shows you the actual snapshot chain from your selected snapshot down to the flat disk. Now, you have a list of *.vmdk files and you need to use command below to find the actual owner or RO (Read-Only) owner of the file:

vmkfstools -D vm-disk-flat.vmdk
vmkfstools -D vm-disk-000001-delta.vmdk
...

If you see output like this, that it!

# vmkfstools -D test-000008-delta.vmdk
Lock [type 10c00001 offset 45842432 v 33232, hb offset 4116480
gen 2397, mode 2, owner 00000000-00000000-0000-000000000000 mtime 5436998]
RO Owner[0] HB offset 3293184 xxxxxxxx-xxxxxxxx-xxx-xxxxxxxxxxxx 
Addr <4, 80, 160>, gen 33179, links 1, type reg, flags 0, uid 0, gid 0, mode 100600
len 738242560, nb 353 tbz 0, cow 0, zla 3, bs 2097152

The RO Owner part is the MAC address of vNIC that had locked the file! If you cannot see the RO Owner, but you don’t see zeros in owner, it is also a MAC o vNIC. If you only see zeros, the problem is heavier. Now let’s see how we can repair this.

FIX

Before you start fixing things, you should consider whether there are not other locks or uses of vm files, so you can type this:

# egrep -i  /vmfs/volumes/*/*/*.vmx
# vmkvsitools lsof | grep 

Now, if you could see the RO Owner or owner MAC addr, you can use this command to find the corresponding physical address:

esxcfg-nics -l

Simple, shutdown/restart the vNIC and disk consolidation/power on machine probably can now be possible. If not… the only non-invasive method is to clone/migrate vm to other datastore/host. You also can preventively restart ESX Management by:

services.sh restart

For cloning you can use these commands (or use the GUI of vCenter :-)) :

# vmkload_mod multiextent
# vmkfstools -i /path/datastore1/source.vmdk /path/datastore2/new.vmdk -d thin -a scsilogic/buslogic
# vmkfstools -U source.vmdk
# vmkfstools -E new.vmdk nsource.vmdk
# vmkload_mod -u multiextent

When cloning/migrating is done. You can consolidate the disks and remove the old VM. Remember that cloning is faster than migration, but in both ways you need extra space.


									

First of all, you’ll don’t find this piece of sh1t in Add/Remove Programz in Control Panel so basically it must be manually deleted from teh Windows Registry. Type regedit in Search Box. Go to HKEY_CLASSES_ROOT\Installer\Products\ and search for string starting with 00005. All Offize products start with 0000X. Delete this and viola, now you can install your Office add-on/expl0it. REMEMBER! Plz backup your registry first before deleting this item.

Dark Souls, one of the best and heaviest games of all time (IMHO). If you want to play this on PC it is a quite pain in the ass (camera action, sensitivity, target-locking etc). I present you my configuration for DSFix add-on which improves the game experience as it is on a console (PS3 e.g.). You can download the DSFix from nexusmods and also I advise you to use DSMFix also. It improves mouse control (if you don’t want to use mouse improvement just clear the line dinput8dllWrapper dsmfix.dll to none).

[dsfix.ini]

renderWidth 1920
renderHeight 1080
presentWidth 0
presentHeight 0
aaQuality 0
aaType FXAA
ssaoStrength 0
ssaoScale 3
ssaoType VSSAO
dofOverrideResolution 0
disableDofScaling 0
dofBlurAmount 0
unlockFPS 1
FPSlimit 60
FPSthreshold 28
filteringOverride 0
enableHudMod 1
enableMinimalHud 0
hudScaleFactor 1.0
hudTopLeftOpacity 0.8f
hudBottomLeftOpacity 0.75f
hudBottomRightOpacity 0.5f
borderlessFullscreen 0
disableCursor 1
captureCursor 0
enableBackups 1
backupInterval 1500
maxBackups 10
enableTextureDumping 0
enableTextureOverride 0
skipIntro 1
screenshotDir .
overrideLanguage en-GB
dinput8dllWrapper dsmfix.dll
d3dAdapterOverride -1
logLevel 0
forceWindowed 0
forceFullscreen 0
enableVsync 0
fullscreenHz 60

[dsmfix.ini]

[settings]
connected=1
buffered=1
ui_mouse=0
invert_mouse=0
lock_disables_mouse=1
scroll_switches_targets=1
vanilla_targeting=0
mouselook_w_mod=0
sensitivity=2
lock_modifier_key=42
action_modifier_key=-1
# [a]ttack, [h]eavy attack, [t]arget, [g]uard, [p]arry, [r]oll/dash, [u]nbound
mouse1=a
mouse2=h
mouse3=t
mouse4=g
mouse5=p
mouse1a=a
mouse2a=h
mouse3a=t
mouse4a=g
mouse5a=p

Apparently, Windows >8 IDT driver from Dell is a thing. Sometimes audio drivers stops working correctly, and one way to resolve this is to reinstall the IDT driver (with HD audio). But, you can always use a method that don’t involve restart of the computer:

1. Open the Device Manager (type devmgmt.msc in the search box and hit Enter).
2. Expand the “Sound, video & game controllers” and right click on “IDT High Definition Audio Codec”.
3. Select to “Update Driver Software”.
4. Click on “Browse my computer for driver software”.
5. Click “Let me pick from a list of drivers on my computer”.
6. Put a check in the box “Show compatible hardware” if not already checked.
7. In the list of devices, click “High Definition Audio” (the native driver).
8. Click “Next”.
9. On the Update Driver Warning box, click “Yes” (install the driver).

As far as galaxy expands – everyone knows that Dell Data Protection does not like to work with Windows 10, so you cannot use biometric features like fingerprint or smartcard reader tho. But there’s a method for this:

1. Download Dell Data Protection Security Tools (newest): http://downloads.dell.com/FOLDER03477831M/1/ESS-Master-InstallerAU-1.2.1.292.zip
2. Download Dell ControlVault Firmware package (newest): http://downloads.dell.com/FOLDER03213032M/7/ControlVault_Setup_X4KKD_A00_ZPE.exe
3. Download Dell ControlVault Win10 Driver: http://downloads.dell.com/FOLDER03212997M/10/Security_Driver_P5T4G_3.0.48.26_A00_ZPE.exe
4. Install Dell Data Protection Security Tools (normal wizard installation)
5. Extract Dell ControlVault Firmware and DellControlVault Win10 Driver
6. Go to folder: C:\DELL\Drivers\P5T4G and start/install CVHCI64.msi
7. Go to folder: C:\DELL\Drivers\X4KKD\ControlVault_Setup_X4KKD_A00\firmware and start ushupgrade.exe (FIRMWARE UPDATE!)
8. If 7. gives you error or do nothing go to folder: C:\DELL\Drivers\X4KKD\ControlVault_Setup_X4KKD_A00\WinPE64 and start wpeushupgrade64.exe
9. Reboot the computer
10. Login with password and start DPD Console, from there: Enrollments, and set up your fingers by swiping them 4 times (please select at least two fingers or a dick – for better security purposes)
11. Reboot the computer and swipe on the login screen… voila.

For Domain Users:
1. Ask System Administrator to set up GPO features:
2. Computer Configuration\Administrative Templates\Windows Components\Biometrics: Allow domain users to log on using biometrics
3. Computer Configuration\Administrative Templates\Windows Components\Biometrics: Allow the use of biometrics
4. Computer Confguration\Administrative Templates\System\Group Policy: Turn off Local Group Policy objects processing

Recently I’ve discovered that there’s something wrong with microSD card in my phone. Sometimes the photography wasn’t correctly saved to
Album and showed the broken icon. Couple of days ago my phone was asking me, can he move my pics to an SD card because it has limited amount of free space on internal memory. Well, I said yes, and then, suddenly my whole December pics were corrupted… shit.

I’ve tried so many apps on my phone and PC, so many web pages with malware/spyware attached. None of them worked, but there is a solution!
First of all do not clear the phone with any cleaning app like CCleaner, Advanced Mobile Care etc. The second thing is – do not format the SD card. The third step – install DiskDigger – this is the one only app, that trully recreate 90% of corrupted images from thumbnails that weren’t deleted (by cleaning apps). Of course, in other location – so you should install Total Commander to dig to them.

Where is the problem? With fcking SD card that is INVALID Chinesse piece of shit. I bought it from Allegro, cheap price, 32GB. It is very poor quality and the size is not true, so basically when the card is full for couple of gigabytes (you think it is 32GB) – so it transfer the files to nowhere. Don’t buy cheap SD cards.

There’s no GUI tool to upgrade the firmware of Storwize disks, so basically this is a heavy task to be done by company admin (big responsibility), but I’ve managed to get the commands in one place, and some scripts are below:

UPLOAD

Upload the Software Upgrade Utility test in the first place; you can use GUI – if not – Putty PSCP, like this:

#pscp IBM_2073_2851_upgradetest_6.13 hax0r@5.10.15.254:/home/admin/upgrade
TEST AND RUN
#svcservicetask applysoftware -file IBM_2073_2851_upgradetest_6.13
#svcupgradetest -f -d
UPLOAD THE FIRMWARE
#pscp IBM2076_DRIVE_20150619 hax0r@5.10.15.254:/home/admin/upgrade
CHECK WHICH TO UPGRADE
#svcinfo lsdrive -nohdr |while read did error use;do svcinfo lsdrive $did |while read id value;do if [[ $id == "firmware_level" ]];then echo $did"   "$value;fi;done;done
UPGRADE (SINGLE DISK)

Enter the drive number – here is 0.

#svctask applydrivesoftware -file IBM2076_DRIVE_20150619 -type firmware -drive 0
UPGRADE (MULTIPLE DISKS)

Enter drives numbers – here is 5, 6, 7, 8, 9. I need to mention here that the execution between disks is 6 seconds.

#for did in 5 6 7 8 9;do echo "Updating drive "$did;svctask applydrivesoftware -file  IBM2076_DRIVE_20150619 -type firmware -drive $did;sleep 6s;done
VERIFY AND TEST
#svcinfo lsdrive -nohdr |while read did error use;do svcinfo lsdrive $did |while read id value;do if [[ $id == "firmware_level" ]];then echo $did"   "$value;fi;done;done
#svcupgradetest -f -d

Thankz to Anthony W for bl0g advices in this tut.