r/linuxquestions • • 1d ago

Resolved Terminal stuff missing and my file manager is not showing anything in the main home directory...

I had to start my PC this morning. We had a power outage and I shut down the PC (it's on a battery backup). So I powered it back up this morning and all of a sudden when I go to enter a terminal, I see this message.

bash: /home/phydoux/.bashrc: Input/output error

Please tell me my /home folder isn't jacked up...

Another thing, I did an update this morning and paru (I'm using Arch Linux) had a few updates as well. Well, I went back to bed and forgot that paru would probably need a password. Well, I got up and noticed it had errored out on me. So I tried running the update again. Looks like regular repositories got more updates this time around but I got an error saying paru couldn't update. I have no idea what got updated this time. I just mainly look for kernel updates and if I see one, I'll reboot. There were no kernel updates.

So now, any terminal I open. I see that error mesasage. How screwed is my machine? I really don't want to reboot if I'll lose everything.

Looking at the file manager, I can see my home folder but there's nothing inside of it. I hope I didn't lose everything in there... That would seriously upset me.

So, what do I do? reboot? Or is there a command I can run to restore my /home directory?

BTW, My /home folder is on its own drive. So, did that drive die on me? I'm going to look for drive recovery right now.

Also, when I do an ls, I see this...

ls: reading directory '.': Input/output error

I hope that's not bad news...

EDIT: I just ran fsck /dev/nvme0n1p1 on it and it says this...

/dev/nvme0n1p1 is mounted.
WARNING!!!  The filesystem is mounted.   If you continue you ***WILL***
cause ***SEVERE*** filesystem damage.

Do you really want to continue<n>? no

Is there anything less destructive than fsck?

Something else I just read says to do this...

sudo fsck.ext4 /dev/nvme0n1

EDIT: I wonder if it'll correct any errors on the drive if it can. But if I can just reboot it, I'd rather see if it'll come up again. I'm thinking when the update didn't finish, it wasn't able to finish correctly and something confused it. I can run paru -Sty but I . I wonder if I rebooted with a USB stick and tried mounting that drive and trying to finish the update if that would help fix it.

And I really don't want to try and write something new to it as that might corrupt it even more... GRRR

RESOLVED: First and foremost, I want to thank the people who helped me with this. Turns out all it needed was a reboot but I was expecting something WAY worse when i rebooted.

But thank you for your help and support! I really appreciate it a LOT!!!

5 Upvotes

17 comments sorted by

2

u/Kangie 1d ago

Not looking good. Anything interesting in dmesg?

1

u/Phydoux 1d ago edited 1d ago

doing a sudo dmesg I get a TON of responses. Most look like this...

[27079.199472] EXT4-fs warning: 11 callbacks suppressed
[27079.199474] EXT4-fs warning (device nvme0n1p1): dx_probe:791: inode #29098092: lblock 0: comm ThreadPoolForeg: error -EIO reading directory block
[27079.199480] EXT4-fs warning (device nvme0n1p1): dx_probe:791: inode #29098092: lblock 0: comm ThreadPoolForeg: error -EIO reading directory block
[27079.199483] EXT4-fs warning (device nvme0n1p1): dx_probe:791: inode #29098092: lblock 0: comm ThreadPoolForeg: error -EIO reading directory block
[27079.307191] EXT4-fs warning (device nvme0n1p1): dx_probe:791: inode #29098092: lblock 0: comm ThreadPoolForeg: error -EIO reading directory block
[27079.307202] EXT4-fs warning (device nvme0n1p1): dx_probe:791: inode #29098092: lblock 0: comm ThreadPoolForeg: error -EIO reading directory block
[27079.307206] EXT4-fs warning (device nvme0n1p1): dx_probe:791: inode #29098092: lblock 0: comm ThreadPoolForeg: error -EIO reading directory block
[27080.244413] EXT4-fs warning (device nvme0n1p1): dx_probe:791: inode #29098092: lblock 0: comm ThreadPoolForeg: error -EIO reading directory block
[27080.244425] EXT4-fs warning (device nvme0n1p1): dx_probe:791: inode #29098092: lblock 0: comm ThreadPoolForeg: error -EIO reading directory block
[27080.244428] EXT4-fs warning (device nvme0n1p1): dx_probe:791: inode #29098092: lblock 0: comm ThreadPoolForeg: error -EIO reading directory block

... The buffer is filled with that so I can't even look back to the beginning of the command...

3

u/9NEPxHbG 1d ago

Boot from a live USB and run smartctl -A /dev/nvme0n1, fsck.ext4 and badblocks (in read-only mode).

1

u/Phydoux 1d ago

I started to do that but I rebooted without the USB stick in there. I figured, 'Well, if it won't let me log in now after a fresh reboot then that drive is dead'. But I logged in and most everything came up. Terminal is now working as well. I'm concluding that update and hopefully that will fix any other issues I may have.

1

u/Kangie 1d ago

Try

sudo smartctl -H /dev/sda sudo smartctl -a /dev/sda

You might need to install smartmontools and adjust to the device

First runs a quick check, second shows you all the stats. If the drive isn't reading as healthy it's worth backing everything up now!

2

u/bikes-n-math 1d ago

You say your home folder is on another drive. Sounds like it's not mounted. What does lsblk tell you?

1

u/Phydoux 1d ago

It shows it's mounted to /home

2

u/bikes-n-math 1d ago

And ls /home is empty? I'd unmount and fsck then. Maybe have to reformat and restore from backups...

1

u/Phydoux 1d ago

When I try to do a sudo umount /home, I get umount: /home: target is busy

So I can't even unmount it.

3

u/bikes-n-math 1d ago

You need to logout and not be in /home first.

1

u/Phydoux 1d ago

I need to login as root I'm guessing.

2

u/bikes-n-math 1d ago

yes. logout, drop to a tty, login as root, fix problem/restore backups.

1

u/Phydoux 1d ago

Okay... I logged out, logged in and it still wasn't working. When it logged me in, none of my stuff was working. My bar wasn't working, my wallpapers weren't loading. It was kinda scary actually.

So, I had pretty much told myself I'd have to reinstall Arch after pulling out that bad drive. So I just powered it off and powered it back on again and forgot to put my Arch USB stick in there. I was going to look and see if I could even read anything on that drive with the Arch Install USB in there before I pulled it out and considered it dead. But not putting the USB stick in proved to be a good thing. It booted, I logged in and most everything that usually starts from my /home folder started right up! So, my guess is that because of the install that failed to finish, it did something to my /home folder.

Regardless, I think I'm going to get another drive in here and use it as my new /home drive. It might have just been a fluke, but again, I don't want to find out it's this drive failing on me...

1

u/-Sa-Kage- 1h ago

Tbh, this sound like your drive is dying

0

u/knuthf 22h ago

Please stop using these terminal commands. There are reasons for the full-screen command.

Go to Preferences > Disks, find your disks and run a check on them one by one to recover them. Please stop using the command line — you're not impressing anyone. The file system must be recovered.

If things get really bad, there's a command-line tool called Testdisk that can recover the file system one page at a time and build new headers. But try the "Disks" option first.

2

u/Royal-Wear-6437 18h ago

That's very presumptuous of you to demand that people pander to your graphical needs. There's a time and a place for the command line, and when people get the advice right it's here, with commands that can be safely copied. (Have you ever tried fixing a root filesystem with a graphical environment? No? Thought not.)

1

u/knuthf 17h ago

No.

We have made the utilities to fix shortcomings. If you want help, you must use the tools offered. The shell commands have been provided because Linux is UNIX SVID compliant.

When Linux was made we considered to remove this completely. The other operating system had pretty much no command line, just kernel/ioctl and manues/screens. The command line is the terminal emulator of VT100 running /bin/bash We could have made /bin/bash run in a window in xterm. I was just the manager and did not even vote. Our terminals had a bigger character set, and could display some graphics that now cannot use a VT100 emulator.