LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Recreating fstab for a LUKS drive that was accidentally deleted (https://www.linuxquestions.org/questions/linux-newbie-8/recreating-fstab-for-a-luks-drive-that-was-accidentally-deleted-4175717934/)

Uddercup 10-19-2022 03:33 PM

Recreating fstab for a LUKS drive that was accidentally deleted
 
I was having trouble booting my system and in the process of following some directions incorrectly and trying to fix it, I accidentally overwrote my fstab file. Now I'm having trouble recreating it in order to be able to log in. Currently the system will boot, ask for the encryption password, run fsck, and then take me to the dekstop login screen. After typing in my password however, the screen will flash black for a few seconds, then return to the login screen. I'm not 100% sure this is caused by the fstab, but it started happening after I accidentally overwrote it. I was able to find this old thread with some helpful information, but I'm still having issues.

This is what my fstab currently looks like:
Code:

# <file system> <mount point>  <type>  <options>  <dump>  <pass>
/dev/mapper/luks-7523dc92-a54d-4cce-8c8a-8f46a3ca4edd /    ext4    defaults    1  2
/dev/mapper/luks-4dd38da4-6cc6-46cd-87bf-096bbc83b75e /l    ext4    defaults    1  2

And this is what my crypttab looks like, this is unchanged from when the system was working previously:
Code:

# /etc/crypttab: mappings for encrypted partitions.
#
# Each mapped device will be created in /dev/mapper, so your /etc/fstab
# should use the /dev/mapper/<name> paths for encrypted devices.
#
# See crypttab(5) for the supported syntax.
#
# NOTE: You need not list your root (/) partition here, but it must be set up
#      beforehand by the initramfs (/etc/mkinitcpio.conf). The same applies
#      to encrypted swap, which should be set up with mkinitcpio-openswap
#      for resume support.
#
# <name>              <device>                        <password> <options>
luks-7523dc92-a54d-4cce-8c8a-8f46a3ca4edd UUID=7523dc92-a54d-4cce-8c8a-8f46a3ca4edd    /crypto_keyfile.bin luks
luks-4dd38da4-6cc6-46cd-87bf-096bbc83b75e UUID=4dd38da4-6cc6-46cd-87bf-096bbc83b75e    /crypto_keyfile.bin luks

"l" is the name of my login, so I chose that as the mounting point in fstab, though I'll admit that was a complete guess.

Does anyone know what needs to be done to correct the fstab? Barring that, is it possible to reinstall just the OS while keeping my programs, data, and settings intact?

Thanks in advance!

PsychoHermit 10-19-2022 09:29 PM

I believe /l should be /home/l

That shouldn't stop it from booting though.

[edit] Reinstalling will not overwrite your settings etc. as you have a separate home partition. [/edit]

-glenn

[edit[ Right, that should have been /home [/edit]

Uddercup 10-21-2022 06:26 PM

Quote:

Originally Posted by PsychoHermit (Post 6387297)
I believe /l should be /home/l

That shouldn't stop it from booting though.

[edit] Reinstalling will not overwrite your settings etc. as you have a separate home partition. [/edit]

-glenn

Thank you for this reply! While it wasn't the exact solution, it did point me in the right direction.

I changed the path to /home/l and still had the same issue after rebooting; got to the login screen, logged in, hung on a black screen, then dropped back on the login screen. Next I tried changing the path to /home/ and sure enough, logged in right to the desktop with no issues. I'm both overjoyed and a little annoyed the solution ended up being so simple.


All times are GMT -5. The time now is 10:12 PM.