Skip to main content
10 events
when toggle format what by license comment
Apr 9, 2023 at 11:04 comment added cas Already opened files are not the only things in /tmp to be concerned about. Other important things include: all the /tmp/systemd-private-*/ directories that systemd creates for running services; private tmp dirs for uids under /tmp/user; socket files for for ssh-agent, tmux, dbus, and more. All of these become inaccessible when a filesystem is mounted over an existing, in-use /tmp dir. As I said, not a great idea to mess with it, especially when there are many better alternatives.
Apr 9, 2023 at 9:53 comment added Artem S. Tashkinov Any already open file handles are still valid until they're closed. - exactly what I was talking about. Mounting something on top of /tmp is relatively safe.
Apr 8, 2023 at 23:13 comment added cas @ArtemS.Tashkinov when you mount a filesystem, you can no longer see, or open, the files & dirs that were in the mount-point before the mount. Any already open file handles are still valid until they're closed. Try making directory /tmp/junk, copy a bunch of files & dirs into it. run ls on it. then truncate -s 1G /tmp/1gb.img; mkfs.ext4 /tmp/1gb.img; sudo mount -o loop /tmp/1gb.img /tmp/junk. run ls /tmp/junk again, all you'll see is the lost+found dir.
Apr 8, 2023 at 20:58 comment added doneal24 @cas You really should not need to edit a well-written script but just set TMPDIR prior to running it. Unfortunately I don’t see a lot of scripts that are this well written.
Apr 8, 2023 at 19:02 history became hot network question
Apr 8, 2023 at 13:29 comment added Artem S. Tashkinov Existing open files will be available/usable and nothing will break. The issue might arise with directories but those could simply be copied/recreated.
Apr 8, 2023 at 11:15 vote accept sdaau
Apr 8, 2023 at 11:10 comment added cas why not edit the script so that it uses /var/tmp/ or some other directory with enough space available (whether it's a mount-point or not)? It's not a great idea to mount another fs over /tmp unless you do it very early in the boot process (before anything really starts using it) - files that were already in /tmp won't be available when a new fs is mounted on top of it (even overlayfs doesn't really solve that problem if you need RW access to the older files in /tmp)
Apr 8, 2023 at 11:03 answer added Artem S. Tashkinov timeline score: 8
Apr 8, 2023 at 11:00 history asked sdaau CC BY-SA 4.0