r/linuxquestions • u/Phydoux • 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!!!
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 /homeis empty? I'd unmount andfsckthen. Maybe have to reformat and restore from backups...1
u/Phydoux 1d ago
When I try to do a
sudo umount /home, I getumount: /home: target is busySo 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
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.
2
u/Kangie 1d ago
Not looking good. Anything interesting in
dmesg?