8

I have Ubuntu 12.10 and was using guest account. I downloaded some files on desktop and shutdown my m/c after use. Now today when I logged in to guest account to copy those files but surprisingly those files were gone and desktop was clear. I guess ubuntu deletes all files from guest account on shutdown.

Can you please guide me to recover those lost files.

Thanks

Sandy
  • 185
  • 1
  • 1
  • 6
  • Yes, ubuntu deletes all files from the guest account on reboot, and i dont think that there is any easy way to recover those – Sam Dec 03 '12 at 03:27
  • This is how Ubuntu guest account works, so that one get cannot see what the other guest downloaded. if you use the guest account, copy the files you need in an USB drive before you log off. – user68186 Dec 03 '12 at 03:27
  • 1
    Actually I didn't knew about this fact. I will keep it in mind or better I will disable guest account. – Sandy Dec 03 '12 at 07:12

2 Answers2

12

Ubuntu's Guest account is a special type of account, which has its home directory set to the mount point of a tmpfs filesystem, which is used to store data which does not need to be persisted after a reboot.

The data in tmpfs is stored in RAM backed up by the swap space, so it is likely the data had never been written to disk in the first place, so there's basically nothing to recover.

More details on tmpfs.

If you're curious how guest account is set up, you can study /usr/sbin/guest-account, which is a shell script used to create/remove a guest account.

Sergey
  • 43,665
1

Try TestDisk:

sudo apt-get install testdisk

It's an all purpose filesystem recovery tool. To recover deleted files do this:

  1. Open TestDisk in terminal as root:

    sudo testdisk
    
  2. Select the HDD that contains your Ubuntu Partition

  3. Select your Partition Tabel format(Usually Intel but may be EFI on 2TB+ HDDs)

  4. Select "Analyse-->Quick Search"

  5. Once it finishes scanning select your Ubuntu Partition and then press P

  6. Browse to the Home Folder and see if you can find the deleted files and if so use c to copy them to a safe location

  7. Now press q continuously to leave TestDisk safely.

EDIT: I just retried this and it doesn't seem TestDisk can find deleted folders, I'll double check though.

japzone
  • 1,283
  • Sergey has reminded me that the Guest account is not stored on Disk so recovery by any means, even my above method, will most likely not work. Sorry. – japzone Dec 03 '12 at 04:09