0

so I am using ubuntu 11.10, just changed from windows to ubuntu, and one of my file systems, I accidentally set it up as a linux swap partition and now I want to acces my files, as I did in windows, but I do not know any secure way to change that partition to a file system without formating it and loosing the data.

Because I do not want to loose the data I have there. Does deleting the partition and mounting it again solve the problem?

1
  • 1
    I'm not sure I understand your question... did you previously have it as a FAT32 or NTFS partition and format it as Linux Swap? If that's the case the data probably was erased, because Swap is kind of like the windows pagefile... it doesnt contain any data, just more like overflow for after your RAM has been used up.
    – Thomas Ward
    Nov 30, 2011 at 16:17

3 Answers 3

1

Swap in Linux is not the same as swap file in windows. In Linux swaps take over partitions, not files.

If you assign a previous existing file system as swap Linux formatted it for that purpose, your data will be lost.

If that is the case it will be really hard (if not impossible) to get it back.

2
  • 1
    You can use swap files on Linux too if you don't want to use a swap partition. This can be done using the swapon and swapoff commands.
    – Anonymous
    Nov 30, 2011 at 17:28
  • True, unfortunately that is not the default procedure for "normal" installation. Dec 3, 2011 at 8:55
0

If OS don't have sufficient RAM memory to handle programs and self, then it will use swap partition/file/space as a replacement.

www.xenotime.net/linux/doc/swap-mini-howto.txt

After swap space is allocated, it must be formatted (initialized) with swap header information. This only needs to be done one time.

So I think you won't back your data.

0

yes, yes you can..a friend and i just did it tonight after a 5 google hour search. TestDisk is the tool..download it and follow the instructions on the bottom of the following page

http://www.cgsecurity.org/wiki/Data_Recovery_Examples

we opted not to select the write option, just to be on the safe side..alternatively, we decided to copy the "lost" files to an external hard drive. hope it helps!!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .