LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 09-01-2021, 08:24 AM   #1
bodqhrohro
Member
 
Registered: Apr 2018
Location: Ukraine
Distribution: Debian GNU/Linux 12
Posts: 61

Rep: Reputation: Disabled
Unhappy tmpfs'es get accidentally unmounted


I use tmpfs for a fast dependency cache: for example, for Golang (~/.cache/go-build), or for Node.JS (node_modules in project folders). Though accidentally they disappear. Sometimes all, sometimes a part of them.

AFAIR, it happens even when nothing touches these folders.

Can the kernel do it automatically to free the memory? I see no any entries in dmesg when this happens. Or do I have to hunt the cause in the user space?
 
Old 09-01-2021, 08:30 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 16,981

Rep: Reputation: 5734Reputation: 5734Reputation: 5734Reputation: 5734Reputation: 5734Reputation: 5734Reputation: 5734Reputation: 5734Reputation: 5734Reputation: 5734Reputation: 5734
how is it mounted at all?
 
1 members found this post helpful.
Old 09-01-2021, 08:33 AM   #3
bodqhrohro
Member
 
Registered: Apr 2018
Location: Ukraine
Distribution: Debian GNU/Linux 12
Posts: 61

Original Poster
Rep: Reputation: Disabled
sudo mount -t tmpfs -o size=512M tmpfs node_modules, for instance.
 
Old 09-01-2021, 08:46 AM   #4
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 16,981

Rep: Reputation: 5734Reputation: 5734Reputation: 5734Reputation: 5734Reputation: 5734Reputation: 5734Reputation: 5734Reputation: 5734Reputation: 5734Reputation: 5734Reputation: 5734
I don't think that will be automatically umounted. Without any log. But you [may] need to check other files in /var/log too.
 
Old 09-01-2021, 04:38 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 19,969

Rep: Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633
Quote:
Originally Posted by bodqhrohro View Post
Though accidentally they disappear. Sometimes all, sometimes a part of them.
I don't understand what you mean - please post evidence on which you base this.
tmpfs is an in-memory filesystem - it resides normally in kernel cache. It may be swapped out under memory pressure, but that is the only time it resides on disk. The size you define in the mount is the maximum is will use - not the amount actually allocated or in-use.
 
Old 09-01-2021, 06:23 PM   #6
bodqhrohro
Member
 
Registered: Apr 2018
Location: Ukraine
Distribution: Debian GNU/Linux 12
Posts: 61

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
I don't think that will be automatically umounted. Without any log. But you [may] need to check other files in /var/log too.
No any clues, unfortunately. Just "Succeeded" entries in journalctl.

I tried mounting with systemd-mount -G, and it just got a bit more verbose:

Code:
░░ Subject: Unit succeeded
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░ 
░░ The unit UNIT has successfully entered the 'dead' state.
Yet with no preceding events.

Quote:
Originally Posted by syg00 View Post
I don't understand what you mean - please post evidence on which you base this.
These filesystems disappear from the listing of mount, and the following directories get empty.
 
Old 09-01-2021, 07:37 PM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 19,969

Rep: Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633Reputation: 3633
I don't use Debian, but might be time to start looking for cleanup scripts run by timers or cron. Skulker, cruft, ... that sort of thing.
 
Old 09-02-2021, 01:42 AM   #8
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 16,981

Rep: Reputation: 5734Reputation: 5734Reputation: 5734Reputation: 5734Reputation: 5734Reputation: 5734Reputation: 5734Reputation: 5734Reputation: 5734Reputation: 5734Reputation: 5734
I guess that is an automounter (which can umount automatically if there was no access.
 
Old 09-02-2021, 07:52 AM   #9
bodqhrohro
Member
 
Registered: Apr 2018
Location: Ukraine
Distribution: Debian GNU/Linux 12
Posts: 61

Original Poster
Rep: Reputation: Disabled
Those units don't seem to be automount ones.

Here's an example of such a unit:

Code:
Where=/media/****/node_modules
What=tmpfs
Options=rw,relatime,size=1048576k
Type=tmpfs
TimeoutUSec=1min 30s
ControlPID=0
DirectoryMode=0755
SloppyOptions=no
LazyUnmount=no
ForceUnmount=no
ReadWriteOnly=no
Result=success
UID=[not set]
GID=[not set]
ExecMount={ path=/bin/mount ; argv[]=/bin/mount tmpfs /media/******/node_modules -t tmpfs -o size=1G ; ignore_errors=no ; start_time=[Thu 2021-09-02 15:31:18 EEST] ; stop_time=[Thu 2021-09-02 15:31:18 EEST] ; pid=437615 ; code=exited ; status=0 }
Slice=system.slice
ControlGroup=/system.slice/media-*******-node_modules.mount
MemoryCurrent=4096
CPUUsageNSec=[not set]
TasksCurrent=0
IPIngressBytes=[no data]
IPIngressPackets=[no data]
IPEgressBytes=[no data]
IPEgressPackets=[no data]
IOReadBytes=18446744073709551615
IOReadOperations=18446744073709551615
IOWriteBytes=18446744073709551615
IOWriteOperations=18446744073709551615
Delegate=no
CPUAccounting=no
CPUWeight=[not set]
StartupCPUWeight=[not set]
CPUShares=[not set]
StartupCPUShares=[not set]
CPUQuotaPerSecUSec=infinity
CPUQuotaPeriodUSec=infinity
IOAccounting=no
IOWeight=[not set]
StartupIOWeight=[not set]
BlockIOAccounting=no
BlockIOWeight=[not set]
StartupBlockIOWeight=[not set]
MemoryAccounting=yes
DefaultMemoryLow=0
DefaultMemoryMin=0
MemoryMin=0
MemoryLow=0
MemoryHigh=infinity
MemoryMax=infinity
MemorySwapMax=infinity
MemoryLimit=infinity
DevicePolicy=auto
TasksAccounting=yes
TasksMax=6445
IPAccounting=no
ManagedOOMSwap=auto
ManagedOOMMemoryPressure=auto
ManagedOOMMemoryPressureLimitPercent=0%
UMask=0022
LimitCPU=infinity
LimitCPUSoft=infinity
LimitFSIZE=infinity
LimitFSIZESoft=infinity
LimitDATA=infinity
LimitDATASoft=infinity
LimitSTACK=infinity
LimitSTACKSoft=8388608
LimitCORE=infinity
LimitCORESoft=0
LimitRSS=infinity
LimitRSSSoft=infinity
LimitNOFILE=524288
LimitNOFILESoft=1024
LimitAS=infinity
LimitASSoft=infinity
LimitNPROC=21485
LimitNPROCSoft=21485
LimitMEMLOCK=65536
LimitMEMLOCKSoft=65536
LimitLOCKS=infinity
LimitLOCKSSoft=infinity
LimitSIGPENDING=21485
LimitSIGPENDINGSoft=21485
LimitMSGQUEUE=819200
LimitMSGQUEUESoft=819200
LimitNICE=0
LimitNICESoft=0
LimitRTPRIO=0
LimitRTPRIOSoft=0
LimitRTTIME=infinity
LimitRTTIMESoft=infinity
OOMScoreAdjust=0
CoredumpFilter=0x33
Nice=0
IOSchedulingClass=0
IOSchedulingPriority=0
CPUSchedulingPolicy=0
CPUSchedulingPriority=0
CPUAffinityFromNUMA=no
NUMAPolicy=n/a
TimerSlackNSec=50000
CPUSchedulingResetOnFork=no
NonBlocking=no
StandardInput=null
StandardOutput=journal
StandardError=inherit
TTYReset=no
TTYVHangup=no
TTYVTDisallocate=no
SyslogPriority=30
SyslogLevelPrefix=yes
SyslogLevel=6
SyslogFacility=3
LogLevelMax=-1
LogRateLimitIntervalUSec=0
LogRateLimitBurst=0
SecureBits=0
CapabilityBoundingSet=cap_chown cap_dac_override cap_dac_read_search cap_fowner cap_fsetid cap_kill cap_setgid cap_setuid cap_setpcap cap_linux_immutable cap_net_bind_service cap_net_broadcast cap_net_admin cap_net_raw cap_ipc_lock cap_ipc_owner cap_sys_module cap_sys_rawio cap_sys_chroot cap_sys_ptrace cap_sys_pacct cap_sys_admin cap_sys_boot cap_sys_nice cap_sys_resource cap_sys_time cap_sys_tty_config cap_mknod cap_lease cap_audit_write cap_audit_control cap_setfcap cap_mac_override cap_mac_admin cap_syslog cap_wake_alarm cap_block_suspend cap_audit_read cap_perfmon cap_bpf cap_checkpoint_restore
DynamicUser=no
RemoveIPC=no
PrivateTmp=no
PrivateDevices=no
ProtectClock=no
ProtectKernelTunables=no
ProtectKernelModules=no
ProtectKernelLogs=no
ProtectControlGroups=no
PrivateNetwork=no
PrivateUsers=no
PrivateMounts=no
ProtectHome=no
ProtectSystem=no
SameProcessGroup=yes
UtmpMode=init
IgnoreSIGPIPE=yes
NoNewPrivileges=no
SystemCallErrorNumber=2147483646
LockPersonality=no
RuntimeDirectoryPreserve=no
RuntimeDirectoryMode=0755
StateDirectoryMode=0755
CacheDirectoryMode=0755
LogsDirectoryMode=0755
ConfigurationDirectoryMode=0755
TimeoutCleanUSec=infinity
MemoryDenyWriteExecute=no
RestrictRealtime=no
RestrictSUIDSGID=no
RestrictNamespaces=no
MountAPIVFS=no
KeyringMode=shared
ProtectProc=default
ProcSubset=all
ProtectHostname=no
KillMode=control-group
KillSignal=15
RestartKillSignal=15
FinalKillSignal=9
SendSIGKILL=yes
SendSIGHUP=no
WatchdogSignal=6
Id=media-******-node_modules.mount
Names=media-*******-node_modules.mount
Requires=system.slice media-d.mount -.mount
Conflicts=umount.target
Before=local-fs.target umount.target
After=-.mount local-fs-pre.target swap.target media-d.mount system.slice systemd-journald.socket
RequiresMountsFor=/media/*****
Description=/media/*****/node_modules
LoadState=loaded
ActiveState=active
FreezerState=running
SubState=mounted
FragmentPath=/run/systemd/transient/media-*****-node_modules.mount
UnitFileState=transient
UnitFilePreset=enabled
StateChangeTimestamp=Thu 2021-09-02 15:31:18 EEST
StateChangeTimestampMonotonic=58323247203
InactiveExitTimestamp=Thu 2021-09-02 15:31:18 EEST
InactiveExitTimestampMonotonic=58323226512
ActiveEnterTimestamp=Thu 2021-09-02 15:31:18 EEST
ActiveEnterTimestampMonotonic=58323247203
ActiveExitTimestampMonotonic=0
InactiveEnterTimestampMonotonic=0
CanStart=yes
CanStop=yes
CanReload=yes
CanIsolate=no
CanFreeze=no
StopWhenUnneeded=no
RefuseManualStart=no
RefuseManualStop=no
AllowIsolate=no
DefaultDependencies=yes
OnFailureJobMode=replace
IgnoreOnIsolate=yes
NeedDaemonReload=no
JobTimeoutUSec=infinity
JobRunningTimeoutUSec=infinity
JobTimeoutAction=none
ConditionResult=yes
AssertResult=yes
ConditionTimestamp=Thu 2021-09-02 15:31:18 EEST
ConditionTimestampMonotonic=58323208007
AssertTimestamp=Thu 2021-09-02 15:31:18 EEST
AssertTimestampMonotonic=58323208019
Transient=yes
Perpetual=no
StartLimitIntervalUSec=10s
StartLimitBurst=5
StartLimitAction=none
FailureAction=none
SuccessAction=none
InvocationID=0089338aaadc4e74a3cf3805bc71fe7d
CollectMode=inactive-or-failed
What can be wrong here? Maybe the mounts together reach some cgroup quota, and systemd starts hunting them with no warning?

I recall that I disabled systemd.unified_cgroup_hierarchy earlier this year, but don't remember the reason (maybe to fight this?) Though it caused problems with Docker, so I turned it back on recently.
 
  


Reply

Tags
tmpfs


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] unmounted filesystems accidentally linuxandtsm Linux - Newbie 4 07-06-2011 07:59 AM
/etc/fstab "tmpfs /tmp tmpfs defaults 0 0" ramfs?! HOW? xcislav Linux - General 2 06-04-2011 03:03 AM
tmpfs limitation 50p - how to get around it? klss Linux - General 7 03-29-2009 08:38 AM
Does /boot get unmounted? DIGITAL39 Slackware 11 01-24-2007 07:49 PM
accidentally unmounted /dev/uba1 (usb device) terminator14 Linux - Newbie 18 01-19-2006 04:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 02:07 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration