You are not logged in.

#1 2016-07-25 09:39:20

jo.be
Member
From: Germany
Registered: 2014-01-29
Posts: 3

Possible data loss by creating a swap file without thinking?

Don't know if this fits here.

I (might) have done something very stupid. I wanted to compile something, but I always ran out of virtual memory. So I decided to get me some more swap, by means of creating a swap file using dd.

The problem is, I didn't check for available space, which was - unbeknown to me - less than the 8GiB I just requested from dd.

Consequently, df showed 100% disk use, and after a reboot, I deleted the swap file. Running fsck from a stick didn't amount to anything, so my question is:

(How) can I find out which files I possibly corrupted? Because there just have to be some.

Offline

#2 2016-07-25 09:49:05

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: Possible data loss by creating a swap file without thinking?

You have to be more specific, tell us how you used dd, post the full command line.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#3 2016-07-25 09:53:04

jo.be
Member
From: Germany
Registered: 2014-01-29
Posts: 3

Re: Possible data loss by creating a swap file without thinking?

Well, basically I ran something like

$ dd bs=1M if=/dev/zero of=/mnt/file.swap count=8192
$ mkswap /mnt/file.swap
$ swapon /mnt/file.swap

This should pretty much be the command, although I can't say it with certainty, as no bash history was saved (no disk space was available).

Or is dd smart enough to anticipate a luser like me? big_smile

Last edited by jo.be (2016-07-25 09:54:44)

Offline

#4 2016-07-25 13:36:33

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: Possible data loss by creating a swap file without thinking?

Everything should be ok, when the filesystem got full it stopped writing, just like it would in a normal file copy. The only catch is the files that were open and still had data waiting to be flushed might be missing that data. This includes temporary files, log files and DE session files, system files should be fine.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#5 2016-07-25 19:15:29

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Possible data loss by creating a swap file without thinking?

Not a Sysadmin issue, moving to NC...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB