Want to subscribe to topics you're interested in?
Become a Member

mount-loop.service: special device tmpfs does not exist.

Discussion in 'AlmaLinux 8 & Rocky Linux 8 Beta Testing' started by Investrum, Mar 12, 2024.

Tags:
  1. Investrum

    Investrum New Member

    13
    1
    3
    Jun 19, 2019
    Ratings:
    +5
    Local Time:
    11:25 AM
    1.25.4
    MariaDB 10.6
    After installing Centminmod there was a problem with mount-loop.service. It failed to start.
    Code (Text):
    ● mount-loop.service - Mount loop device for /tmp
       Loaded: loaded (/etc/systemd/system/mount-loop.service; enabled; vendor preset: disabled)
       Active: failed (Result: exit-code) since Tue 2024-03-12 10:05:27 MSK; 2min 5s ago
      Process: 759 ExecStart=/usr/local/bin/mount-loop.sh (code=exited, status=32)
     Main PID: 759 (code=exited, status=32)
    
    Mar 12 10:05:27 host.mydomain.com systemd[1]: Starting Mount loop device for /tmp...
    Mar 12 10:05:27 host.mydomain.com mount-loop.sh[763]: mount: /tmp: special device tmpfs does not exist.
    Mar 12 10:05:27 host.mydomain.com systemd[1]: mount-loop.service: Main process exited, code=exited, status=32/n/a
    Mar 12 10:05:27 host.mydomain.com systemd[1]: mount-loop.service: Failed with result 'exit-code'.
    Mar 12 10:05:27 host.mydomain.com systemd[1]: Failed to start Mount loop device for /tmp.
    
    My VPS: 8vCPU, 8 Gb RAM, 120 Gb disk.
    CM version: 130.00beta01.b545
    Code (Text):
    Architecture:        x86_64
    CPU op-mode(s):      32-bit, 64-bit
    Byte Order:          Little Endian
    CPU(s):              8
    On-line CPU(s) list: 0-7
    Thread(s) per core:  1
    Core(s) per socket:  8
    Socket(s):           1
    NUMA node(s):        1
    Vendor ID:           AuthenticAMD
    BIOS Vendor ID:      Red Hat
    CPU family:          23
    Model:               49
    Model name:          AMD EPYC 7502 32-Core Processor
    BIOS Model name:     RHEL-8.6.0 PC (Q35 + ICH9, 2009)
    Stepping:            0
    CPU MHz:             2499.996
    BogoMIPS:            4999.99
    Virtualization:      AMD-V
    Hypervisor vendor:   KVM
    Virtualization type: full
    L1d cache:           64K
    L1i cache:           64K
    L2 cache:            512K
    L3 cache:            16384K
    NUMA node0 CPU(s):   0-7
    Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm rep_good nopl cpuid extd_apicid tsc_known_freq pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy svm cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw perfctr_core ssbd ibrs ibpb stibp vmmcall fsgsbase tsc_adjust bmi1 avx2 smep bmi2 rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves clzero xsaveerptr wbnoinvd arat npt lbrv nrip_save tsc_scale vmcb_clean pausefilter pfthreshold v_vmsave_vmload umip rdpid arch_capabilities
    
    Code (Text):
                  total        used        free      shared  buff/cache   available
    Mem:           7911        1098        6187          13         625        6550
    Low:           7911        1724        6187
    High:             0           0           0
    Swap:          4095           0        4095
    Total:        12007        1098       10283
    
    Code (Text):
    Filesystem     Type      Size  Used Avail Use% Mounted on
    devtmpfs       devtmpfs  3.9G     0  3.9G   0% /dev
    tmpfs          tmpfs     3.9G     0  3.9G   0% /dev/shm
    tmpfs          tmpfs     3.9G  8.7M  3.9G   1% /run
    tmpfs          tmpfs     3.9G     0  3.9G   0% /sys/fs/cgroup
    /dev/vda2      ext4      114G  5.8G  102G   6% /
    /dev/vda1      ext2      504M  162M  317M  34% /boot
    tmpfs          tmpfs     792M     0  792M   0% /run/user/0
    


     
  2. eva2000

    eva2000 Administrator Staff Member

    52,749
    12,077
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,604
    Local Time:
    6:25 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  3. Investrum

    Investrum New Member

    13
    1
    3
    Jun 19, 2019
    Ratings:
    +5
    Local Time:
    11:25 AM
    1.25.4
    MariaDB 10.6
    I reed this thread, but it didn't help.
    Code (Text):
    #!/bin/bash
    mount -o rw,noexec,nosuid tmpfs /tmp
    Code (Text):
    [Unit]
    Description=Mount loop device for /tmp
    After=local-fs.target
    Requires=local-fs.target
    
    [Service]
    ExecStart=/usr/local/bin/mount-loop.sh
    ExecStop=/usr/bin/umount /tmp
    Type=oneshot
    RemainAfterExit=yes
    
    [Install]
    WantedBy=multi-user.target
     
  4. eva2000

    eva2000 Administrator Staff Member

    52,749
    12,077
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,604
    Local Time:
    6:25 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Still need the install log to be able to see what happened at initial creation stage for the /tmp

    files' content look good though if that is what the default files created by initial Centmin Mod install setup. Or did you manually add those files after install?

    what output do you get for
    Code (Text):
    mount | grep /tmp
    

    Code (Text):
    cat /etc/fstab | grep tmp
    

    Code (Text):
    ls -ld /tmp
    

    and manual mounting of /tmp
    Code (Text):
    mount -o rw,noexec,nosuid tmpfs /tmp
    

    and verify /tmp is is listed from below command
    Code (Text):
    df -hT
     
  5. Investrum

    Investrum New Member

    13
    1
    3
    Jun 19, 2019
    Ratings:
    +5
    Local Time:
    11:25 AM
    1.25.4
    MariaDB 10.6
    Working on it. Pastebin does not accept such a large size of logs: You have exceeded the maximum size of 512 kilobytes per Paste. :D
    Yes, it default files. I didn't add anything manually.
    Nothing.
    Nothing.
    Code (Text):
    drwxrwxrwt 13 root root 4096 Mar 13 03:25 /tmp
    Code (Text):
    mount: /tmp: special device tmpfs does not exist.
    Code (Text):
    Filesystem     Type      Size  Used Avail Use% Mounted on
    devtmpfs       devtmpfs  3.9G     0  3.9G   0% /dev
    tmpfs          tmpfs     3.9G     0  3.9G   0% /dev/shm
    tmpfs          tmpfs     3.9G  8.7M  3.9G   1% /run
    tmpfs          tmpfs     3.9G     0  3.9G   0% /sys/fs/cgroup
    /dev/vda2      ext4      114G  6.5G  101G   7% /
    /dev/vda1      ext2      504M  162M  317M  34% /boot
    tmpfs          tmpfs     792M     0  792M   0% /run/user/0
    
     
  6. Investrum

    Investrum New Member

    13
    1
    3
    Jun 19, 2019
    Ratings:
    +5
    Local Time:
    11:25 AM
    1.25.4
    MariaDB 10.6
    I think it's probably wrong way...
    tmp.mount is disabled by default. I enable it. And after reboot:
    Code (Text):
    [root@host.mydonain.com ~]# systemctl status tmp.mount
    ● tmp.mount - Temporary Directory (/tmp)
       Loaded: loaded (/usr/lib/systemd/system/tmp.mount; enabled; vendor preset: disabled)
       Active: active (mounted) since Wed 2024-03-13 04:44:45 MSK; 3min 56s ago
        Where: /tmp
         What: tmpfs
         Docs: man:hier(7)
               https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems
        Tasks: 0 (limit: 50404)
       Memory: 4.0K
       CGroup: /system.slice/tmp.mount
    And also I saw mounted /tmp in tmpfs:
    Code (Text):
    [root@host.mydomain.com ~]# df -hT
    Filesystem     Type      Size  Used Avail Use% Mounted on
    devtmpfs       devtmpfs  3.9G     0  3.9G   0% /dev
    tmpfs          tmpfs     3.9G     0  3.9G   0% /dev/shm
    tmpfs          tmpfs     3.9G  8.7M  3.9G   1% /run
    tmpfs          tmpfs     3.9G     0  3.9G   0% /sys/fs/cgroup
    /dev/vda2      ext4      114G  6.5G  101G   7% /
    tmpfs          tmpfs     3.9G  4.0K  3.9G   1% /tmp
    /dev/vda1      ext2      504M  162M  317M  34% /boot
    tmpfs          tmpfs     792M     0  792M   0% /run/user/0
    But anyway mount-loop.service start failed:
    Code (Text):
    [root@host.mydomain.com ~]# systemctl status mount-loop.service
    ● mount-loop.service - Mount loop device for /tmp
       Loaded: loaded (/etc/systemd/system/mount-loop.service; enabled; vendor preset: disabled)
       Active: failed (Result: exit-code) since Wed 2024-03-13 04:44:45 MSK; 16min ago
     Main PID: 760 (code=exited, status=32)
    
    Mar 13 04:44:45 host.favorit.club systemd[1]: Starting Mount loop device for /tmp...
    Mar 13 04:44:45 host.favorit.club mount-loop.sh[767]: mount: /tmp: special device tmpfs does not exist.
    Mar 13 04:44:45 host.favorit.club systemd[1]: mount-loop.service: Main process exited, code=exited, status=32/n/a
    Mar 13 04:44:45 host.favorit.club systemd[1]: mount-loop.service: Failed with result 'exit-code'.
    Mar 13 04:44:45 host.favorit.club systemd[1]: Failed to start Mount loop device for /tmp.
     
  7. eva2000

    eva2000 Administrator Staff Member

    52,749
    12,077
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,604
    Local Time:
    6:25 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    that tmp.mount service is meant to only run once if /tmp isn't mounted as tmpfs so I think the error you had is you already had /tmp as tmpfs so manually starting our mounting errored out. If you reboot the server and see /tmp mounted as tmpfs then that is the desired action. You can ignore the manual start of the mount-loop service as it's already ran and mounted /tmp as tmpfs

    If you have no important data on the server, you can verify if it works again by wiping and reloading fresh AlmaLinux 8 OS and install Centmin Mod and see if /tmp gets mounted this time.
     
  8. Investrum

    Investrum New Member

    13
    1
    3
    Jun 19, 2019
    Ratings:
    +5
    Local Time:
    11:25 AM
    1.25.4
    MariaDB 10.6
    Okay, then I'm disabled it.
    No no. This error occurs even with inactive tmp.mount.
    As I said earlier an error occurs when using mount command and /tmp is not mounted as tmpfs.
    But I did fix the problem. I found a similar situation: https://unix.stackexchange.com/questions/110203/special-device-tmpfs-does-not-exist, and had to define the type. Although man mount says that it is not required: The option -t type is optional. The mount command is usually able to detect a filesystem. Perhaps in my case, for some unknown reason, it was required.
    Also I decided to add the nodev option. So the contents of my mount-loop.sh now this:
    Code (Text):
    #!/bin/bash
    mount -t tmpfs -o rw,noexec,nodev,nosuid tmpfs /tmp
     
  9. eva2000

    eva2000 Administrator Staff Member

    52,749
    12,077
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,604
    Local Time:
    6:25 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Ah thanks for that update, guess I need to add the type :)

    edit: I see the issue now. Centmin Mod mounts /tmp as tmpfs or non-tmpfs depending on detected memory amount installed on the server. So if you have low memory installed, /tmp is mounted as non-tmpfs mount as you don't want a lot of data writing to /tmp when there isn't enough memory backed storage for /tmp.

    130.00beta01 has been updated with a fix to ensure mount type is set despite my AlmaLinux 8 and 9 instances working fine. Could be specific to Rocky Linux?

    i.e. on low memory set ext4 /tmp without type mentioned. As you can see on my 3813MB installed memory system, if I left system setup /tmp as tmpfs ram disk it auto sets up as 1/2 of installed memory = ~1900MB and that isn't much for /tmp. So Centmin Mod automatically detects memory installed at initial install time and sees this and sets up /tmp as non-tmpfs non-ramdisk at 3.9GB size on disk which is more adequate size for /tmp where many services may use it including MySQL. Currently, Centmin Mod 130.00beta01 only sets up /tmp as tmpfs ramdisk if it detects server as having more than ~15.2GB of installed memory of which system allocates 1/2 installed memory as /tmp tmpfs ramdisk size = ~7.6GB to be usable if required/freed when necessary.
    Code (Text):
    cat /usr/local/bin/mount-loop.sh
    #!/bin/bash
    mount -o loop,rw,noexec,nosuid /home/usertmp_donotdelete /tmp
    

    Code (Text):
    df -hT
    Filesystem     Type      Size  Used Avail Use% Mounted on
    devtmpfs       devtmpfs  1.9G     0  1.9G   0% /dev
    tmpfs          tmpfs     1.9G     0  1.9G   0% /dev/shm
    tmpfs          tmpfs     1.9G  185M  1.7G  10% /run
    tmpfs          tmpfs     1.9G     0  1.9G   0% /sys/fs/cgroup
    /dev/sda2      xfs        80G   20G   61G  25% /
    /dev/loop0     ext4      3.9G  108K  3.7G   1% /tmp
    tmpfs          tmpfs     382M     0  382M   0% /run/user/1000
    
     
    Last edited: Mar 15, 2024