LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Ho to delete "orphaned" files after switching /tmp from ext4 to tmpfs? (https://www.linuxquestions.org/questions/linux-software-2/ho-to-delete-orphaned-files-after-switching-tmp-from-ext4-to-tmpfs-4175441314/)

JZL240I-U 12-13-2012 09:26 AM

Ho to delete "orphaned" files after switching /tmp from ext4 to tmpfs?
 
Currently my /tmp is placed as a subdirectory in / which is ext4. Sometimes there stays a lot of unused garbage which I have to delete by hand. I read this thread http://www.linuxquestions.org/questi...fs-4175439818/ with an interesting discussion of the merits of the use of tmpfs. So I want to use it, too.

But some of the files in my old /tmp are in use, so I can't delete them. So when I put
Code:

tmpfs /tmp tmpfs relatime,nodev,nosuid,size=20% 0 0
in /etc/fstab and reboot these files will stay on the disk and can't be reached (since they reside on the hard disk and the new tmpfs is in the RAM).

How can I get rid of them?
TIA :).

<edit> Darn. How to... Sometimes I must be blind. Sorry. </edit>

gdejonge 12-13-2012 10:06 AM

Normally you would boot in single user (maintenance mode) to do this kind of work.

Boot your system in single user. Umount the tmpfs. Clean out the /tmp dir. Reboot.

JZL240I-U 12-14-2012 06:29 AM

Works exactly as advised. Additional remark: I thought runlevel 1 needed a /tmp as well. Obviously it doesn't. Thanks for your help, marked as solved.


All times are GMT -5. The time now is 10:09 PM.