terminal.cab

Linux Basics Lesson 30 of 38

guestLevel 1Badges and progress0/100 XP, XP to the next levelStreak0

Disk full, but of what?

Rescue 100 XP

10 minutes

Learning goals

Three things stay as they are: the running log /var/log/app/app.log, the backup under /var/backups, and /etc/app/app.conf. The colleague wants to compare the configuration first and deal with it personally, so the file from the backup goes to ~/restore only. If you hit one of the three, the current step stays open. Undo or Start over takes you back.

find, gzip, sudo, sort and head are not on this page. gzip and sudo answer with a hint, find, sort and head with command not found. You can manage with df, du, ls, rm, mkdir and tar.

You can delete the old log here without sudo, because the folder /var/log/app lets the group adm write, and lerner is in it. Whether you may delete a file is decided by the rights on its folder, not on the file itself. On a real server, that folder usually does not let you write, and deleting needs sudo.

Steps

Step 1/4: Confirm the alarm first. How full is the disk that / is on?

Rescue 100 XP

07:10. / is at 97 %, and the database refuses to write. In five minutes this escalates. On top of that, a colleague asks for yesterday's app configuration from the backup, because someone has wrecked the current one. Find what is eating the disk, make space, and get the file out, without breaking anything else.

  1. Step 1

    Confirm the alarm first. How full is the disk that / is on?

  2. Step 2

  3. Step 3

  4. Step 4

Loading terminal …

lerner@web-01: ~bash
lerner@web-01:~$

Esc, then Tab leaves the terminal

Step 1 of 4

Cards

  1. Card 1 of 2

    Tap the card or press Space to turn it over.

  2. Card 2 of 2

    Tap the card or press Space to turn it over.

Cheat sheet

The most important command lines of this module on one A4 page, black and white, to print or keep on your phone.