Lost partition on ubuntu and vista dual boot on vista reinstall, Testdisk no succes
Linux - Laptop and NetbookHaving a problem installing or configuring Linux on your laptop? Need help running Linux on your netbook? This forum is for you. This forum is for any topics relating to Linux and either traditional laptops or netbooks (such as the Asus EEE PC, Everex CloudBook or MSI Wind).
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.
Lost partition on ubuntu and vista dual boot on vista reinstall, Testdisk no succes
Hi,
I have a Dell laptop with Ubuntu and Vista on it. Recently, I reinstalled Vista and lost a partition. I tried using Testdisk and GPart but no success.
After using Testdisk I have two problems: 1: two unwelcomed partitions D: and E: show in Windows,
2: Still the sda4 ntfs partition(the one lost) shows as unformatted space on Ubuntu and vista
I have 5 partitions
sda1: Dell utitility
sda2: WindowsVista(boot)
sda4: Another ntfs windows partition [Data]/** mounted on Ubuntu used as file storage*/
sda3: Linux partition -
sda5: Linux swap - Extended
Recently I reinstalled Vista and as a result my sda4 partition showed as unformatted partition/ntfs error in both windows vista and ubuntu
In Testdisk, on running deeper search, Testdisk wouldn't allow me to flag the swap partition as extended. As such my first try:-
/** Erroneous Partition map*/
Flags Partition
P sda1
* sda2
P sda3
L sda4
L sda5
resulted in partitions sda4+sda5 showing as extended with all the names garbled, as in sda4 became sda6 and so on. I could boot ubuntu after reinstalling grub2 but Vista would boot.
I tried testdisk again with following flags
Flags Partition
P sda1
* sda2
L sda3
P sda4
L sda5
I installed grub2 again and now I can boot into both windows and Ubuntu. Also, my partitions in Disk utility looks nearly the same with linux and swap being extended/Logical.
However, now my vista is showing me two new drives in My Computer
D:\ \** O bytes drive, on clicking I am prompted to format it*\
E:\ \** 80 MB drive with some files. Most probably Dell utility Files. This shouldn't have happened since I remember changing the type for Dell Utility partition to "de" (Fat16 or so) in Test disk*\
And sda4 still shows as unformatted space.
I would really appreciate any advice on this issue. Thanks!
Last edited by pulkittomar; 11-21-2010 at 09:37 PM.
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629
Rep:
You can have 4 primary partitions. One (and only one) of them can be an extended partition. You must have an extended partition if you want to have more than 4 partitions, which are called logical partitions. If you have a partition number equal or greater than 5, it is a logical partition. You have /devsda5 but no extended partition (from what you write). Please post the output of
I would recommend that you use Clonezilla or the command "dd" to clone the HDD to another medium before you try anything else. You can then try several variants of possible partition tables without changing and loosing your existing, starting information.
What did you get for results from the initial quick search TestDisk scan, before you did a deep scan?
Posting the results of "fdisk -l", as requested, would help.
@JZL240I-U and @thorkelljarl Thank you for the reply!
@JZL240I-U: The partitions I gave is what I selected in Testdisk. Testdisk doesn't allow a partition to be flagged as Extended by the user. Instead it automatically assigns all the partitions flagged "Logical" as Extended drives, as per my experience. Thanks for noticing.This what fdisk -l current gives
Device Boot Start End Blocks Id System
/dev/sda1 1 9 72261 6 FAT16
/dev/sda2 * 10 6384 51206776 7 HPFS/NTFS
/dev/sda3 6385 17082 85931685 f W95 Ext'd (LBA)
/dev/sda4 17083 38914 175357952 7 HPFS/NTFS
/dev/sda5 6385 16109 78116028 83 Linux
/dev/sda6 16110 17082 7815580 82 Linux swap / Solaris
@thorkelljarl: I will use clonezilla/dd from now on. I had to run Testdisk a number of times. I don't remember what Testdisk gave the first time I ran it, but I think most probably one of the partitions which was lost, was not listed.
All the runs except the first gave three partitions
1: Dell Utility Partition
2: A Fat32 Partition whose files could not be listed. Size around 32GB
3: An NTFS Partition.
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629
Rep:
Well, the output of "fdisk" is what you truly have at the moment on your hard disk. Please note that this is not what you posted in the OP. Which means that you can access it this way from the linux side, if necessary by mounting by hand (as opposed to from /etc/fstab in case this, or rather the file system got corrupted). I'd thus strongly suggest that you save your data.
If the layout as given by fdisk is not what you originally had, here are some tools:
JZL240I-U asks the right question, what do you want to do? Your partition table shows all the signs of having been patched together. Your first post says that you lost a partition, but what did you loose that you need, did you loose important files that haven't been recovered ?
If you haven't lost the most important, but can read your data files, it might be easier to copy them to an external HDD either with Windows or with a linux live-cd, and re-install Windows. Depending on what you have to install from, you might be able to partition Windows from the beginning for installation on one partition, leaving unallocated space for linux. You now have two Windows partitions, however you arrived there. Dell may have set up Windows that way.
If you have Windows on a restoration partition, and it re-installs Windows on two partitions, you can use that, and begin again by shrinking Windows for a dual boot, first by using the Windows partitioning tool to shrink the first Windows partition, then moving the border of the second Windows partition down to fill the space. Then shrink the second partition for an extended partition for linux.
Instead, the results of "fdisk -l" seems to show that you have shrunken the Windows installation partition and created an extended partition for linux, leaving alone the other, larger Windows data partition. It might be better to have one large partition for all of Windows and more space for linux. Can you read the second Windows partition, either with Windos, linux, or a linux live-cd?
Before you start anything, find out what the files Dell has installed are for and how important they are. Restoration files are good to have, and some manufacturers have set up Windows with its own boot partition without which Windows won't boot. If you re-install, you may loose something you want, but may also rid yourself of some junk and free up a partition.
You need one out of four primary partitions for an extended partition on which you can make logical partitions for linux.
Just for clarity, can you post your results of "fdisk -l" again, marking the output, then using the "Go Advanced" posting function and pasting it as "code"(the hash icon at the top)? As an example here is one from a 4 GB USB stick.
The "*" is a boot flag, there is only one for a HDD, and yours is on the first Windows partition. It tells Windows what to boot.
Code:
Disk /dev/sdb: 4007 MB, 4007657472 bytes
124 heads, 62 sectors/track, 1018 cylinders
Units = cylinders of 7688 * 512 = 3936256 bytes
Disk identifier: 0x00056de1
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 1018 3913161 c W95 FAT32 (LBA)
I could be hectoringly didactic and ask where are those back-up files that you are supposed to have always at hand and up-dated, especially when you are venturing a task with such dire an outcome as a botched partitioning.
Last edited by thorkelljarl; 11-23-2010 at 01:34 PM.
@JZL240I-U, @thorkelljarl Thanks for such an elaborate reply. I really appreciate it.
Question: What I the current status of my laptop?
Answer: I am able to boot from both Windows and Ubuntu. But, the Data partition still shows as unformatted space in both Ubuntu and Windows. I cannot access the files.
Question: What do I want?
Answer: I want the data from Data partition. The partition has files(academic work) I gathered over an year or so. Resources on a lot of courses, mainly lecture videos, slides and anything related to the subject on the internet that interested me. The data is not critically important, but it would be a waste of effort if I lose it. I do have a backup which I took about 4-5 months ago. Most of the critical data I have, I keep it on Dropbox which saves it on internet.
Question: What I don't want?
Answer: To reinstall Windows or Linux. The problem occurred when I reinstalled Windows which, as expected, after 1 year of careless use had become suicidal(hanged every now and then). I use the Data partition as a second windows partition so that reinstall doesn't affect Data partition. I also mount that partition on Ubuntu to use it the same way. Thus, isolating Data partition from installs/re-installs of operating system. So my laptop is working just fine, except I do not have access to the Data partition. Also there are two unwanted partitions showing up which I can ignore for a while.
Use windows based or other recovery software: The issues with recovery software is that you never know if they recovered the whole file correctly. Most times the video files won't run at all. This may not be the case since nothing else has been written on the partition and the data may be perfectly recoverable. But a better solution I think would be to get the partition back. Guys I really appreciate all the help so far.
Last edited by pulkittomar; 11-23-2010 at 03:24 PM.
Did You clone the HDD? After you have a copy of the what you are to work on, you can try TestDisk again, or try PhotoRec, its companion program that is for recovering files. You did read the wiki? I can't give you detailed information; you know best what you've already done, what the HDD was before you started.
Additionally, the fact is that I have opened both programs to take a look, but not had to use either one myself, I just know they can work. Skill, or practice, or luck has saved me from the need. I learned to avoid some mistakes by practice partitioning an old HDD until I understood what I was doing and what was about to happen.
As long as you can restore the HDD to its previous state with the cloned copy, you can experiment a little more radically.
A version of the second NTFS partition, the one with the data, shows up on "fdisk-l", but its listing on the partition table may be wrong. Are you sure no linux live-cd will see that partition? Do you remember what, if anything, you shuffled around prior to what you now have listed in "fdisk -l" ? Using what you remember, try any variants that TestDisk throws up, then restore the HDD from the clone and try again. Then try PhotoRec, then some of the other recovery programs suggested.
You have a chance, but I don't know how good a one. It depends on how many different possible versions of the partitions there are to try, that is if TestDisk reaches back far enough to catch the right partition table.
You can thank me for the help, but it is for the effort. Whether it is help or not depends on something coming out of the effort.
Patience and Good Luck.
Last edited by thorkelljarl; 11-23-2010 at 03:23 PM.
I will do as suggested by you and @JZL240I-U. I have done recovery a number of times both on windows and linux. However, I will first give a try to get the whole partition back, and later if nothing works I will do the recovery. I will be using Clonezilla from now on, as Laziness is the root cause of all harddisk troubles.
Quote:
Originally Posted by thorkelljarl
Want that data...
Did You clone the HDD? After you have a copy of the what you are to work on, you can try TestDisk again, or try PhotoRec, its companion program that is for recovering files. I can't give you detailed information since you know best what you have already done, what the HDD was like before you started, and the fact is that I have opened the programs to look, but not had to use either one myself, I just know they can work. Skill, or practice, or luck has saved me from the need. I learned to avoid some mistakes by practice partitioning an old HDD until I understood what I was doing and what was about to happen.
As long as you can restore the HDD to its previous state with the cloned copy, you can experiment a little more radically.
A version of the second NTFS partition, the one with the data, shows up on "fdisk-l", but its listing on the partition table may be wrong. Are you sure no linux live-cd will see that partition? Do you remember what, if anything, you shuffled around prior to what you now have listed in "fdisk -l" ? Using what you remember, try any variants that TestDisk throws up, then restore the HDD from the clone and try again. Then try PhotoRec, then some of the other recovery programs suggested.
You have a chance, but I don't know how good a one. It depends on how many different possible versions of the partitions there are to try, that is if TestDisk reaches back far enough to catch the right one.
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629
Rep:
I haven't had the need to use PhotoRec either, but I read lots of praise for its capabilities. Some of the links I posted earlier are clearly not what you need but thorkelljarl's suggestion to work on a clone is sound. Try those programs sequentially and lets hope one will succeed.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.