Wrongly all main disk has been arranged as SWAP

Asked by Salih Niper

I installed the UBUNTU 10.04 to my drive D:
I arranged SWAP for Drive C: (However installation program didn't show how many Megabytes will be arranged for SWAP, so I thought it would use empty space but unfortunately no, it occupied all the space of C for SWAP). I was having VISTA in Drive C:
Now I can't see and open VISTA and reach to my old files.
What should I do? I want to keep VISTA as the second system and reach to the contents of C:
I want to use UBUNTU as a second OS. Is it too late or there is a solution (I hope)?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu ubiquity Edit question
Assignee:
No assignee Edit question
Solved by:
Salih Niper
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

You may have to reinstall Vista. You can then restore your data from backup and be ok. If you have a proper Windows CD rather than one of those stupid restore disks then you should partition the drive(s) so you have unpartitioned space which you can then install to, this alleviates the need to resize any partitions.

Revision history for this message
Salih Niper (sniperx31) said :
#2

I don't have any Windows CD because that is OEM VISTA installed Notebook. Unfortunately I only have a RECOVERY DVD of my notebook which was created on an empty VISTA (which was having VISTA on Drive C:)
I installed UBUNTU to D: (which was having RECOVERY of VISTA and I erased D: and installed UBUNTU).
I arranged SWAP on C: (SWAP used all the Drive C: which was having VISTA on it). However I didn't format C: while installing UBUNTU. So, I am sure that VISTA and my old files are still on C: but can NOT be seen and used.
I paid only 10 minutes to install UBUNTU and ruin everything (unfortunately). If I have a possibility to uninstall UBUNTU, get the VISTA and files back, it would be better to install UBUNTU later on. Because keeping the UBUNTU and installing VISTA would make the problem even worse. I don't have back ups for some of the files existing on Drive C:.

Revision history for this message
delance (olivier-delance) said :
#3

I'm not sure you can set first partition as swap.
Can you boot on Ubuntu CD, choose "Try but don't install", Applications->Accessories->Terminal
Type
     sudo parted -l
where "-l" is lower case "-L", and post result.

Revision history for this message
delance (olivier-delance) said :
#4

I have just read your previous message.
DON'T BOOT ON DISK.
You can boot on Ubuntu CD-ROM to use Internet and copy files to Ubuntu partition.
Each time you boot on disk, you corrupt first partition.
Your only hope to recover first partition is to go in a Windows forum, to ask Windows recovery tools.
What's your notebook model ?
If your files are important, a temporary solution is to buy an external drive, and to copy first partition on this one. So you will be able to use your computer normally, and later to try to recover data.
Tell me what you forecast to do.

Revision history for this message
Salih Niper (sniperx31) said :
#5

I can only boot on UBUNTU because VISTA is not chooseable any more. Let me make a good decision to minimize harm based on your expert experience (I only installed UBUNTU to my wife's HP NOTEBOOK yesterday afternoon which was having Bad Sector; she can now use her notebook perfectly and all files are existing. Even Disk Check can not go for read test. Even Windows can not see the hard disk and recover anything, but UBUNTU works perfectly and sees that drives all content).
I have an HP PAVILLION T7700, 2.4Ghz, 2GB, 250GB notebook. C:243GB D:7GB (this was for recovery, I installed UBUNTU here because I also have a RECOVER DVD which is the same as here). C was having 2-3GB empty space. UBUNTU didn't ask how much to arrange for SWAP. I thought it is not asking but it had to I guess (I made a mistake here by being too fast to install last night), because all 243GB was arranged for SWAP without asking anything and keeping anything! Thanks that I didn't check "format" during arranging SWAP.
If I can uninstall UBUNTU, does it leave the SWAP drive which is C: free (yes something would be corrupted but not all drive C because I didn't do much thing yesterday, just installation and upgrading on internet)?
Content of C: has to sit over there, just not visible.
I can use VISTA recover for the C: after uninstalling UBUNTU.
I can use a recover file program (any recommendations?) to recover not seen files (VISTA RECOVER was done at the date of purchase, I loaded more than 200GB of data there).
Yes, I can also try UBUNTU on DVD. No problems there. I have no urgency. I just need a proper solution with minimum HARM. Because there are some files on C: which I don't have any back up.

Revision history for this message
delance (olivier-delance) said :
#6

The issue is not uninstalling Ubuntu, it is to recover some files of first partition with Vista.
What type of files do you want to recover ? Some recovery tools try to recover full file system and other one some type of files (like *.jpg, Microsoft Office files, ...)
And as you try to recover a Windows partition, a Windows forum would be more efficient than a Linux one.
You are more explicit in last post. You are trying to recover a 243 GB partition, which is a big job.

The safer way is to copy this partition on an external hard drive, but you could have to buy this ?
Is the value of files to recover is enough to envisage such a solution ?

After we can try to declare this swap partition as a NTFS one. If you are VERY lucky, it could work.

Revision history for this message
Salih Niper (sniperx31) said :
#7

Thanks for another solution.
I have an external hard disk. But yesterday after installing UBUNTU, I couldn't see the files on C: (I mean old files). Anywhere to search for them? Any specific place or any program to let them appear again? 243GB seems to be a big gray block of SWAP.
Do you know what happens to this SWAP area if I uninstall the UBUNTU? I want to try it by the way because UBUNTU installation took 10 minutes but VISTA PC have been used for more than 2 years (mainly for archiving of photos purposes). But it also has MS Office inside (also many other big/small programs). Any way to get them back or it is too late? Any idea about RECOVER result? I am not sure if anybody still hangs in a Windows forum after seeing LINUX. No way. My notebook opens at 35 seconds while in Vista... takes many minutes and 7% of battery capacity.
I need an expert advice on UBUNTU.
How can I do an uninstallation of UBUNTU without damage? Here, I try to keep SWAP area damage at minimum (which is the whole C: drive).

Revision history for this message
Salih Niper (sniperx31) said :
#8

There has to be a safer method to get back C: and VISTA. Without any works, just after the installation (Notebook is not running), LINUX can not install a system this much. There has to be a safer way back.

Revision history for this message
Salih Niper (sniperx31) said :
#9

Vista Recovery Disc didn't install itself back. It says the content in C: is Write Protected. So, I guess the ubuntu SWAP is write protected and still not seen and reachable.
What if I uninstall Ubuntu, install it again with much less SWAP? Do I be able to see the unlocked content in Drive C:? I need to know (from an expert) what Ubuntu does to disks by arranging them as SWAP. My whole drive C: was arranged as SWAP and now I am in big trouble.

Revision history for this message
Salih Niper (sniperx31) said :
#10

ScanOS gave 0 operating system in C: fixmbr didn't work either. In fact I tried everything in Vista Recovery Disk but no success there. I need to remove the Ubuntu and try to get the old data back from the invaded SWAP (243GB of SWAP locks all the content of C: and gives no permission for any type of access). chkdsk shows very little data. It seems like all the data has been buried down to C: and needs to be revealed. Expert help is requested.

Revision history for this message
delance (olivier-delance) said :
#11

You can't uninstall an operating system (Ubuntu, Vista or anyone), you can only remove it. It means you can undo what was done during installation. If you remove Ubuntu, the first partition will stay in its current state.
To recover data, you will need specialized tools.
Your issue is to recover Windows data so you need a Windows expert, and not a Ubuntu one. We can try to use Ubuntu tools, but it will be less efficient that using tools dedicated to Windows.
And I repeat, you can't uninstall Ubuntu.
------------------
Vista Recovery Disc didn't install itself back --> You need to remove swap partition to make it free, but I don't understand. If you install again Vista, you will erase all the files you want to recover.
I repeat, you can't uninstall Ubuntu. If you install again Ubuntu, you will not be able to see content of first partition because the superblocks of this one are now corrupted.
I hope for you that Ubuntu did nothing (or a few) on SWAP partition, so you have hope to recover data. A swap partition is mainly a raw structure.
Yes, you are in very big trouble.
-------------------
The fact you can't install Vista MBR is really strange, as it need only to write on first sector. Perhaps it needs also to write in the following 32kB of disks, and there is an issue with Swap partition.
chkdsk doesn't check swap as swap is not a file system

Revision history for this message
delance (olivier-delance) said :
#12

Do you want I help you to secure your lost partition on an external disk or do you prefer to manage this issue by yourself ?

You can have a look to tools as testdisk in Ubuntu community to recover whole partition, or to tools to recover files of type such pictures and MS Office. But better tools will be found in Window's community.

Revision history for this message
Salih Niper (sniperx31) said :
#13

Thank you very much for your kind reply "delance".
I have an external hard disk. So, I can download 243GB of data to external one. But the problem is that, we can NOT see that 243GB of data anymore. UBUNTU invaded the C: as SWAP. We have to leave that disk free and reach the contents. If it is easy to do that, please kindly explain. I have no hesitation to remove Vista from the system. I don't care. I just need that extra bit of data (most of them have been backed up but not 100%).
I did something (almost everything possible) with Vista Recovery yesterday evening. Now, no operating system exists at boot. So, PC doesn't start up at all (yes, I can startup with DVD UBUNTU).
Vista doesn't see the contents of C: because UBUNTU still holds C: as SWAP (I guess). I have to set it free. But how? Any methods or documents? I guess this is a must. Because C: is trapped as Write Protected. Nothing is being done to it with Vista software.

Revision history for this message
Salih Niper (sniperx31) said :
#14

Please remember again, the UBUNTU disk check program see the C: drive as a big block of SWAP (243GB of SWAP). Nothing else there. The whole drive is SWAP. I wait for your kind help to set it free again and see the contents.

Revision history for this message
delance (olivier-delance) said :
#15

The first thing to do is to secure data with an external drive.
1) Plug external drive
2) Boot on Ubuntu CD and choose option "Try"
3) System->Administration->Gparted. At left a disk picture, there is a button to choose between sda (internal disk) and sdg (external diks)
4) Check both disks are unmounted. If not, do a right click on partition and unmount them
BE CAREFUL: since now operations are dangerous, if you have a doubt, ask me before doing anything. To run a command, you need also to click on green button (Gparted use a "arm and fire" interface).
5) Select sdg and reduce partitions to make at end a free space of 243 GB. It can take some times if FAT32 partition is fragmented.
6) Select sda and then select first partition
7) Edit->Copy
8) Select sdg
9) Edit->Paste. This should take some times to copy.
10) Check that sdg has the new right partition.
Now, if we make a big mistake, we have a backup. It is also possible to mount later this new partition of external drive in read-only mode, and work safer on it.
See you later!

Revision history for this message
Salih Niper (sniperx31) said :
#16

delance
Thanks a lot for the detailed info. After feeling helpless, such support feels like a cold breeze making me much more comfortable. I will try it this evening. So it seems we will copy C: to external drive (243GB as lump or all files will be able to be seen seperately on external hard disk?). I will report what I will have in hand yesterday.

Revision history for this message
Salih Niper (sniperx31) said :
#17

Mission accomplished!
delance; thanks for reminding me using a software called Gparted. As I used Ubuntu for a few days, I wasn't knowing that. I played with it,cheecked menus, used logic and now everything is fine as before. What I did.
-I Swapped Off SWAP region (my whole C:)
-Flag stayed as Boot (because C: is normally bootable from Windows and as I needed it to Boot)
-Changed Partition type from "Linux Swap (0x82)" to "HPFS/NTFS (0X07)" so this disc partition became recognizable to Windows operating system
-Run Windows Vista Recovery Disc (downloaded from WEB which is 120MB) and wrote with Brasero of Ubuntu
-Did below from command line:
Bootrec/Fixmbr
Bootrec/Fixboot
Now Vista runs the same as before. The whole C: is the same like I didn't do anything.
-D: is invisible (it still has Ubuntu installed there). As Windows doesn't recognize the Linux file system, it sits there safely until I fire it up again. I decided to keep it for future usage by swapping an empty place (correctly this time) when needed.
UBUNTU rocks and didn't ruin anything (Thanks). Not very easy, but very safe.
UBUNTU runs on my wife's Notebook D: drive that even Ubuntu can't check C: and perform disk test! It has bad sector (I guess the boot sector) but it sees all the files. Everything. LINUX is really strange and unbelievably powerfull!