-1

i accidently deleted my home directory by runnung command below:

sudo rm -rf ./*

Now pc dont boot. It tells no operating system is installed.

Even though I have dual boot windows 10 along with ubuntu 18, Windows 10 also doesn't boot.

What can I do? Can I at least access windows 10? No grub menu appears :/

Meric Ozcan
  • 111
  • 6
  • Hello. That is not your home directory you deleted it is the whole OS. You said from root. Look up what . and / does. – David Apr 18 '22 at 13:58
  • Start by reinstalling the Ubuntu OS it should show you the option to boot with if Windows is still intact. – David Apr 18 '22 at 14:02
  • Isnt ./ used for a relative path? I was in home directory @David – Meric Ozcan Apr 18 '22 at 14:02
  • If that was correct why the error no OS? Why did you want to blow away your home directory anyway? That would also cause you issues. – David Apr 18 '22 at 14:03
  • @David quote: "This is where the dot slash ./ notation comes in. It means “Look in the current directory.” When you use ./, you tell Ubuntu or Fedora or SUSE or whatever Linux distribution you're using to look in the current directory for the command you wish to run, and completely ignore what's on the application PATH." – Meric Ozcan Apr 18 '22 at 14:05
  • From online help with a Google search. <Relative path is defined as the path related to the present working directly(pwd). It starts at your current directory and never starts with a / .> – David Apr 18 '22 at 14:05
  • Bottom line is you blew it up. – David Apr 18 '22 at 14:06
  • The command you wish to run not the results of the command. – David Apr 18 '22 at 14:07
  • do you think I can save files in Ubuntu? @David – Meric Ozcan Apr 18 '22 at 14:07
  • No idea sorry. You will find out when you use try from the Live Media – David Apr 18 '22 at 14:09
  • @David I found a usb Ubuntu18.04 image. I clicked "Try Ubuntu". In file explorer-> other locations under "On This Computer" I can see my Windows, and previous /home directory. I might try reinstalling ubuntu on the same partions before. Do you know a easy way to do it? – Meric Ozcan Apr 18 '22 at 14:38
  • It should prompt you. Start the install. – David Apr 18 '22 at 14:39
  • You deleted your all of your Ubuntu data. The command sudo rm -rf deletes things. The only thing I can tell you to do is to reinstall Ubuntu. In Ubiquity (the installer) make an Ubuntu partition for half of your HDD/SSD, make a SWAP partition that is half of your RAM, and install Windows on the free space. I hope this helps. – Logan Apr 18 '22 at 14:50
  • If you can see the "previous /home directory" from using the Try Ubuntu option of installation USB, then check if the folder /home/meric (or whatever the your username in the Ubuntu is) has any other folders and files like /home/meric/Documents. If the folder /home/meric is empty, then you can restore the contents of the folder using the default Backup app from the USB. I hope you used the Backup app to make backup of your home folder in an external drive or in the cloud, or in a NAS when the Backup app popped up and asked you to set it up. – user68186 Apr 18 '22 at 15:29
  • Does this answer your question? Deleted home directory. Please help – karel Apr 19 '22 at 00:30
  • @karel no it does not. I cannot even login to Ubuntu. Whole operating system crushed. I might deleted the folders under root. It is like deleting all operating system with a command inside. – Meric Ozcan Apr 19 '22 at 07:49
  • According to the command in your question you deleted your home directory only, so one of the two things that you posted is wrong. Until you prove otherwise I'm not retracting my close vote because now your question is unclear. The home directory can be restored if the root directory has not been deleted. The root directory cannot be restored. – karel Apr 19 '22 at 08:32
  • 1
    @karel we can close the question I believe, I installed a backup. – Meric Ozcan Apr 20 '22 at 10:45
  • And different than other questions, I cannot open terminal or open the ubuntu. Other questions can use command line. I dont know how they do it I could not access ubuntu in my PC – Meric Ozcan Apr 20 '22 at 10:53

1 Answers1

1

Probable your Windows is intact, but your Grub - the start-screen is deleted to or corrupted. The only thing you can do, if you have not a backup,is reinstall the OS Ubuntu. It must recognize that Windows is still there. If not, you have to repair your Windows first.

Julien Chau
  • 1,184