Thanks guys.
I am getting grub error 17 and I now think that my menu.lst is as you suggest:
Code:
## ## End Default Options ##
title Debian GNU/Linux, kernel 2.6.26-2-686
root (hd0,1)
kernel /vmlinuz-2.6.26-2-686 root=/dev/sda5 ro
initrd /initrd.img-2.6.26-2-686
title Debian GNU/Linux, kernel 2.6.26-2-686 (single-user mode)
root (hd0,1)
kernel /vmlinuz-2.6.26-2-686 root=/dev/sda5 ro single
initrd /initrd.img-2.6.26-2-686
title Debian GNU/Linux, kernel 2.6.26-1-686
root (hd0,1)
kernel /vmlinuz-2.6.26-1-686 root=/dev/sda5 ro
initrd /initrd.img-2.6.26-1-686
title Debian GNU/Linux, kernel 2.6.26-1-686 (single-user mode)
root (hd0,1)
kernel /vmlinuz-2.6.26-1-686 root=/dev/sda5 ro single
initrd /initrd.img-2.6.26-1-686
### END DEBIAN AUTOMAGIC KERNELS LIST
# This is a divider, added to separate the menu items below from the Debian
# ones.
title Other operating systems:
root
# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title Windows XP Home Edition
root (hd0,0)
savedefault
chainloader +1
# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda2
title ThinkVantage Rescue and Recovery 3
root (hd0,3)
savedefault
chainloader +1
Between when everything worked and now, here's how it went:
1) Before using gparted, I ran out of space on the / partition. So I wanted to use GParted in order to grow that partition. In order to do so, I needed to shrink /home, and then move /swap, /usr/local and /opt all to the right. This worked until getting to /opt, at which point it wasn't able to finish and instead reported an error.
2) I tried to run gparted again, but then it told me that there were no partitions on the drive.
3) I was able to boot into linux using the CTRL-D option at bootup, but for example I couldn't find list the contents of the directory ~ (I'm just going by memory). So even though gparted saw no partitions, I was able to boot into Linux, albeit a poorly working version of linux.
4) I booted into Knoppix and am now trying to use testdisk to restore the partition table. After doing this, gparted sees the partitions that I've listed as output of fdisk -l in my first post.
When I use testdisk, I don't use a very advanced method, and as I say I'm kind of poking around in the dark. I just do the following.
i) Call testdisk from command prompt.
ii) Choose to create a new log file.
iii) Select /dev/sda as the disk to look at.
iv) Select partition type "Intel/PC partition"
v) Then to decide what to do with the disk, select "[ Analyse ] Analyse current partition structure and search for lost partitions"
vi) Then select "Quick Search: try to locate partition"
vii) After doing so, it looks like this:
Code:
TestDisk 6.10, Data Recovery Utility, July 2008
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org
Disk /dev/sda - 100 GB / 93 GiB - CHS 12162 255 63
Partition Start End Size in sectors
D HPFS - NTFS 0 1 1 2304 254 63 37029762 [IBM_PRELOAD]
D Linux 2305 0 1 2313 254 63 144585
D Linux 2314 1 1 2990 254 63 10875942
D Linux 2991 1 1 3163 254 63 2779182
D Linux Swap 3272 1 1 3648 254 63 6056442
D Linux Swap 3783 1 1 4159 254 63 6056442
D Linux 4160 1 1 10943 254 63 108984897
D Linux Swap 11101 0 1 11477 254 63 6056505
D Linux 11478 0 1 11511 254 63 546210
D FAT32 LBA 11515 75 1 12160 254 63 10373265 [IBM_SERVICE]
Structure: Ok. Use Up/Down Arrow keys to select partition.
Use Left/Right Arrow keys to CHANGE partition characteristics:
*=Primary bootable P=Primary L=Logical E=Extended D=Deleted
Keys A: add partition, L: load backup, T: change type, P: list files,
Enter: to continue
viii) The way it's set up like that, it says that all the partitions are deleted (D). So now the goal is to write a new partition table so that these partitions show up when they're supposed to.
I say the following (see the P,D,L on the left):
Code:
TestDisk 6.10, Data Recovery Utility, July 2008
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org
Disk /dev/sda - 100 GB / 93 GiB - CHS 12162 255 63
Partition Start End Size in sectors
P HPFS - NTFS 0 1 1 2304 254 63 37029762 [IBM_PRELOAD]
* Linux 2305 0 1 2313 254 63 144585
L Linux 2314 1 1 2990 254 63 10875942
L Linux 2991 1 1 3163 254 63 2779182
D Linux Swap 3272 1 1 3648 254 63 6056442
L Linux Swap 3783 1 1 4159 254 63 6056442
L Linux 4160 1 1 10943 254 63 108984897
D Linux Swap 11101 0 1 11477 254 63 6056505
D Linux 11478 0 1 11511 254 63 546210
P FAT32 LBA 11515 75 1 12160 254 63 10373265 [IBM_SERVICE]
Structure: Ok. Use Up/Down Arrow keys to select partition.
Use Left/Right Arrow keys to CHANGE partition characteristics:
*=Primary bootable P=Primary L=Logical E=Extended D=Deleted
Keys A: add partition, L: load backup, T: change type,
Enter: to continue
Swap occurs three times although there's only supposed to be one of them. There's some empty space on the drive before the IBM rescue partition (called [IBM_SERVICE]), i.e. there's supposed to be empty space between 10944 and 11514. This is where one of the extraneous Swaps occurs and also where what seems to be an extraneous portion of some ext3fs partition. There's also some empty space where /opt used to be, and this is where another instance of Swap occurs. So I'm leaving these extraneous partitions as deleted.
I click enter to proceed, then select [Write] to write the partition structure to disk.
Then I try to reboot and that's when I get grub error 17.
I have no idea why I now have a W95 Ext'd (LBA) partition.
Thanks for asking though. When running testdisk, I select the P and L in the column on the left in hope that it will set up an extended partition for me that contains logical partitions / , /usr/local , swap , /home since this is how it was set up when it was working (see how I describe the layout of my hard drive when it was working).
All of these partitions that are supposed to exist as logical partitions are formatted as ext3fs, so I don't understand what the reference to W95 is for. The IBM partition is FAT32. Does W95 mean Windows 95 or something? I'm having a bit of a hard time finding the appropriate documentation that will tell me what all of these abbreviations are or how to proceed properly in testdisk so that I actually know that I'm setting up the partition table properly.
I think I'm going to try to figure out how to do this from within fdisk since that might allow for a bit more control. If there are any suggestions on a different program to use, or a better way to proceed with one of the programs that I've already been using, or some good tutorials, then please let me know.
Okay thanks again.