Noob - my /etc/fstab file was accidentally deleted

Hello,

I continue to use Fedora, but critical issues persist. I have installed Fedora 43 KDE three times over the past week, and I’m facing an issue again:

This morning, I had a fresh installation of Fedora.

On Steam, I was able to add 2 third-party drives for game storage, but it didn’t work for the 3rd drive. I thought it could be a permission issue.

I consulted an AI to set permanent read-write permissions on this drive. I edited the /etc/fstab file using sudo nano. The AI suggested I add ‘uid=1000,gid=1000,umask=002’ in the line related to this drive.

I added these parameters to my 5 non-system third-party drives, thinking it would prevent any future permission issues.

But after rebooting, I encountered an error. I booted from a live USB, checked the /etc/fstab file, and it was completely deleted. I need to rebuild it.

Here is the result of $ lsblk -f

NAME        FSTYPE  FSVER            LABEL              UUID                                 FSAVAIL FSUSE% MOUNTPOINTS

loop0       erofs                                       c49c3ecb-832b-440f-89b5-a601286ebff0       0   100% /run/rootfsbase

sda                                                                                                         
└─sda1      ext4    1.0              BarraCuda_2To      4a2dce3c-1a82-4554-a35b-90f1846d65ac  827.2G    50% /run/media/liveuser/BarraCuda_2To
sdb                                                                                                         
└─sdb1      ext4    1.0              SSD_Crucial_2024   7d74d34b-0a70-4fa2-8aba-ce3d335598ab    1.7T     0% /run/media/liveuser/SSD_Crucial_2024
sdc                                                                                                         
└─sdc1      ext4    1.0              Hitachi_2To        06d8e020-62c0-4c7f-a58d-eb42a65a39a2    1.6T     4% /run/media/liveuser/Hitachi_2To
sdd                                                                                                         
└─sdd1      ext4    1.0              SSD_Intel_120      f65ff707-f0e1-4cfb-9581-0ffe93ccaba1   55.9G    44% /run/media/liveuser/SSD_Intel_120
sde                                                                                                         
└─sde1      ext4    1.0              SSD_SanDisk_Ultr   2391fd26-0776-4801-aa06-774e6964b799  355.1G    14% /run/media/liveuser/SSD_SanDisk_Ultr

USB key:
sdf         iso9660 Joliet Extension Fedora-KDE-Live-43 2025-10-23-04-17-29-00                              
├─sdf1      iso9660 Joliet Extension Fedora-KDE-Live-43 2025-10-23-04-17-29-00                     0   100% /run/initramfs/live
└─sdf2      vfat    FAT16            BOOT               BA0E-CF8F                                           
zram0       swap    1                zram0              c01014f2-bb80-410d-845e-67bc201cb1da                [SWAP]

nvme0n1                                                                                                     
├─nvme0n1p1 vfat    FAT32                               A126-521B                                           
├─nvme0n1p2 ext4    1.0                                 91b08b5a-1d4b-4613-a7a8-83c39749b359                
└─nvme0n1p3 btrfs                    fedora             1f4bb829-7754-46fc-8121-92180013d7a1  447.6G     3% /run/media/liveuser/fedora

I know the file should look something like this, but I’m unsure about the lines related to nvme0n1.

UUID=A126-521B /mnt/
UUID=91b08b5a-1d4b-4613-a7a8-83c39749b359 /mnt/ 
UUID=1f4bb829-7754-46fc-8121-92180013d7a1 /mnt/

UUID=4a2dce3c-1a82-4554-a35b-90f1846d65ac /mnt/BarraCuda_2To ext4 defaults,noatime 0 2
UUID=7d74d34b-0a70-4fa2-8aba-ce3d335598ab /mnt/SSD_Crucial_2024 ext4 defaults,noatime 0 2
UUID=06d8e020-62c0-4c7f-a58d-eb42a65a39a2 /mnt/Hitachi_2To ext4 defaults,noatime 0 2
UUID=f65ff707-f0e1-4cfb-9581-0ffe93ccaba1 /mnt/SSD_Intel_120 ext4 defaults,noatime 0 2
UUID=2391fd26-0776-4801-aa06-774e6964b799 /mnt/SSD_SanDisk_Ultr ext4 defaults,noatime 0 2

Can you help me reconstruct this fstab file correctly?

My beginnings are tough!

If you still have your rescue environment up then go to…
cd /run/media/liveuser/fedora/etc/
Now I’m not a nano user, but if you are lucky you might have a fstab.save file or similar that might contain the unsaved nano buffer.
You could also do a ls -alrt to se what the latest changed/added files are in the etc directory, it might help to locate that missing fstab (perhaps just renamed by mistake?).

Second, if you do find the fstab. Start with removing that AI garbage, then attempt to boot the system.

Assuming this is the actual installed fedora OS, a rebuild of the fstab should look something like the below. Replace the UUIDS in the below with the UUIDs from your listing above.

UUID=bf958d55-772f-4694-946c-9e29501aeb89 / btrfs subvol=root,compress=zstd:1 0 0
UUID=b8eac66b-a895-46df-838a-9a05aaa9f968 /boot ext4 defaults 1 2
UUID=B0D7-A0F5 /boot/efi vfat umask=0077,shortname=winnt 0 2
UUID=bf958d55-772f-4694-946c-9e29501aeb89 /home btrfs subvol=home,compress=zstd:1 0 0

Of course you would need to also add the extra drive info lines yourself.

Use man fstab to find out exactly what format of fstab is required and what each of the 6 fields means.

1 Like

Also remember to add the nofail flag for any non-system disks (such as external drives) in your fstab entry, so that you don’t get yourself locked out in case the syntax is incorrect, or your disk is not available at boot time.

Important update:

During my first week on Fedora 43 KDE, I had to reinstall the system five times. All my problems stemmed from incorrect UEFI settings: following bad advice, I had selected “Other OS” instead of “Windows EFI” in Secure Boot.

All my rebooting problems originated from this.

2 Likes