0

I accidently deleted my /etc/ directory. Here is my disk with installation -

Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 5401B3C5-4DA4-4F2D-BB2B-F1845E8E8E4F

Device       Start        End    Sectors   Size Type
/dev/sda1     2048    1050623    1048576   512M EFI System
/dev/sda2  1050624    2050047     999424   488M Linux filesystem
/dev/sda3  2050048 1953523711 1951473664 930.5G Linux filesystem

ubuntu@ubuntu:~$ ls -al /dev/disk/by-uuid/
total 0
drwxr-xr-x 2 root root 160 Jun  9 03:18 .
drwxr-xr-x 8 root root 160 Jun  9 03:07 ..
lrwxrwxrwx 1 root root  10 Jun  9 03:08 64490475-1baf-4a81-a7be- 87f617f51228 -> ../../sda2                        
lrwxrwxrwx 1 root root  10 Jun  9 03:08 D378-4726 -> ../../sda1
lrwxrwxrwx 1 root root  10 Jun  9 03:18 db611ff4-b7e6-41ad-935b-d70ee56a30ac -> ../../sda3

lrwxrwxrwx 1 root root  10 Jun  9 03:18 dc7811ca-4 c11-4547-9971-49ef2409989f -> ../../dm-1
lrwxrwxrwx 1 root root  10 Jun  9 03:08 6895-5744 -> ../../sdb1
lrwxrwxrwx 1 root root  10 Jun  9 03:18 a4774c86-924b-425f-a6ef-3cba2d2cb24a -> ../../dm-2

i dont want to reinstall. I have a live USB. I want to manually write the /etc/fstab file to get my system to boot atleast. What should be the entries?

2
  • 2
    There's a whole lot of stuff in /etc besides fstab. If you deleted /etc from the GUI it could be sitting in your trash can waiting to be restored. If there is a backup anywhere, this thread may help you askubuntu.com/questions/814811/how-to-restore-fstab-file
    – jones0610
    Commented Jun 9, 2017 at 3:59
  • Could you please mount all these drives, list the content of their root directory and edit your question to include the listings? We also need the output of sudo lsblk -f. Thanks. Commented Jun 9, 2017 at 7:55

1 Answer 1

1

You should have a look on this answer using extundelete. As said in the comments fstab alone won't bring your system back!

Try to recover the whole folder if it's not too late. Important: This will only work if you don't mess around with it now until you recovered!

If it does not work try to at least get you data out there and reinstall your system.

1
  • 1
    If your answer is essentially a referral to another question, it would be better to flag this question as a duplicate of the other once you earned 15 reputation. Don't forget to vote for the answer(s) there that you found useful! Commented Jun 9, 2017 at 7:56

Not the answer you're looking for? Browse other questions tagged .