4

Can someone explain what this combination does? I mistakenly pressed it on Ubuntu 20.10 and it showed me a screen with the same output of fsck (“clean” and the number of blocks)... now I am worried that it actually ran fsck on the mounted partition... can someone explain me what this shortcut does?

aliquo93
  • 101

1 Answers1

13

To understand what you probably saw, we need to do a little crash course in computer history.

Today, you probably have your own computer, often multiple of them. You might have a desktop machine and/or a laptop and/or a smartphone and/or a smartwatch and so forth. But some fifty, sixty years ago, that wasn't the case. There were a few central computers, that multiple (often many) users used at the same time.

Those people were sitting in front of terminals. A terminal in that sense is basically a keyboard and monitor that don't have (much) computing power of their own. The keyboard takes the user's keystrokes and sends them to a central computer. That central computer does whatever computation is necessary, and sends the resulting output back to the terminal and its monitor. The central computer could be in another room, in another building, even in another city. And dozens or hundreds user would be using the same central computer at the same time.

So, an operating system for such a central computer needed to be able to handle the input and output for multiple or many terminals at once. In a family of operating systems going back to Unix, this was done by running multiple instances of a program called tty. tty stands for "teletypewriter". Yes, this basic principle is that old that the output wasn't shown on a monitor, but was sent to a teletypewriter.

Ubuntu, and Linux in general, is what's called a "Unix-like" operating system, because many of the basic concepts date back to how things were done in Unix. One of them is the availability to handle multiple terminals at the same time. This isn't done by the original tty anymore, but by similar programs like getty or agetty.

You probably don't have multiple sets of keyboard and monitor standing around. But your computer still can handle multiple terminals as what's called a virtual tty. Typically, a Linux system has seven virtual ttys set up, plus one for the graphical user interface (that whole stuff with windows and mouse pointers and icons and such).

By pressing CTRL + ALT + F7, you switched to, you've probably guessed it, the seventh of those virtual ttys, or tty7. When you would have pressed CTRL + ALT + F3, you would have switched to tty3, and so forth.

So, now we know what you saw, but why was there something about fsck written to tty7? When you boot your computer, one of the routine steps is to a short check of all file systems. And the output from that check, something like

/dev/sda1: clean, 552599/6111232 files, 7119295/24414464 blocks

gets written to the tty used in the boot process. In your case, that probably was tty7. So what you've seen is a routine message from the boot process, that you normally don't see behind graphical boot managers and other modern stuff ;)

  • Thank you! So it’s nothing to worry about, right? – aliquo93 Nov 21 '20 at 03:06
  • @aliquo93 Judging from what you told us, I don't see a reason to worry. We can't tell what may or may not be happening additionally, though ;) – Henning Kockerbeck Nov 21 '20 at 10:02
  • 3
    a nice thing to know is that you would, in general, get back to where you where, if you would press CTRL+ALT+F1, that is, go to the first and the only terminal. – userfuser May 24 '22 at 16:49