![]() ![]() This is why /tmp is usually not on-disk but a tmpfs in most installs. I would also recommend that unless your RAM is at a premium, you remove the /tmp LV and replace it with a tmpfs that lives in RAM and is erased on reboot. Even if youve got some lurking gremlin which is preventing you from fully unmounting the device, you have at least got your filesystem in a consistent state. This is where you will need to go into your system from the other boot disk, activate the LVM environment, and then resize your LVs from there when there's no data being written or used in your special /tmp LV. The recovery environment also uses /tmp because of the kernel and such and critical systemd resources writing there. SystemD among other things (critical system processes and such) all write to /tmp - this is USUALLY why you don't create LVs or anything for /tmp and let it live in volatile memory which is much much faster than writing to the disks for temporary files. There's no lsof or fuser command that'll list that the SystemD system is using /tmp for storage of things. Your only option here is to power down your system and boot to an alternative environment or LiveUSB. Does anyone know if there is another lsof option that can show me more processes that would eventually lock that filesystem ? dev/mapper/myVG-tmp on /tmp type ext4 (rw,relatime)ĮDIT1 : I also tried the same commands in Ubuntu recovery mode but neither fuser nor lsof were able to show me what process was locking the /tmp filesystem. Lsof: WARNING: can't stat() fuse file system /run/user/1001/docĮDIT0 : I created /tmp manually (and other partitions as well) before installing Ubuntu 20.04 : $ mount | grep -w /tmp Lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1001/gvfs So I investigated with fuser and lsof but they show nothing : $ sudo fuser -vm /tmp Lastly, if all above options and methods failed for you, you may try the final method reboot or SysRq or hardware resetting to reboot you Linux.I need to reduce my /tmp LV so I type this command : $ sudo lvreduce -r -L -2G /dev/myVG/tmpįsadm: Cannot proceed with mounted filesystem "/tmp". Then you can continue to umount the filesystem. mnt/data) by # fuser /mnt/dataįuser can also help you kill all processes using a filesystem at the same time by # fuser -k /mnt/data You can find out the processes using a filesystem (e.g. ![]() After the processes are killed, the filesystem will be able to be unmounted. If you are sure that it is safe to kill the process, you may kill them by kill or kill -9. It will output lines like bash 17622 user1 cwd DIR 253,2 4096 2 /mnt/data Here, we use the mount point /mnt/data as an example. You need to run the following command as root. The following command finds out the processes accessing the partition/filesystem. Here, we introduce 2 common methods with 2 common tools. If the reason is that processes are using the filesystem, we can kill the processes using the filesystem and then it will be fine to unmount it. Option 2: Kill the processes using the filesystem and then unmount it Please be aware that programs may not expect a force or lazy unmounting and these options may disrupt running processes using the filesystem, cause data loss or corrupt files opened. The -f option is for unreachable NFS system. f, -forceįorce an unmount (in case of an unreachable NFS system). There are options of umount to detach a busy device immediately even if the device is busy. If the remounting can succeed, it avoids the problems of disrupting or killing processes. The “-o remount” option will make Linux try to remount the filesystem. For these situations, you may first try # mount -o remount /your/mount/point It is common that the reason we want to unmount a filesystem is that we find that there are problems with the mounting temporarily and we want to unmount and re-mount it. Here this option is not to really do unmounting a filesystem. Option 2: Kill the processes using the filesystem and then unmount it.Option 0: Try to remount the filesystem if what you want is remounting. ![]()
0 Comments
Leave a Reply. |