Reinstall GRUB from Live USB (UEFI + LVM)

There are many reasons why you may need to reinstall GRUB: corrupted boot partition; GRUB got overridden after Windows installation; some unsupported Linux kernel parameters have been set in a GRUB configuration file and the system is not booting anymore but this can’t be fixed from a GRUB menu as it is not showing up, etc.

In this note i am describing a particular case of how to repair GRUB by reinstalling it from a live USB if a broken system is configured to boot in UEFI mode and a system’s disk is partitioned to LVM.

I have tested this GRUB reinstallation on Ubuntu Linux, though all of the commands below should work for the other Linux systems as well. (more…)

Ubuntu, CentOS – Enable or Disable Service Autostart in Linux

Very often it is needed to enable or disable autostart of some services in Linux.

There are different init systems exist, but on Ubuntu and CentOS the most common are SysV, Upstart and systemd.

Depending on distribution, the behavior of a service during system’s boot in Linux can be configured with systemctl or chkconfig commands.

This tutorial shows how to enable or disable autostart of system services in the most popular Linux distributions – Ubuntu and CentOS. (more…)

HowTo: Remount /etc/fstab Without Reboot in Linux

The configuration file /etc/fstab contains the necessary information to automate the process of mounting partitions.

You would normally have to reboot your Linux system, after editing this file.

There is a simple way which will remount all the partitions from your /etc/fstab file without restarting the system.

Run the following command as root:

# mount -a

This simple command causes all filesystems mentioned in /etc/fstab to be remounted, except the partitions with noauto option.

Remote Hard Reset of a Linux Server if Reboot Doesn’t Work

Sometimes, reboot or shutdown -r now, don’t work anymore.

That really sucks, especially if you have no access to the server room or you just don’t want to get up.

But there is another solution if your Kernel is compiled with CONFIG_MAGIC_SYSRQ (sysrq-trigger).

If so, you have the possibility so send binding command.

Reset your server (like pressing the hardware RESET button):

# echo b > /proc/sysrq-trigger

But, it might be a good idea to sync the hard disks before:

# echo s > /proc/sysrq-trigger

More information about “Magic SysRq key”