Jump to content

linuxpartitions gone


Michel
 Share

Recommended Posts

If it is really a topic of this subject I don't know, but it is the best place I think.

 

Anyway, I think this is rather interesting (and very unpleasant for me).

 

I have a dual-boot computer: windows-linux. I have 2 harddisks:

 

1)completely windows:2 partitions: 1primary

2)shared linux-windows:windows:primary, linux:more than one partition, don't know exactley: used the automatic take a piece of windows-option.

windows=primary on 2nd because if something would happen to the first disk I would still have the data on the second one.

 

My problem:

Yesterday, i exited linux (properly) and went to windows for defragmenting windows (every few months I do that->one of the reasons I like linux). I defragmented the first disk and a piece of the second(pressed stop-button, because all of the programs are located on the first disk and ofcourse it takes a long time....). When I wanted to restart under linux I couldn't. kernel panic: error 22, mounting ext2 flags...:no init found.

Something like that.

 

I tried to mount from rescue mode the partitions seperately tried fsck, tried to install lilo again...Nothing would work, because my separate linuxpartition was now ONE big partition: no more swap, boot, home,...

 

I have not much time and because I'm not so a good rescuer(if that's possible in this case) I downloadede the latest version of mandrake...

Like I mentionned above I have 2 primary partitions. I've read that you can have 4 primary partitions. I switched to expert mode and wanted to make "/" a primary partition. It said that I have reached my maximum of primary partitions...??? Maybe because it knows about some "old" linux partitions... So how can I reinstaal linux without making a windowspartition extended(brings along a lot of register-problems because the drive-letters change again and it doesn't change automatically)?

 

I've just thought about going in rescuemode and using mkfs /dev/hdcX

Don't know if this is a good command but hope it is possible and maybe I have some primary partitions available now.

 

Some additional questions: -Which partitions should you make primary?

-what are good sizes for each partition:

 

*/

*/boot

*/var

*/var/www(don't really need it: can I do size=0?)

*/var/....(something)

*/home

*/usr

 

 

I know this is a lot and maybe weird, but is all happening to me now....

 

Thanks,

 

Michel

Link to comment
Share on other sites

For the persons who are interested:

 

I have looked at my partitions with fdisk and my seperate linux-partition was marked as a DOS-extented partition!!!!! When I removed this partition, and started the mandrake-installer this is what happened.

 

Mandrake didn't complained about a bad partition, instead it gave me the fourth option to use an existing partition... I pressed this one and suddenly it was already formatting. The special thuing about this is that it used the same old partitions and I think I changed them a litlle bit of the normal.

 

Now, anyone who would get in this situation, I advise. Look with fdisk to see if your linux-partition isn't made extented-dos end try to start your linuw nox(I couldn't test this, because I noticed it too late...MAYBE everything is back like it was....). Normally I can now install the new linux-distro with the hope that this won't repeat, anyway with the hope that if it happens no info is lost.

 

Michel

Link to comment
Share on other sites

There is a program called Testdisk which may help you out of of this problem. Find it here: http://www.cgsecurity.org/index.html?testdisk.html and read the documentation carefully. Your problem most likely started with aborting the defrag. What you have done to the partition table is really open to question but this won't stop Testdisk. (See below about how it should be partitioned, IMHO).

 

It is likely that the partitions are still there and only the partition table was manged which may be recoverable with Testdisk. Keep DOS fdisk away. You will need to put Testdisk on its own floppy so it can access the partitions without using them. If Testdisk doesn't deal with the problem, I know of no other reliable way of fixing this except by rebuilding the partition table by hand with a sector editor. The only thing that bothers me about this is that you are writing to the disk. I would be much happier if you didn't do any writing even to get Testdisk up and running and used another machine.

 

The most powerful recovery utility I support is Linux Parted. If you could get parted on a Linux boot disk with a complete OS like Tom's Rboot, this is another approach you could take, using Linux to rescue Linux

and Windows. Find Tom's here: http://www.toms.net/rb and get parted here: http://ftp.sunet.se/pub/os/Linux/distribut.../Mandrake/RPMS/ or off the CD. Parted might extract with Tom's but I am not sure that there is a Mandrake packager on this disk. Another Linux user may be able to do this for you. Parted works with actual cylinder numbers and you need to carefully read the docs on the site.

 

Another suggestion I ram across while searching for the links would be to use your install disk in expert mode to look at the partitions and see if they are still there. This might enable their recovery with the Rescue Mode of your first install disk or the recovery of lilo. From what you have said you fiddled with the partition types which introduces another level of complication. Mandrake will live quite comfortably in an extended partition

and this can be changed with parted.

 

If these fail, there are three commercial Windows Partitioning progams that you can download with some functions crippled. They are Acronis, Paragon Disk Manager and Partition Magic. They will read what's there and you may be able to recover different things with each. If you know someone with any of these, a rescue floppy set can be created from the full versions significantly increasing the likelihood of recovering some if not all. I do not recommend you go out and by any of these in the present situation since you are very likely going to need to reinstall.

 

All of these possibilities will require a great deal of time and patience and every move must be carefully thought out. It may be that you may just decide to bite the bullet and reinstall. It depends on the data that will be lost. If this is what you decide to do, get things back to normal Windows with fdisk/mbr in Dos mode and then run fdisk and create an extended partition for Mandrake. The Mandrake expert install will allow you to create the partitions you want. After you are up and running, get Parted and Tom's for future disasters.

 

In the future, you should never stop disk programs that are moving data around. Normally, a Windows utility does not recognize other partitions at all and would not touch them. If you can afford it get the full Norton Systemworks and if you can't get Norton Untilities. Use Disk Doctor and Speeddisk in the future. Windows defrag does not move its own system files marking them in the map as unmoveable. Norton Speeddisk moves all programs regardless. You can also manipulate the swap file to the front of the disk for faster access but that is a discussion for another day.

 

Counterspy

Link to comment
Share on other sites

defrag with norton? http://www.mandrakeusers.org/viewtopic.php?t=1955It's a fairly common prob/possibility which is one reason why it's recommended to keep linux and win away from each other. If I remember correctly the result is overlapping partitions. Which leads me to the next post from me.

http://www.mandrakeusers.org/viewtopic.php?t=3133

Go to the link that Counterspy posted and read the docs. It's much more complete and very informative...the man parted is very basic. Go to my fourth post to see parted fix the overlapping partitions. Make the bootdisk for the future (or now) but you can run it from linux. It's on the cd's. To install;

urpmi parted libparted

I did it from linux but I thought it was an unmounted partition. I should have double checked, but.... The best thing would be to print out the docs and man and use the floppy.

 

I believe most make / primary and the rest extended

 

Hehehe...Counterspy beat me to it....well that's 2 votes for parted :wink:

Link to comment
Share on other sites

What program are you using so we are all on the same page? In principal Parted, Linux fdisk, Cfdisk and Sfdisk are the same:

These numbers are imaginary and from memory with much information missing but illustrate what one should see:

 

Starting Sector Ending Sector Partition Type

1 1000 Primary Dos

1000 1000000 Primary Extended

1000 3000 ext2

3001 5000 ext2

5001 70000 ext2

70001 500000 ext2

500001 955000 ext2

955001 1000000 swap

 

This is an amalgam of the output of different programs. I have put the partition types in labels, but ususally they will be hex numbers but those are not ingrained in memory either. They should be in the docs of each program. You can see from this how an extended partition works. Each partition within it becomes a logical partition.

 

I will run parted from running Linux later also. Three more programs have been introduced to the mix already discussed, Linux fdisk, cfdisk and sfdisk. A normal linux installation has the first and at least one of the second. You cannot just stick any numbers in any of these; they must be on cylinder boundaries. Windows and Linux calculate partitions slightly differently with Windows being cylinders, heads and sectors and Linux being start and length fields. It might be wise for you to read the Large Disk How-To before you do anything to see the underlying principles. The Linux Partitoning mini How-Two shows is a walkthrough of partitioning with Fdisk. I forgot about the Partition-Rescue mini How-To which gives a detailed walkthrough of the total process of recovery from a non-working Linux, but does deal with the dual boot case. They also discuss another utility I have not used called Gpart. If you got Tom's Rboot iether Parted or Gpart might help. These are available at http://www.tldp.org . This site should be in your bookmarks for future reference. READ THESE BEFORE DOING ANYTHING even though they do not apply to tour situation.

 

I will post the output of Testdisk later if you have not replied that you are not using it by the time I'm back in a couple of hours. I need ot reboot the computer into dos mode or use a boot disk in Windows to use it.

 

Counterspy

Link to comment
Share on other sites

You are talking about Diskdrake I think. If you could see the partitions with Diskdrake, then they are still there. You still need to recover from the change you made making that primary partition and restore your boot loader with the rescue disk. Do a search of the messages here and the old docs under troubleshooting for how to do that.

 

There have bee substantial changes in Testdisk since I first downloaded it. It now has two additional programs in source form and another large chunk of itself which requires compiling under Linux. I do not have the time to deal with this at the moment so I would say you should go with parted. Read the docs for the program carefully and you should have no problems with it. If the partitions are still there it will see them and you should be able to figure out what to do from there. If you have any problems post again.

 

Counterspy

Link to comment
Share on other sites

I had not run into this before but I am afraid I have bad news. In the situation you are in you cannot use parted because you need to access the root partition and for this purpose you must use floppy disks, the images for which are on the parted site.

 

It looks like your only avenue is Testdisk which, although it requires some compiling still has Windows executable that you can download. I should have checked this sooner since the parted images are made in Linux. I will try Windows but to see if it works and post the results.

 

There is one more possibility that may work and that is the Ranish Partition Manager which is free and will deal with Linux Partitions. I just tried it in the DOS box in Windows, and it might work although it clearly warns of data loss using a Windows partitioner on its opening screen.

 

Counterspy

Link to comment
Share on other sites

I'll certainly are going too look up those programs, in the meanwhile I've already installed linuw Mandrake rc1. I have not the time to rescue....studies.......It's already taking almost 3days with late nights(ok, I'm a newbie at this. A prof maybe would have sold this in 15 minutes, but like everything you have to learn it first.)

 

I greately appreciate your help and am going to look up the progs during the easter holidays.

 

Thanks and I hope not to many people have to go through this. It is certainly not the baddest thing a person can happen, but also certainly not the most pleasant one....

 

Thanks again,

 

Michel.

student computerscience

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...