I accidentally nuked my /home folder that was stored on a different drive. Is there any way I can repair Ubuntu 18.04 without having to reinstall?
Sure, login to the CLI as root (homedir is /root) and change your user’s homedir to one that exists. If you moved root’s home as well you will need to boot off a CD, mount your drive, and edit /etc/passwd.
It was the only /home I had. So it will boot into cli without a /home folder?
Hit ctrl-alt-F2 to get to a CLI login prompt then login as root. Root’s homedir is /root by default, not /home/root.
iirc it should boot right up to the login prompt, but on a sucessfull password, it just doesn’t go into the desktop. Try a non-gui TTY and you can create a new /home/user directory, and the system should fill it with whatever files a new user gets?
Might have to sudo to create the homedir, in chich case, would need
sudo chown -r user:user
cause the machine is off right now. I panicked and shut everything down when i realized what i did. So if I start it back up again, it should try to boot? or will it hang and i need an install usb?
I would give it a boot, and see if the system hangs part way, or if it goes right through to the login prompt
when you say you nuked the home partition, is the partion deleted, unmounted, or on a removed / failed device?
I mean i destroyed the partition table on accident. I was trying to fix another drive, and typed in the wrong uuid.
you may be able to recover the partition with testdisk
could try to boot live and run testdisk on it, youll want another drive to recover to.
fucking birdo beat me to it.
okay, glad you had /home on a different device, usually it’s the boot that gets killed, but your luck is the other way round today.
Hope you have some luck copying data from the destroyed device once your system is working again.
I would personally unplug it if I could until I have time to play around with recovering
I’m not so sure it’s recoverable, I wrote to it a good dozen times and reformatted several too before i realized what I did. I was trying to fix a different drive that my son had set the sectors wrong. Didn’t realize my ssd uuid was only one number off of the drive I was working on.
well its already fucked, you cant fuck it more with testdisk.
Well you sir, do not mess around!
something something doing the same thing something different results.
I kept mistyping and screwing up sizes. And each time i long formatted too. It was a pain in the ass. Took forever. And this whole time, I didn’t even think to double check my work. I feel like an ass. But if recovering it don’t work, I should still be able to get into the cli and build a new /home directory right?
Have you not done that yet?
youll need to create a new /home partition, add it to /etc/fstab, and create a new user
Nope haven’t even turned it back on yet. Waiting for confirmation and double checking my sanity.
I don;t think you could make it any worse, and you were prepared to fresh install anyway, so I’d say, what cold get worse?