Score:0

"fsck" - Permission Denied

fj flag

I'm getting a error. See:

Prt Sc

What I'm supose to do?

Tx, everyone!

Charles Green avatar
cn flag
A couple of things. First, please copy and paste text from the terminal windows, rather than posting pictures. Second, running `fsck` with no arguments requires reading `/etc/fstab` - do you have appropriate permissions for that?
Mosna avatar
fj flag
Here's the message I get after type "fsck" in terminal: "fsck de util-linux 2.38" | "fsck.fat 4.2 (2021-01-31)" | "open: Permission denied". I have no idea about permissions. I'm a new Ubuntu user... I want to use "fsck" command to check my OS files and repair anything that need's repair. Any tip?
ru flag
You need to use `sudo` in order to do an `fsck` on your system. However, you cannot *safely* do an `fsck` on a running partition such as your root partition and you need to boot into a liveusb or similar environment in order to actually *run* the `fsck` on your proper disk. Unless you know there's a problem with the filesystem though you don't *really need* to run `fsck`.
Mosna avatar
fj flag
Thanks @ThomasWard. Any safe way to check my system files?
ru flag
@Uirokag not while your system is booted to itself, no. Your "system files" also don't have the same kind of integrity checks that Windows has. Windows' integrity checks are very strict, Linux is less so with 'system files' - if something breaks, you'll *know* it's broken when you try and use it, especially with critical system files. At which point you'll probably have a question here to post as a new question.
Mosna avatar
fj flag
Tx for you kindness, Mr. @ThomasWard!
Score:0
ls flag

From the comments, it looks like there's a couple of questions here, so I'll try to answer both.

Firstly, how to run an fsck on your system?

There are a few ways of doing this. The most intuitive way would be to boot from a live USB, then run sudo fsck /dev/sd**, replacing /dev/sd** with the partition ID of the partition Ubuntu is installed on. For instance, if Ubuntu is installed to /dev/sda2, you'd run sudo fsck /dev/sda2 from a live USB.

(Heads up, disk IDs under the /dev directory are liable to be different from one bootup to the next, so you'd want to use lsblk on the live USB to figure out which partition contains your Ubuntu installation, then run fsck based on that data.)

If booting from a live USB is too much trouble, you can use tune2fs to get the system to run an fsck at bootup. This answer has details on how to do that: https://askubuntu.com/a/1352782/1598467

Secondly, how to scan system files?

An fsck will only catch some kinds of corruption. If you want to check that system files are unmodified, the command to use is sudo dpkg -V. This command will output a list of all of the system files and configuration files on your system that have been modified from their original state in some way.

Don't be surprised if this prints output (possibly a lot of output), as dpkg is able to detect a lot of different changes, including changes you probably made on purpose. For instance, running sudo dpkg -V on my machine reveals that there are a bunch of missing .list and .asc files under /usr/lib/kfocus, which is probably a normal consequence of how my laptop manufacturer's setup mechanisms work. /usr/share/misc/pci.ids is also modified, which I think is probably normal. Then there are three other files that I know I modified on purpose.

Some output from sudo dpkg -V may be normal. However, if you see that binary files (like executables, .so files, etc.) are changed, or you see that some files have been modified that you didn't modify and can't figure out why they would have become modified, that may be something to look into further.

Mosna avatar
fj flag
Tx a lot, @ArrayBolt3! You're the best. Have a nice day!
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.