LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 12-24-2003, 09:18 PM   #1
mansonmuni
Newbie
 
Registered: Oct 2003
Distribution: Redhat 9
Posts: 16

Rep: Reputation: 0
Deleted XP partition - Can't boot linux


RH9 2.4.20-24.9 kernel on A7N8X athlon board with 512M ram. One 60G WD IDE and two WD 120GB SATA drives.

I think I did something stupid, but my data is still there and I'd like to mount my partitions.

I deleted an XP partition (then /dev/hda1) using diskpart. I've always read that I should use windows tools to deleted windows partitions. I lost grub in the process, however, and can't get it back. When I boot into knoppix (where I am now) or redhat's rescue mode I can mount the remaining linux partitions and they are all present and accounted for. The only thing that troubles me is that fdisk tells me that my extended partition is of type f (see below). And it turns out all of my logical linux drives exist on this partition. I wasn't aware of this when I deleted my primary windows partition. What does this mean that I have done? Can I change that to a linux partition? I don't want windows anymore. Will my linux partitions be ok where they are or should I back up everything and repartition?

As you can see I've reclaimed the space left from deleting my windows partition (was /dev/hda1) and it is now /dev/hda4. All of my previous partitions seem to have shifted down a drive , e.g. was hda2 is hda1, etc.

>fdisk /dev/hda

/dev/hda1 * 2198 2324 1020127+ 83 Linux
/dev/hda2 * 2325 2579 2048287+ 83 Linux
/dev/hda3 2580 7297 37897335 f W95 Ext'd (LBA)
/dev/hda4 1 2197 17647371 83 Linux
/dev/hda5 2580 5129 20482843+ 83 Linux
/dev/hda6 5130 6660 12297726 83 Linux
/dev/hda7 6661 7170 4096543+ 83 Linux
/dev/hda8 7171 7297 1020096 82 Linux swap

As I said grub disappeared from my MBR when I wiped out partition 1. I managed to install stage1_5 to the MBR but only get the grub prompt. I do the following:

grub> root (hd0,0) // my /boot partition.
Filesystem type is ext2fs, partition type 0x83

grub> setup (hd0)
Checking if "/boot/grub/stage1" exists... no
Checking if "/grub/stage1" exists... yes
Checking if "/grub/stage2" exists... yes
Checking if "/grub/e2fs_stage1_5" exists... yes
Running "embed /grub/e2fs_stage1_5 (hd0)"... 16 sectors are embedded.
succeeded
Running "install /grub/stage1 (hd0) (hd0)1+16 p (hd0,0)/grub/stage2 /grub/menu
.lst"... succeeded
Done.

grub> kernel (hd0,0)/vmlinuz
[Linux-bzImage, setup=0x1400, size=0x10f60e]

grub> initrd (hd0,0)/initrd
[Linux-initrd @ 0x3c6000, 0x29402 bytes]

grub>boot

My system boots until the following message:

Unable to mount root fs on 09:02 . (lspci listing below) My / partition is /dev/hda2. I do
rdev /boot/vmlinuz on my /dev/hda1 and get "Root device /dev/hda2". Should that be set to my / or my /boot directory?

I have those two SATAS set up as a logical volume of 240G I have enough room on them to cpio my main ide drive, but I can't get the logical volume recognized.

If I mount my /dev/hda2 and chroot /mnt/hda2 and do pvscan from redhat rescue It shows both physical volumes and my group name, but when I run vgscan it says something about half the extents missing and some errors. I can't reproduce it now since I don't know how to load my lvm-mod from knoppix after a chroot. Anyway, if anyone has any ideas, I would really appreciate a little help here. I'm kind of spinning my wheels at this point.

TIA

>lspci00:00.1 RAM memory: nVidia Corporation nForce2 Memory Controller 1 (rev a2)
00:00.2 RAM memory: nVidia Corporation nForce2 Memory Controller 4 (rev a2)
00:00.3 RAM memory: nVidia Corporation nForce2 Memory Controller 3 (rev a2)
00:00.4 RAM memory: nVidia Corporation nForce2 Memory Controller 2 (rev a2)
00:00.5 RAM memory: nVidia Corporation nForce2 Memory Controller 5 (rev a2)
00:01.0 ISA bridge: nVidia Corporation nForce2 ISA Bridge (rev a3)
00:01.1 SMBus: nVidia Corporation nForce2 SMBus (MCP) (rev a2)
00:02.0 USB Controller: nVidia Corporation nForce2 USB Controller (rev a3)
00:02.1 USB Controller: nVidia Corporation nForce2 USB Controller (rev a3)
00:02.2 USB Controller: nVidia Corporation nForce2 USB Controller (rev a3)
00:04.0 Ethernet controller: nVidia Corporation nForce2 Ethernet Controller (rev a1)
00:05.0 Multimedia audio controller: nVidia Corporation nForce MultiMedia audio [Via VT82C686B] (rev a2)
00:06.0 Multimedia audio controller: nVidia Corporation nForce2 AC97 Audio Controler (MCP) (rev a1)
00:08.0 PCI bridge: nVidia Corporation nForce2 External PCI Bridge (rev a3)
00:09.0 IDE interface: nVidia Corporation nForce2 IDE (rev a2)
00:0c.0 PCI bridge: nVidia Corporation nForce2 PCI Bridge (rev a3)
00:0d.0 FireWire (IEEE 1394): nVidia Corporation nForce2 FireWire (IEEE 1394) Controller (rev a3)
00:1e.0 PCI bridge: nVidia Corporation nForce2 AGP (rev a2)
01:0b.0 RAID bus controller: CMD Technology Inc Silicon Image SiI 3112 SATARaid Controller (rev 02)
02:01.0 Ethernet controller: 3Com Corporation 3C920B-EMB Integrated Fast Ethernet Controller (rev 40)
03:00.0 VGA compatible controller: nVidia Corporation NV28 [GeForce4 Ti 4200 AGP 8x] (rev a1)
 
Old 12-25-2003, 02:29 AM   #2
DavidPhillips
Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,154

Rep: Reputation: 56
You have deleted your /boot partition.



you could make a boot floppy with a kernel setup to use the filesystem on the system.

Then you could put that kernel in /boot, make a lilo.conf file in /etc and install lilo.

Once it boots you can rebuild the default kernel and install it again from the source.


 
Old 12-25-2003, 04:23 AM   #3
mansonmuni
Newbie
 
Registered: Oct 2003
Distribution: Redhat 9
Posts: 16

Original Poster
Rep: Reputation: 0
What about the win95 extended partition

Thank you very much for your reply. And on Christmas eve yet.

Actually, though, my /boot partition is the one corresponding to /dev/hda1 or (hd0,0) if you're grub. I know cuz I can mount it booting from another installation (rescue/knoppix) and see my kernel and grub directory there. Also, you'll notice that my setup (hd0) command correctly id's my boot and grub locations.

I'm an impatient man when my box is ailing, so I took a circuitous route to a remedy, since I didn't have the skills to go straight to the solution. I figured I'd use redhat's knowhow, so I used my install disk to do an absolute minimal install with all of my partitions locked against changes. It wasn't the most elegant solution, but it got me up and running again. I got my lv's back. I had to use rescue to do an rpm re-install of my glib packages to the latest versions. Rpm and a bunch of other things were failing on /lib/tls/libpthread.so. There was some linking problem that ld couldn't get to.

My only remaining concern is about the win95 extended partition. Is there some relationship between a primary partition and an extended one in XP, cause I wiped out the windows primary partition? Also, is there any way to safely change that partition id from f to 85? I don't have any windows installations and don't plan on acquiring any, except perhaps with vmware. Is it ok the way it is or should I do something about it?

Thanks again for your assistance. Have a great day off tomorrow

peace
 
Old 12-25-2003, 12:23 PM   #4
DavidPhillips
Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,154

Rep: Reputation: 56
I thought you said you deleted /dev/hda1

If it's all still there you should be able to boot into a root / boot floppy or live cd and chroot into it.

Then you can download if needed and install lilo or install grub again
 
Old 12-25-2003, 12:26 PM   #5
DavidPhillips
Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,154

Rep: Reputation: 56
If you use a boot floppy you should be able to start it like this


linux root=/dev/hda?


use the name of the image instead of linux if you have it named something else. use the / device instead of /dev/hda?
 
Old 12-25-2003, 10:46 PM   #6
mansonmuni
Newbie
 
Registered: Oct 2003
Distribution: Redhat 9
Posts: 16

Original Poster
Rep: Reputation: 0
Ok. I guess I'm not entirely with it. I'm recalling that my XP ntfs filesystem was on /dev/hda1. When I deleted that partition using XP's diskpart, I'm thinking that the order of the drive numbers shifted, just like c, d, e, etc. would do on a windows box if one of the partitions were deleted. Is that not the case? So that what was hda2 became hda1, hda3 became hda2, etc. Then even though I deleted /dev/hda1, it would still be there. Isn't that true? Nevertheless, that is not what concerns me. I'm just trying to clarify.

Looking at the output of my fdisk listing, however, it looks like I created my linux logical drives on a windows extended partition. Would you agree? My question is, is it ok to leave it that way? Can I change the partition type without repartitioning, should I change it, or should I just leave it the way it is?

hde and hdg are physical volumes in a logical volume group, by the way.

[root@localhost mooreg0]# /sbin/fdisk -l

Disk /dev/hdg: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/hdg doesn't contain a valid partition table

Disk /dev/hde: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/hde doesn't contain a valid partition table

Disk /dev/hda: 60.0 GB, 60022480896 bytes
255 heads, 63 sectors/track, 7297 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 2198 2324 1020127+ 83 Linux
/dev/hda2 2325 2579 2048287+ 83 Linux
/dev/hda3 2580 7297 37897335 f Win95 Ext'd (LBA)
/dev/hda4 1 2197 17647371 83 Linux
/dev/hda5 2580 5129 20482843+ 83 Linux
/dev/hda6 5130 6660 12297726 83 Linux
/dev/hda7 6661 7170 4096543+ 83 Linux
/dev/hda8 7171 7297 1020096 82 Linux swap

Partition table entries are not in disk order

Now that I have my system back up again -- and yes a grub re-install was probably all I needed -- the
 
Old 12-25-2003, 11:18 PM   #7
DavidPhillips
Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,154

Rep: Reputation: 56
If you deleted the partition then that will change the order of the partitions.

you could have just recreated a partition on the same empty space to fix it.

Last edited by DavidPhillips; 12-25-2003 at 11:19 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleted ntfs partition - added linux partition in its place - corrupt! eklhad Linux From Scratch 2 06-28-2005 01:31 AM
deleted linux partition adn the boot loader was deleted also,now i have only gnu grub boris199 Linux - Laptop and Netbook 2 01-29-2005 04:53 PM
accidently deleted /boot partition :( aditya_ic Linux - General 7 07-29-2004 02:37 AM
accidentally deleted /boot partition, yet it boots timsch75 Linux - General 6 04-08-2004 02:51 PM
Linux Partition deleted -- how to boot now?? tacSHooter Linux - Newbie 2 12-26-2002 01:10 PM


All times are GMT -5. The time now is 04:25 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration