# Broken Machines

Over the coarse of my Linux career I broke quite a few machines.
Hopefully you can fix these for me.
The username and password of the first account created is isib/isib unless mentioned in the exercise.

## GRUB problems

### Broken Machine 1

I messed up and forgot to install grub during the Debian installation.
Can you find a way to fix this for me please?
Thanks!

![broken 1](./assets/debian_broken_1.png)

#### Tips

How did this happen?
Well, you probably encountered the *black screen of death* on one or more Linux VM's yourself.
When at the very last stage of the Debian installation you forget to install GRUB you created this problem yourself.
The installation is complete and functional but the system has no way of booting.
There are a lot of different approaches to fix this but they all boil down to the same solution.
You need to install GRUB on the MBR of the HDD `/dev/sda`.

Luckily there are dedicated live disk images (ISO's) to fix this.
I would recommend having a look at [supergrub2](https://www.supergrubdisk.org/).

### Broken Machine 2

This machine seems to boot into `htop` and nothing else!
There must be a way to fix this without having to reinstall the machine.

![broken 2](./assets/debian_broken_2.png)

#### Tips

Your GRUB configuration is causing this!
Luckily by default GRUB offers a *recovery mode* in it's *advanced options*.
This will drop you into a shell where you can fix the configuration file I messed up.

### Broken Machine 3

Not `htop` again!

![broken 3](./assets/debian_broken_3.png)

#### Tips

I said *by default* before no?
Well, here the *recovery mode* is missing so you'll have to find a way to override the `init` parameter of GRUB so you can get a shell to fix what I messed up.

### Broken Machine 4

I forgot my password...

![broken 4](./assets/debian_broken_4.png)

#### Tips

Overriding the `init` parameter in GRUB is a classic Linux hack.
If you have physical access to a Linux machine you can gain `root` access with the following method.
The easiest way to protect a machine form this attack is to do full disk encryption or to set a GRUB password.


## Disks and problems

### Broken Machine 5

Somebody erased the MBR from the HDD.
Can you put a new one on there?
Don't forget to install GRUB again once the HDD is fixed.
This is a tricky one but there are quite a few tutorials online to help you out.

![broken 5](./assets/debian_broken_5.png)

### Broken Machine 6

The root partition is pretty much full but the disk is big enough to house more data.
Can you please enlarge the disk so we can comfortably use the machine again without running into `no space left on device` issues?

![broken 6](./assets/debian_broken_6.png)

### Broken Machine 7

The install works but the root partion is rediculously small.
Luckily the installation was done on a LVM volume so we can add more disks to it!

![broken 7](./assets/debian_broken_7.png)

