change "/tmp" deletion from the time of boot to the time of shutting down to prevent data loss

Nicholas Guriev guriev-ns at
Mon Jul 26 20:19:09 UTC 2021


On Пн, 2021-07-12 at 00:33 +0300, Tamooz wrote:
> I have personally encountered a potentially widespread problem with the 
> deletion of the "/tmp" folder at boot, as I can not recover 
> automatically saved files found in said folder after a system crash, 
> which may result in losing valuable data that has been created between 
> the time of the last manual save and the automatic saving of said files.
> My idea is to delete "/tmp" at the time of shutting down the machine 
> properly, as in that case they wouldn't be needed, or after a certain 
> amount of crashes occur without a successful shut-down, delete all data 
> from generated before previous crashes

You can pass `init=/bin/bash` as kernel boot parameter through GRUB and
then copy the temporary files to a safe place. And that way will work
even if the computer was off normally. I once used this loophole myself
to save files which I had forgotten. However in general, /tmp is not
intended to have important data which is worth regretting.

I am sending this message for the second time because of wrong author's
address earlier. Sorry if you receive this message twice.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <>

More information about the Ubuntu-devel-discuss mailing list