Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I created a Linux LiveUSB from xubuntu. I boot into it, and understand that it’s running in RAM. My question is, let’s say I created a folder on the Xubuntu desktop (not the C: drive or an external drive), and later on I delete the folder. I am given to understand from this article, that when you delete a file from a hard drive, the pointers used to keep track of the file get removed, and the file system marks the sectors as free space. A few questions about this:

  1. Does Linux treat a deleted file the same way as Windows?
  2. Does RAM treat a deleted file/folder like a hard drive?
share|improve this question
    
"when you delete a file from a hard drive, the pointers used to keep track of the file get removed, and the operating system marks the sectors as free space" - The operating system does nothing like this, the file system does. And different file systems behave differently, some work the way you describe, some don't. There is no "right" answer to this question. –  Gerald Schneider Jan 9 at 12:13
    
The same way any storage device treats the file system handles it. If you create a folder from the Live environment, there normally isn't a permenant storage device, please clarify this fact. –  Ramhound Jan 9 at 12:38

1 Answer 1

1.) Does Linux treat a deleted file the same way as Windows?

Linux and Windows are operating systems that can use different types of file systems based on how you specify to format a specific device (HDD/CD/thumb/etc); the filesystem type you specify then determines 'how' a file is deleted. Some fully remove the actual bytes from the physical medium (0 fill the area), some simply tell the master file table (think phone book for files) that the file is not 'there' anymore and the space that it originally occupied is now 'free'. There are a lot of filesystems and each has it's own set of 'rules' and limitations as well as Linux and Windows have different support for each filesystem.

2.) Does RAM treat a deleted file/folder like a hard drive?

No. RAM and hard drives serve 2 very different functions. When you're running MS Office or Notepad, the program itself (i.e. office.exe or notepad.exe) needs an area where it can store temporary user input/data, this is the RAM. As you're typing, Office is creating a temporary buffer in RAM that it uses to display what you type (among many other things). When you click 'Save', it then takes the temporary data in RAM and commits it (saves it) to the hard drive. When data in RAM is gone, it is not recoverable and you don't 'delete' data in RAM, the RAM that is being used is 'freed' by the program/OS to allow another program to use that area of RAM for its temporary buffer.

In the case of 'Live' OSes (XBuntu in your case), what happens is the 'Live' medium you use is treated as the 'root' drive (C: drive in Windows speak). If the live medium you are using happens to be a thumb drive (or other writable medium like an external HDD), then the Live OS detects this and treats this area as your 'hard drive'. If you're running off of a CD or other non-writable medium (like SD with the lock on or if you've specifically disabled that functionality in the live kernel), then the OS will set aside a 'nominal' amount of RAM for the basic OS functionality and treat the rest of the RAM as not only RAM but a RAM disk, in which case files are never really 'saved', they are merely 'saved' to RAM until you copy that data to a 'writable' medium like a HDD or thumb drive.

I hope that can help clear up some of the confusion you have on that topic.

share|improve this answer
    
Thanks ALOT! Really helped. :D –  Charles Whitfield Jan 9 at 12:45
    
Glad I could help :) –  txtechhelp Jan 9 at 20:22

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.