26 nov 2017

MBR2GPT: ValidateLayout: Too many MBR partitions found, no room to create EFI system partition.

#Note
When you try to convert Windows 10 to UEFI, so partition from MBR to GPT, MBR2GTP fail.
The command return this error:

Info           ESP partition size will be 104857600
Info           MBR2GPT: Validating layout, disk sector size is: 512 bytes
Error         Validate Layout: Too many MBR partitions found, no room to create EFI system partition.
Error         Disk layout validation failed for disk 0
Info           MBR2GPT: Partition information at error point

#Product affected 
Windows 10 1703 and above

 #Solution 
The mbr2gpt disk conversion tool need three conditions for the validation of disk layout:
- Admin rights
- One of physical disk with boot partition MSR and OS partition
- The validation allows normally one of additional partitions, often it's recovery partition
If you have more than three partition validate will fail.

Check this with Get-Partition cmdlet










In this case we have too partition, so we have to find the Windows Recovery Environment (Windows RE)  partition with the command ReAgentc /info


Now we have to remove the "exceed" partition (partition 4)



And finally we can convert BIOS to UEFI with:

mbr2gpt /convert /disk:0 /allowfullos

















21 nov 2017

Poweroff Linux based NAS (Synology, ecc) remotely from Windows by command line

#Note
I had to turn off the NAS automatically after a Veeam backup copy process, but... it's not as simple as I thought.
The problem is that Linux SSH security permit executing of the "power off" command only as root and then root can not login to SSH

how do to do?

#Product affected / related 
NAS Linux based, Linux and Windows Server and Clients

#Solution 
1. Login to your NAS as admin user by SSH (PuTTY)
To enable ssh on Synology:
Control Panel > Terminal & SNMP > Terminal allows your Synology NAS to support Telnet and SSH command-line interface services. You can also change the security level of the SSH encryption algorithm.
To enable Telnet/SSH service:
Check the box next to the SSH protocol
Click Apply

2. Take permission as root
sudo su - or sudo -i

3.  Edit /etc/group
vi /etc/group

add a line for group shutdown and add your user name to it

poweroff:x:510:yourUserName

4. Change permissions to allow the shutdown group read and execute permission.
chmod 750 /sbin/poweroff

5. Power off can only be run by root so you need to have group "poweroff" execute the program as if you were root.
chmod u+s /sbin/poweroff

Now we have the "permission" to power off the system as admin 

6. Download plink
On Windows, you have to download plink from PuTTY download page and save it in a folder.
This is the command that resolve the problem:

plink.exe -ssh -t -pw “yourpassword” admin@xxx.xxx.xxx.xxx "poweroff"










20 nov 2017

Epson LQ can't print on Windows 7 /10 after recent patch


#Note
Epson LQ printers are not able to print after the installation of recent patch KB2952664 and KB4048957 on Windows 7 and KB4048955 (Windows10 Version 1709), KB4048954 (Windows 10 Version 1703), KB4048953 (Windows 10 Version 1607), KB4048952 (Windows 10 Version 1511), KB4048956 (Windows 10 Version 1507)

#Product affected / Related
Windows 7 32 and 64 bit, Windows 10

#Solution 
Remove the KB2952664 and KB4048957 on Windows 7 or the KB4048955 (Windows10 Version 1709), KB4048954 (Windows 10 Version 1703), KB4048953 (Windows 10 Version 1607), KB4048952 (Windows 10 Version 1511), KB4048956 (Windows 10 Version 1507)

Use PowerShell Cmdlet Get-Hotfix to verify the presence of the patches

To unistall KB:
wusa /uninstall /Kb:XXXXX

Pay Attention:
Patches are reinstalled if they do not hide from Windows Update