Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Recently, I have found that my debian 8.2 (jessie) installation is taking forever to boot because systemd will hang for several minutes on a start job is running for create volatile files and directories. I have consulted various debian forums that have provided the solution of deleting the /tmp directory and re-creating it.

http://forums.debian.net/viewtopic.php?f=10&t=118008

However, when I tried to do this, I got the error: cannot remove /tmp device or resource busy. I have already come across another forum where this is discussed, but none of their solutions are working for me (lsof and umount).

How to get over "device or resource busy"?

These are (currently) the contents of my /tmp directory:

chris@debian:/tmp$ ls -a
.                 lu7rao5i.tmp
..                orbit-chris
gnucash.trace     OSL_PIPE_1000_SingleOfficeIPC_d3a739592b2fd367937df734e849bd3
hsperfdata_chris  systemd-private-72f0212651f2433dbce43b96e2dea612-cups.service-9OArRS
kde-chris

I will provide output to any requested bash commands.

EDIT 1:

chris@debian:~$ mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,relatime,size=10240k,nr_inodes=1017089,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,relatime,size=1630924k,mode=755)
/dev/sda1 on / type ext4 (rw,relatime,errors=remount-ro,data=ordered)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=22,pgrp=1,timeout=300,minproto=5,maxproto=5,direct)
mqueue on /dev/mqueue type mqueue (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
rpc_pipefs on /run/rpc_pipefs type rpc_pipefs (rw,relatime)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,relatime)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=815464k,mode=700,uid=1000,gid=1000)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
chris@debian:~$ getenforce
bash: getenforce: command not found
chris@debian:~$ sudo getenforce
[sudo] password for chris: 
sudo: getenforce: command not found
chris@debian:~$ ls -ld /tmp/
drwxrwxrwt 8 root root 247619584 Jan  9 18:35 /tmp/

EDIT 2: Everything can be moved to another temporary location except for the systemd-private-72f0212651f2433dbce43b96e2dea612-cups.service-9OArRS

It gives me this error: mv: cannot move ‘systemd-private-72f0212651f2433dbce43b96e2dea612-cups.service-9OArRS/’ to ‘/home/chris/moveto/systemd-private-72f0212651f2433dbce43b96e2dea612-cups.service-9OArRS’: Operation not permitted

However, it ^ can be moved with sudo.

share|improve this question
    
Can you show us the output of mount, getenforce, and ls -ld /tmp? – Paul Calabro Jan 10 at 1:32
    
Also, what happens if your try to move those files one by one to another temporary location outside of /tmp? – Paul Calabro Jan 10 at 1:33
    
getenforce seems to have something to do with SELinux, which I'm pretty sure I'm not running... – System84 Jan 10 at 2:52
    
That's a private /tmp/ folder created for cups by systemd. You can remove it by stopping the cups service: sudo systemctl stop cups – saiarcot895 Jan 10 at 2:57
    
Even after stopping cups, I'm still stuck at rm: cannot remove ‘/tmp/’: Device or resource busy – System84 Jan 10 at 4:40

"One quick solution you can try is booting into single-user mode (which should prevent contention with other users and processes), removing the folder, and then rebooting. – Paul Calabro"

Fixed! The boot process was so quick, I didn't even see the text screen!

I booted into recovery mode, entered the root password and did:

cd ..
rm -rf /tmp
mkdir /tmp
chmod 1777 /tmp

(The cd .. was to get to the root directory)

Thanks to user Paul Calabro and others!

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.