0

I was installing a software app on Ubuntu 22.04. After installation was complete, my system shows this:

screenshot

I can't find my home, document, desktop folders. I think while installing the software, I choose the path to /home and it overwrote everything. What should I do now? Any solutions please

I was installing mathematica software via the terminal. It showed that the default path /usr/local/wolfram/mathematica does not have enough space available, so I provided a new path /home for the installation. It asked to overwrite the content and I think I typed yes. After software install completion I could not find anything on my desktop and my home folder also went missing.

terdon
  • 100,812
  • 1
    It would help to know what it is and how you were installing this software. – David Oct 08 '22 at 14:58
  • I was installing mathematica software via terminal. It showed that the default path /usr/local/wolfram/mathematica does not have enough space available, so I provided a new path /home for the installation. After further process, it showed to overwrite the content and I think I typed yes. After software completion, I could find anything on my desk top and home folder also went missing – Ishfaq Rather Oct 08 '22 at 15:00
  • And the exact commands you used? Please edit the question and add the info there instead of a comment. – David Oct 08 '22 at 15:01
  • OK so you were out of disk space and instead of aborting and fixing the issue you went ahead? Sorry what ever was in the home directory is gone. – David Oct 08 '22 at 15:18
  • With everything gone from home directory, I was trying to do a clean installation of ubuntu 22. While booting from usb it showed Minimal Bash line is supported. Then I used 1. set prefix=(hd0, msdos1) /boot/grub 2. Insmod normal 3. Normal and it showed try Or install ubuntu. When I click it shows error: file casper/vmlinuz not found. I don't understand what's going on. Is there anyway I can remove every piece of everything and do a neat and clean installation – Ishfaq Rather Oct 09 '22 at 13:10
  • Here is what I would suggest you do. This is only a suggestion. Download a fresh copy of Ubuntu 22.04 desktop from the web site. Verify it is good https://ubuntu.com/tutorials/how-to-verify-ubuntu#1-overview . Make a fresh bootable USB I recommend with Rufus software. All the while following this guide https://ubuntu.com/tutorials/install-ubuntu-desktop#1-overview Something to keep in mind this all started when you tried to install that software and there was no disk space for it. – David Oct 09 '22 at 13:29
  • I would be asking myself where did the disk space go. I do not know how big your drive was or why you choose to make the partitions the way you did. Unless you have a special need let the install make the default partitions. Less chance of running out of space in a single partition. – David Oct 09 '22 at 13:29
  • It was a human error and I fully accept it. Now, I made a bootable usb. When I switched on the laptop, it shows the same thing "Minimal Bash line.... " thing and I can't even go back to my previously original linux. Reboot the system and it shows it again. – Ishfaq Rather Oct 09 '22 at 19:09

2 Answers2

1

Something happened to your home folder. We know even less than you what might have happened to it. So take a look.

If another account with root permissions is available on the system, log in on that one. Else, you can boot into a recovery prompt from the Grub menu. Yet another option is to start a live session. In brief, make sure that in one or another way, you can look at and work with your system disk.

Check the "/home" directory on the system partition (which, if that one is mounted e.g. on "/mnt" in a live session, would be /mnt/home). Presumably, judging from your screenshot, your home directory will not be there, at least not under the expected name "ishfaq".

  • Check whether it may be there under another name. If that is the case, changing the name back to the original name may already suffice to make your system bootable again, provided no other harm was done to its contents.

  • If that does not work, create a fresh account:

    • create a new home folder, make sure it has permissions 775, and make your user the owner and group.
    • Copy the hidden files (including .profile amd .bashrc) over from /etc/skel to that new home folder.

Now shut down and reboot: you will now be able to login to your account. However, you will be greeted with a shiny new factory default desktop.

At least, your system is working again at that point. You can then continue to see whether you still can recover files from the original home directory. If you do not find any of the old home data, you will need to reconfigure your desktop and copy your data back from your backup.

vanadium
  • 88,010
  • The OP's edit makes it clear they have deleted everything in /home. – terdon Oct 08 '22 at 15:58
  • My system freezes when I click on the files icon repeatedly showing unable to find /home/Ishfaq. I can't do anything – Ishfaq Rather Oct 08 '22 at 15:58
  • @terdon, not to me. In my answer, I therefore make no assumption on how the situation really is - I do not think the info allows that. In my answer, I hint on how the user can take a look at the current situation, and, in the worst case, make sure the user can log in bacl again. – vanadium Oct 09 '22 at 10:21
1

You have deleted your home directory, as well as the directories of any other user of your system. You will need to restore from backup. /home is not your home directory, it is the directory in which all users' home directories are stored. So when you said "yes" to overwriting /home, you deleted everything in there, including your home directory.

If you have a backup, you can restore from it. If you don't, you're basically out of luck, but can try some of the options explained here: How to recover deleted files?

terdon
  • 100,812
  • Many users do not backup (and wisely so) their entire home including hidden files, so you should not assume that. You can, however, assume that they backup their personal data. In the latter case, the advise is reinstall then restore your user data. Much more users (anyone who backups his personal data) will be able to do that rather than restoring an entire /home. – vanadium Oct 09 '22 at 10:26
  • @vanadium I am not assuming anything, really. I am just saying that if they have a backup, they can restore from it. I don't really understand why you would consider it wise to not backup hidden files, those are among the most important things for me as they have all my settings, but either way, if the OP gave /home as an installation target and said "yes" when asked if the contents should be overwritten, it seems clear to me that /home has been emptied so restoring from a backup is the only thing left. – terdon Oct 09 '22 at 10:43
  • Configuration is replaceable, and may change with new versions. Backing that up is by far less essential than backing up user data, which, once lost, is irretrievably lost. – vanadium Oct 09 '22 at 10:52
  • @vanadium yes, but why would it be wise to not backup the configuration? I can see why it might be wise to not restore it blindly from backup on a new install (although I admit I have been doing that for a couple of decades now and have never had any major issues, but I know my way around the system), but why would you explicitly try not to back it up? Dotfiles are tiny and can be super important so I see no harm and considerable benefit in backing them up. – terdon Oct 09 '22 at 10:55
  • Backups take efforts. If users manage to back up their data, I am fully happy, and they are fully safe. Users knowing their way around the system of course can and will backup dotfiles as well, for convenience when reinstalling. Again, I do not consider this essential. Personally, I store selected dotfiles in a directory under Documents, which I "push" to the appropriate locations (using symlinks) using the tool stow. This way, these dotfiles are backed up along with the Documents folder. – vanadium Oct 09 '22 at 11:00