Score:0

False positive for a duplicate entry into fstab - how do I fix it?

ba flag

I have a machine running Ubuntu 22.04.1 LTS and am getting the following errors. I did some digging and in the process, the UUID appeared to update by itself. The UUIDs are unique for each partition. Thanks in advance!

The machine has 2 HDs - here is the partition map:

NAME         MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
loop0          7:0    0     4K  1 loop /snap/bare/5
loop1          7:1    0     9M  1 loop /snap/canonical-livepatch/146
loop2          7:2    0     9M  1 loop /snap/canonical-livepatch/164
loop3          7:3    0 116.7M  1 loop /snap/core/14399
loop4          7:4    0  63.2M  1 loop /snap/core20/1623
loop5          7:5    0  63.2M  1 loop /snap/core20/1738
loop6          7:6    0 237.5M  1 loop /snap/firefox/2154
loop7          7:7    0 238.9M  1 loop /snap/firefox/2186
loop8          7:8    0 346.3M  1 loop /snap/gnome-3-38-2004/115
loop9          7:9    0 346.3M  1 loop /snap/gnome-3-38-2004/119
loop10         7:10   0  91.7M  1 loop /snap/gtk-common-themes/1535
loop11         7:11   0  49.6M  1 loop /snap/snapd/17883
sda            8:0    0 223.6G  0 disk 
├─sda1         8:1    0  46.6G  0 part /var/snap/firefox/common/host-hunspell
│                                      /
├─sda2         8:2    0  29.8G  0 part 
├─sda3         8:3    0  29.8G  0 part /tmp
├─sda4         8:4    0  55.9G  0 part /var
└─sda5         8:5    0  61.5G  0 part /home
mmcblk0      179:0    0   7.3G  0 disk 
├─mmcblk0p1  179:1    0   953M  0 part /boot/efi
├─mmcblk0p2  179:2    0 953.7M  0 part /boot
└─mmcblk0p3  179:3    0   5.4G  0 part /BACKUP
mmcblk0boot0 179:8    0     4M  1 disk 
mmcblk0boot1 179:16   0     4M  1 disk 

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a device; this may
# be used with UUID= as a more robust way to name devices that works even if
# disks are added and removed. See fstab(5).
#
# <file system>             <mount point>  <type>  <options>  <dump>  <pass>
UUID=214D-F8FD                            /boot/efi      vfat    umask=0077 0 2
UUID=93c3d235-47b3-482c-aa36-3aabbb2a8fbe /boot          ext4    defaults,discard 0 2
UUID=97c7ace2-37a8-40aa-9771-fdf9cb2f6e54 /BACKUP        ext4    defaults,discard 0 2
UUID=defbea08-edb4-4474-926b-17812c8d5939 /              ext4    defaults,discard 0 1
UUID=05a809ef-edd1-425a-a5b4-84621973e76e /var           ext4    defaults,discard 0 2
UUID=7b57c124-3528-4889-909b-d2ff6a8d9e66 /home          ext4    defaults,discard 0 2
UUID=c67c46d0-6ad8-4153-9e93-fbc68208df48 /tmp           ext4    defaults,discard 0 2
/swapfile                                 swap           swap    defaults   0 0
tmpfs                                     /tmp           tmpfs   defaults,noatime,mode=1777 0 0

The errors from /var/log/syslog:

kernel: [  698.762590] systemd-fstab-generator[3740]: Failed to create unit file /run/systemd/generator/tmp.mount, as it already exists. Duplicate entry in /etc/fstab?
systemd[3729]: /usr/lib/systemd/system-generators/systemd-fstab-generator failed with exit status 1.
Score:3
us flag

Your system probably has the systemd tmp.mount enabled. Check with:

systemctl status tmp.mount

If so, you don't need the /tmp mount in your /etc/fstab, as the systemd-fstab-generator will generate the entry.

Matty avatar
ba flag
matthew@minestry-of-magic:~$ systemctl status tmp.mount ● tmp.mount - /tmp Loaded: loaded (/etc/fstab; generated) Active: active (mounted) since Wed 2022-12-14 18:10:30 EST; 51s ago Where: /tmp What: /dev/sda3 Docs: man:fstab(5) man:systemd-fstab-generator(8) Tasks: 0 (limit: 18592) Memory: 48.0K CPU: 4ms CGroup: /system.slice/tmp.mount Dec 14 18:10:30 minestry-of-magic systemd[1]: Mounting /tmp... Dec 14 18:10:30 minestry-of-magic systemd[1]: Mounted /tmp.
Matty avatar
ba flag
There are two lines in fstab for tmp: UUID=c67c46d0-6ad8-4153-9e93-fbc68208df48 /tmp ext4 defaults,discard 0 2 tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0 Should I comment out both? I segmented tmp because it is a firewall appliance (not public facing, it sits between my network and the telco modem).
zwets avatar
us flag
Not sure what you mean by a "segmented tmp" but systemd will create a `tmpfs` filesystem and mount it at `/tmp`. If you are low on memory and the `/tmp` partition you created is good enough, you could equally well `systemd disable tmp.mount`.
Matty avatar
ba flag
I broke out the file system into individual partitions. That's what I was meaning. ah ha. ok. Thanks for the help.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.