Search Posts

Author: linuxazure

No GRUB access ? Use Recovery Scripts

If you are experiencing a no-boot scenario, for example due to a corrupt kernel and do not have access to GRUB via the Azure Serial Console, the next best option could be to use Linux Recovery Scripts which are available in both: Power Shell Recovery Scripts Bash Recovery Scripts Watch this video to understand how to recover a Red Hat Linux which has kernel problems but no GRUB access. The OS disks in this demo […]

How to transfer data to or from a Linux VM in Azure?

There are various options to transfer data into a Linux VM, if you have ssh enabled then WinSCP / SCP client tools will work seamlessly even if you choose to use ssh keys instead of password logins, however you may need to transfer files between VMs and again you can use scp or configure vsftpd Transfer data from Local PC to Linux VM To configure WinScp, go to Advanced, SSH, Authentication and select the private […]

Linux Recovery: Cannot SSH to Linux VM due to FSTAB errors.

Problem: There are a few cases where a VM might stop booting up properly if the syntax in /etc/fstab is incorrect or if a data disk is missing (not attached to the VM) as well as other reasons. Traditionally in Linux you can mount a scsi device by using the following format in fstab: /dev/sdc1 /data ext4 defaults 0 0 However in cloud environments there is no way to guarantee the same scsi ID every […]

Azure CLI: How to delete and re-deploy a VM from VHD

NOTE: Recently the azure cli has changed to the az cli, unless you have the older azure cli tools still installed, you should visit the new and updated post with instructions for the az cli here. Unless you are still using the old azure cli tool, the instructions bellow will not work in the new az cli. Before moving further, please, make sure you have the Azure CLI tools installed:Install the Azure CLI For the […]

Azure PowerShell: How to delete and re-deploy a VM from VHD

Before moving further, please make sure you have Azure PowerShell installed:How to install and configure Azure PowerShell For basic information about using Azure Powershell with Resource Manager (ARM), please have a look at:Using Azure PowerShell with Azure Resource Manager In this example, the following variables are being used: Resource Group: ARMGROUPOriginal VM Name: LinuxVMLocation: southcentralusNIC Name: LinuxVM-NICStorage Account: ARMSTORAGEVHD URI: https://ARMSTORAGE.blob.core.windows.net/vhds/linuxvm.vhd You should be able to get a list of parameters from a given VM […]

Linux Recovery: Using CHROOT steps to recover VMs that are not accessible

You are facing an issue where you might need to basically delete a virtual machine (VM) , keep its OSDisk and attach it to another Linux VM where you can then repair whatever is wrong on that old VM, however in some instances you would also be able to have network access and some way of updating let’s say packages, adding a user account or doing any task that you can do on a normal […]

/var/empty/sshd must be owned by root and not group or world-writable

Problem Statement: You are attempting to ssh into a Linux VM and are unsuccessful. We have seen customers modify key sshd configuration files and upon restarting sshd or rebooting the VM connectivity is lost. symptoms/errors experienced The serial or console log may exhibt errors such as this: SuSE /var/empty must be owned by root and not group or world-writable. startproc: exit status of parent of /usr/sbin/sshd: 255 Failed CentOS Starting sshd: /var/empty/sshd must be owned […]

Why proactively ensuring you have access to GRUB and sysrq in your Linux VM could save you lots of down time?

Quite simply, to speed up the recovery time of your IaaS Linux Virtual Machine most recovery options will be possible if GRUB is configured. Recovering Linux Virtual Machines in Azure You will, at some point have to perform some type of recovery in your Linux VM unless you are very lucky, this inevitable. The reasons for performing a VM recovery are numerous and can be anything such as: • corrupt file systems/kernel/MBR (Master Boot Record) […]