help please i deleted my operation system by mistake

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
ggallin

help please i deleted my operation system by mistake

Post by ggallin »

hi i had some unallocated harddrive space on a external hdd and i went into disk management to release the unallocated space by deleting the partition but i ended up deleting the wrong partition i deleted the partition on my c drive which is running windows xp of course immediately after this happened my computer switched off and cant boot back into windows someone told me to get hold of the linux gloria 7 cd which i now have to boot back into windows,which i did successfully but i dont know what to do from here basically i want to back up the 20 odd gbs of data on the hdd before restoring the partition i deleted can someone help me please

by the way i'm linux illiterate,specific instructions needed if the solution involves the linux mint cd,cheers........
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Biker
Level 5
Level 5
Posts: 517
Joined: Sat Apr 17, 2010 1:58 am
Location: Where my hat is

Re: help please i deleted my operation system by mistake

Post by Biker »

gpart (NOT gparted) can be used to recover a deleted partition. I've never had to use it, so unsure of what the command structure would be in terminal. It appears this site has some basic instructions on how to use the application.

http://www.brzitwa.de/mb/gpart/index.html
Linux User #384279
FedoraRefugee

Re: help please i deleted my operation system by mistake

Post by FedoraRefugee »

Hello ggallin,

Some of what you are saying does not make sense to me. You say you deleted your Windows partition? Were there any other partitions on the C drive? Where, exactly, is your data? If it was in the Windows partition and you reformatted it then your data is gone!

But, what you want to do is simply boot the Mint CD. You will see a "computer" or "system" or something similar icon on the desktop. When you open that you should see your existing partitions. Just double click on any to mount them. Simply drag your files from the partition they are on to another partition or USB key or burn them to a DVD. If you need to create a backup partition you can use GParted which will be found in the system menu. I am not sure of GParted will allow you to create an NTFS partition though, so you may have to use ext3. But at least your files will be retrievable when you reinstall XP, simply use the Mint CD to drag them back to the new XP partition.

edit: I see Biker answered while I was typing. He gets the same impression from your post as I do, that you deleted your data. If so I wish you luck in getting it back. I have recovered data on a digital camera but never on a hard drive.
Biker
Level 5
Level 5
Posts: 517
Joined: Sat Apr 17, 2010 1:58 am
Location: Where my hat is

Re: help please i deleted my operation system by mistake

Post by Biker »

It's been eons since I've accidentally whacked a partition, and back then, Norton Utilities was THE tool kit to have on hand for such boo-boos.

gpart should be able to recover the partition as it doesn't rely on the primary partition table to recover the information. Hopefully, the OP hasn't written anything to the drive since he made the boo-boo. Otherwise, he may have just learned the hard way with no easy way of recovering his data from the deleted partition.
Linux User #384279
ggallin

Re: help please i deleted my operation system by mistake

Post by ggallin »

FedoraRefugee wrote:Hello ggallin,

Some of what you are saying does not make sense to me. You say you deleted your Windows partition? Were there any other partitions on the C drive? Where, exactly, is your data? If it was in the Windows partition and you reformatted it then your data is gone!

But, what you want to do is simply boot the Mint CD. You will see a "computer" or "system" or something similar icon on the desktop. When you open that you should see your existing partitions. Just double click on any to mount them. Simply drag your files from the partition they are on to another partition or USB key or burn them to a DVD. If you need to create a backup partition you can use GParted which will be found in the system menu. I am not sure of GParted will allow you to create an NTFS partition though, so you may have to use ext3. But at least your files will be retrievable when you reinstall XP, simply use the Mint CD to drag them back to the new XP partition.

edit: I see Biker answered while I was typing. He gets the same impression from your post as I do, that you deleted your data. If so I wish you luck in getting it back. I have recovered data on a digital camera but never on a hard drive.


hi there no there are no other partitions i deleted 1 partition which was my whole c drive 30 gigs my data is in various folders on the c drive but not in the default windows folders like music etc..... i havent done any formatting,i did take the hdd out and put in an external hdd on another computer when connecting through usb nothing came up in my computer but the hdd is viewable in disk management as unallocated gbs,when booting with the mint disc when i click on the hdd that i wanna recover from it says cant mount or words to that effect.will fixing the partition if it goes wrong comprimise my data ideally id like to back up any data before fixing any partitions....any more questions let me know please thank you for the replys.
Aging Technogeek

Re: help please i deleted my operation system by mistake

Post by Aging Technogeek »

If you have not overwritten the drive or reformatted, your data is still there. Deletion only removes the path the computer used to get to the data, not the data itself. If the drive has not been used since the deletion, give the software recommended by biker a try. It can find, display, and give you access to the data you need.
Biker
Level 5
Level 5
Posts: 517
Joined: Sat Apr 17, 2010 1:58 am
Location: Where my hat is

Re: help please i deleted my operation system by mistake

Post by Biker »

As long as the partition is missing, you will be unable to retrieve any data from it.

Again, gpart should be able to allow you to retrieve the lost partition tables.
Linux User #384279
Aging Technogeek

Re: help please i deleted my operation system by mistake

Post by Aging Technogeek »

As biker emphasized, gpart will attempt to restore the partition table for the drive. If it can then you will be able to retrieve your data.

Another approach is to use Testdisk. (see the sourceforge write up here )

Testdisk is available as part of Parted Magic, a utility disk that should be in every Linux user's toolbox. Just download Parted Magic, unpack the tarball, and burn the ISO to a CD. It is bootable like a Mint live CD and includes Testdisk, Gparted, and several other nice to have apps.

Testdisk can be used to attempt a direct data recovery from the drive with the deleted OS.
ggallin

Re: help please i deleted my operation system by mistake

Post by ggallin »

Aging Technogeek wrote:As biker emphasized, gpart will attempt to restore the partition table for the drive. If it can then you will be able to retrieve your data.

Another approach is to use Testdisk. (see the sourceforge write up here )

Testdisk is available as part of Parted Magic, a utility disk that should be in every Linux user's toolbox. Just download Parted Magic, unpack the tarball, and burn the ISO to a CD. It is bootable like a Mint live CD and includes Testdisk, Gparted, and several other nice to have apps.

Testdisk can be used to attempt a direct data recovery from the drive with the deleted OS.
thanx i havent done anything yet just reading all my options first,but can anyone tell me is there a risk in losing any data if i try to repair the partition before getting the datsa,do u have a download link by the way for parted magic......also should i connect the hdd in an external case i want to fix into to a good computer,before running any program,u know the hddd doesnt show up right? will parted magic find it?
ggallin

Re: help please i deleted my operation system by mistake

Post by ggallin »

these are some instructions someone else gave me to fix the partition with the gloria mint linux 7 cd,what do u think

Boot live CD

Open a terminal (in ubuntu that would be Applications > Accessories > Terminal)

Get root; type "sudo -i"

check where your drives are; "fdisk -l"

The one you probably want is /dev/sda, you should recognise it from the list above by model number, or total size, or by the size of any other partitions you didn't delete; "fdisk /dev/sda"

Add a new partition "n"
Primary "p"
pick a number (1-4) that isn't already used. If you deleted the only partition this will be "1"
Press enter twice (default numbers are the first big free space on the drive) hopefully the only unused space on the disk is the space you freed up by deleting your NTFS partition.

Now change the partition type "t"
Pick the same partition number as above if it asks (if you only have one partition it won't ask)
make it partition type 7 (HPFS/NTFS) "7"
Save the changes back to the partition table and exit "w"

Then reboot and pray!

also this is what the guy said about gparted which some here told me to use

DON'T use gparted!!! It will try to create a new filesystem after it creates the partition!!!

Use fdisk to fix up the partition table, it ONLY touches the partiton table and nothing else.

And if that fails use gpart (NOT gpartED, completely different program) which will guess the location of the partitions based on what it can see of the original filesystem. Then use fdisk again to create partitons that start and end where gpart says they should.

original thread http://www.trademe.co.nz/Community/Mess ... 267156&p=3
Aging Technogeek

Re: help please i deleted my operation system by mistake

Post by Aging Technogeek »

For the link to Parted Magic, just click on "Parted Magic" in my earlier post.

Fdisk is an option to attempt to recreate your deleted partition. I could work as well as any other suggestion given so far, but there are no guaranteed ways to recover the data on that partition. Any attempt at data recovery carries an element of risk. A slight procedural error with any recovery method could render the data irretrievable. Choose the method you are most comfortable with and do your best.
ggallin

Re: help please i deleted my operation system by mistake

Post by ggallin »

Aging Technogeek wrote:For the link to Parted Magic, just click on "Parted Magic" in my earlier post.

Fdisk is an option to attempt to recreate your deleted partition. I could work as well as any other suggestion given so far, but there are no guaranteed ways to recover the data on that partition. Any attempt at data recovery carries an element of risk. A slight procedural error with any recovery method could render the data irretrievable. Choose the method you are most comfortable with and do your best.
hi i was told there was no risk losing any data are u sure....my data is not on windows system or default folders,like my music there in folders i created like johnnys hip hop music etc....
NexusHumanis

Re: help please i deleted my operation system by mistake

Post by NexusHumanis »

ggallin wrote:
hi i was told there was no risk losing any data are u sure....my data is not on windows system or default folders,like my music there in folders i created like johnnys hip hop music etc....
>> It will not matter where your data is stored, as long as everything is on the same partition. Until the partition is restored, you will not gain access to any data on it, be it windows system data, or anything else. So as far as losing data is concerned, restoring the partition is the only way NOT to lose it. (in effect, they are lost now, until you restore)

The Gpart program mentioned is in the Mint repositories, and can be downloaded through the package manager (synaptic).
Even if you are using a live CD/USB-stick, the package can be downloaded and used. However, you need to have a live-medium with persistence if you want to keep the package installed until next time you boot the medium.

Then again, as far as I can tell, this method will not only gain you access to your data again, but also in fact restore your operating system to functionality.. (Please, someone kick me if I'm wrong)
ggallin

Re: help please i deleted my operation system by mistake

Post by ggallin »

hi i wanted to restore the data before attempting to fix the partition,is this possible?
ggallin

Re: help please i deleted my operation system by mistake

Post by ggallin »

ggallin wrote:hi i wanted to restore the data before attempting to fix the partition,is this possible?
???????
piratesmack

Re: help please i deleted my operation system by mistake

Post by piratesmack »

This should work since you've only deleted the partition, but you need to toggle the partition bootable with the 'a' command or else Windows won't boot. See my edit in bold below:
ggallin wrote:these are some instructions someone else gave me to fix the partition with the gloria mint linux 7 cd,what do u think

Boot live CD

Open a terminal (in ubuntu that would be Applications > Accessories > Terminal)

Get root; type "sudo -i"

check where your drives are; "fdisk -l"

The one you probably want is /dev/sda, you should recognise it from the list above by model number, or total size, or by the size of any other partitions you didn't delete; "fdisk /dev/sda"

Add a new partition "n"
Primary "p"
pick a number (1-4) that isn't already used. If you deleted the only partition this will be "1"
Press enter twice (default numbers are the first big free space on the drive) hopefully the only unused space on the disk is the space you freed up by deleting your NTFS partition.

Now change the partition type "t"
Pick the same partition number as above if it asks (if you only have one partition it won't ask)
make it partition type 7 (HPFS/NTFS) "7"

You need to toggle the partition bootable

Code: Select all

Command (m for help): a
Partition number (1-4): 1
Save the changes back to the partition table and exit "w"

Then reboot and pray!

also this is what the guy said about gparted which some here told me to use

DON'T use gparted!!! It will try to create a new filesystem after it creates the partition!!!

Use fdisk to fix up the partition table, it ONLY touches the partiton table and nothing else.

And if that fails use gpart (NOT gpartED, completely different program) which will guess the location of the partitions based on what it can see of the original filesystem. Then use fdisk again to create partitons that start and end where gpart says they should.

original thread http://www.trademe.co.nz/Community/Mess ... 267156&p=3
NexusHumanis

Re: help please i deleted my operation system by mistake

Post by NexusHumanis »

ggallin wrote:hi i wanted to restore the data before attempting to fix the partition,is this possible?
>>No, until the partition is fixed, the data is lost. In order to gain access to the data, you must restore the partition. The only way the data can get any more lost is by overwriting the partition.

So, you can not restore the data before attempting to fix the partition. It can only be accessed after the partition has been fixed.

Deleting a partition can be compared to nailing the door to a room shut. You cannot remove your furniture from the room before the door has been reopened.
ggallin

Re: help please i deleted my operation system by mistake

Post by ggallin »

NexusHumanis wrote:
ggallin wrote:hi i wanted to restore the data before attempting to fix the partition,is this possible?
>>No, until the partition is fixed, the data is lost. In order to gain access to the data, you must restore the partition. The only way the data can get any more lost is by overwriting the partition.

So, you can not restore the data before attempting to fix the partition. It can only be accessed after the partition has been fixed.

Deleting a partition can be compared to nailing the door to a room shut. You cannot remove your furniture from the room before the door has been reopened.
others have said i can clone the drive
Biker
Level 5
Level 5
Posts: 517
Joined: Sat Apr 17, 2010 1:58 am
Location: Where my hat is

Re: help please i deleted my operation system by mistake

Post by Biker »

Cloning the drive does not fix your issue. You still need to use a utility to repair the partition table so the partition is readable.

You have been given the necessary information to accomplish this. It's up to you to fix it.
Linux User #384279
zcat

Re: help please i deleted my operation system by mistake

Post by zcat »

Just thought you might want to know that Kurtis has started the same thread on quite a number of support forums where he's received and IGNORED a huge amount of perfectly good advice.

If all you've done is delete the main windows partition on a fairly normal single-partition install then it is stupid-easy to just put it back with fdisk from any linux live CD. (Kurtis was even given a suitable Live CD by a local LUG member). This video may help others, but apparently it's too difficult for Kurtis to follow.

http://www.youtube.com/watch?v=t971NWpprC4

After almost 1000 messages we've come to the conclusion that he's a troll. We suggest you don't waste any time on this idiot.

(Curtis did not have a Linux CD BEFORE starting the original thread, we gave him one to try and help him. He INSISTS that he deleted the partition from within Windows, which is one of the reasons we conclude that he is a troll. It's not possible to delete the boot partition from within windows, as my video shows)

Feel free to crosspost this message if you see kurtis appear on any other forums. Let's deal with REAL problems and not waste time on trolls thanks.
Locked

Return to “Beginner Questions”