Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Location: United States of America and damn proud of it!
Distribution: Windows 10 prior Red Hat User
Posts: 473
Rep:
Flushing the swap file at shutdown
Hello,
I've got an interesting question. In the MS world, there is a setting to enable a user to clear the swap file at shutdown. Does anyone know how and if the swap file is cleared at shutdown and if not, how would one do that? Thanks.
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233
Rep:
well, first of all ther isn't a swap 'file' in linux it's another partition alltogeather so weather or not it gets cleared at shutdown or not is irrelivant because that space is never available to you in the first place
Location: United States of America and damn proud of it!
Distribution: Windows 10 prior Red Hat User
Posts: 473
Original Poster
Rep:
Well, yes, you are correct about what you said. I apologize, I was thinking of the paging "file" in windows. But whatever my use of words was, my question still stands. If the swap partition is used to write to when you run out of physical memory, how is it ever cleared since data is being written to the partition?
Normally you can't 'read' the swap partition using conventional methods, because that space doesn't have a file system (It's just like a pile of RAM). The thing is that if someone gets his hands on your hdd, he could see some of the things stored in the swap... However, I doubt passwords are ever saved in the swap if you have plenty of RAM...
I think you might be able to read the swap as a binary file using the dd commands... I think I'll try it!
But I need some help... How do I tell dd to stop copying after the 1st MB? I was unable to convince it!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.