deleted /tmp the other day
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
deleted /tmp the other day
So I was going to delete /home/user/tmp the other day and ended up deleting /tmp instead. Yeah, I know. Stupid mistake. I was very busy and I wasn't paying attention when I ran sudo. Of course, I couldn't log in when I tried to reboot. Apparently, /tmp contains encoded login information or something. Thankfully, I had previously taken an image of my drive with clonezilla. Unfortunately, you cannot browse the file structure of saved clonezilla images. I had to load the entire image onto a third hard drive just the get the contents of the /tmp folder. Does anyone out there know how to get specific files off saved clonezilla images without restoring the entire image? I am looking for something similar to Symantec ghost explorer.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: deleted /tmp the other day
There are various ways to fix this. Follow the steps till 8 here http://community.linuxmint.com/tutorial/view/339 to get to a basic shell. That may still work. Then you can recreate a /tmp folder with:
You couldn't have deleted /tmp without being root, so perhaps be a little more careful with using the root account
If the above doesn't work, there is a slightly more involved version using the Linux Mint installation DVD / USB stick. Do you have one?
Code: Select all
sudo mkdir /tmp
sudo chmod 1777 /tmp
If the above doesn't work, there is a slightly more involved version using the Linux Mint installation DVD / USB stick. Do you have one?
Re: deleted /tmp the other day
yeah. I ran the command to delete /tmp as root. I wasn't paying attention. So if I simply recreated the /tmp folder, then the contents would automatically be repopulated the next time I tried to login?
I access mint install with both dvd and usb via grub4dos. what is the involved method that you spoke of?
I access mint install with both dvd and usb via grub4dos. what is the involved method that you spoke of?
Re: deleted /tmp the other day
/tmp holds temporary files, that are deleted at next boot. So you just need to create the folder again with the right permissions.
Well, perhaps it is not that hard. Boot from the DVD. Once on the desktop, open a terminal. Usually the root partition of your installation would be on /dev/sda1, but if you aren't sure you can check with:
Once you know which partition has the root filesystem of your installation, mount it to /mnt as so:
Then create the folder as follows:
Then unmount it (no typo):
That should do it.
Well, perhaps it is not that hard. Boot from the DVD. Once on the desktop, open a terminal. Usually the root partition of your installation would be on /dev/sda1, but if you aren't sure you can check with:
Code: Select all
sudo fdisk -l
Code: Select all
sudo mount /dev/sda1 /mnt
Code: Select all
sudo mkdir /mnt/tmp
sudo chmod 1777 /mnt/tmp
Code: Select all
sudo umount /mnt
Re: deleted /tmp the other day
oh great. I thought I had to replace the contents of /tmp hence the image restoration. Thanks for the info. Hope I don't ever have to go through this again.
Any ideas about clonezilla or should I make that a different topic?
Any ideas about clonezilla or should I make that a different topic?
Re: deleted /tmp the other day
Yes, please make a different topic for that. And I'm no clonezilla expert
Re: deleted /tmp the other day
Shouldn't /tmp magically reappear when a program needs to use it? I've read other directories in root work this way.
Re: deleted /tmp the other day
Possibly, but I'm not going to try it heremint123 wrote:Shouldn't /tmp magically reappear when a program needs to use it? I've read other directories in root work this way.
Re: deleted /tmp the other day
I guess if /tmp is mounted as tmpfs it will since it doesn't exist on disk (well there must be a mount point I think but you can't delete that without unmounting /tmp first). Maybe also if it's a separate partition, but if it's just a normal directory under / then I doubt it will magically appear. Programs that use /tmp will not be prepared for /tmp not existing....