Cancel downloaded updates in Windows Server

If the server has downloaded automatically an update (such as the SharePoint ones), which you don’t want to install, try following these steps to delete the queue:

  • Open an elevated PowerShell, then run the following command
Stop-Service -Name "wuauserv"
  • Open an elevated PowerShell, then run the following commands to make a backup of the folders we’re going to delete.
cd C:\

'backupwinupdate', 'backupdatastore' | %{New-Item -Name "$_" -ItemType "Directory"}

Copy-Item -Path "C:\Windows\SoftwareDistribution\Download" -Destination "C:\backupwinupdate" -Recurse
Copy-Item -Path "C:\Windows\SoftwareDistribution\DataStore" -Destination "C:\backupdatastore" -Recurse
  • Check that the backup has been created, then proceed to delete the content of the original folders:
Get-ChildItem -Path C:\Windows\SoftwareDistribution\Download” -Include * -File -Recurse | foreach { $_.Delete()}
Get-ChildItem -Path C:\Windows\SoftwareDistribution\DataStore” -Include * -File -Recurse | foreach { $_.Delete()}
  • After clearing the content, you can proceed to start Windows Update:
Start-Service -Name "wuauserv"

You’ll need to reboot at the end of this procedure.

Be sure to clean up the backup folders C:\backupwinupdate and C:\backupdatastore

Windows – Cannot start WAS and W3SVC

If you get “System error 2 has occurred” when starting WAS (Windows Activation Services) and you also cannot start W3SVC (World Wide Web Publishing Service), try the following:

  • Open Regedit.msc
  • Go into HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WAS\Parameters
  • Locate the NanoSetup DWORD
  • Delete the NanoSetup DWORD
  • Open an elevated command prompt and run “net start was” and “net start W3SVC”

Extend LVM partition after resizing disk – Linux

First, rescan the disk after upgrading its size. Swap out sda for your disk:

echo 1>/sys/class/block/sda/device/rescan

Then open parted:

parted

Inside parted send:

print

It will display the partitions on the disk:

Number Start End Size File system Name Flags
1 1049kB 2097kB 1049kB bios_grub
2 2097kB 1076MB 1074MB ext4
3 1076MB 644GB 643GB

Send resizepart, then insert the partition number you wish to extend. After that insert the new partition size in MB:

(parted) resizepart 
Partition number? 3
End?  [400.0GB]? 644245

Check the new size using:
fdisk -l

Extend the pv:
pvresize /dev/sda3

List your volume groups, the size should be adjusted automatically.

vgs

End the process with the resizing of the logical volume.

lvextend -l +100%Free /dev/vg01/lvvar OR lvextend -L+10G /dev/vg01/lvvar

Check the logical volume size:
lvs

Resize the file system:
resize2fs /dev/vg01/lvvar (for extX)

xfs_growfs /dev/vg01/lvvar (for xfs)

Check the result.

df -Th