LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   I fail to run the "fdisk -l" command (https://www.linuxquestions.org/questions/linux-software-2/i-fail-to-run-the-fdisk-l-command-95139/)

soulfly 09-21-2003 09:43 AM

RH8/XP dual boot problem ('I fail to run the "fdisk -l" command' earlier)
 
I log in as root, go to /sbin... when type "man fdisk" it prints out the info, but typing "fdisk" or "fdisk -l" just produces an error message - command not found. What should I do?

trickykid 09-21-2003 10:15 AM

That indicates that /sbin isn't in your default path. Add it to your path and all will be good...

If you run /sbin/fdisk -l does it work?

soulfly 09-21-2003 10:33 AM

Oh yeah :) it does.
Does this apply to running any program from root?
Also, could you tell me this as well. It prints out this:
************
Disk /dev/hdd: 255 heads, 63 sectors, 1247 cylinders
Units = cylinders of 16065 * 512 bytes

Device Boot Start End Blocks Id System
/dev/hdd1 1 1247 10016496 c Win95 FAT32 (LBA)
/dev/hdd2 * 1 1 0 0 Empty
Partition 2 does not end on cylinder boundary:
phys=(0, 0, 0) should be (0, 254, 63)

Disk /dev/hda: 255 heads, 63 sectors, 4982 cylinders
Units = cylinders of 16065 * 512 bytes

Device Boot Start End Blocks Id System
/dev/hda1 1 1020 8193118+ 83 Linux
/dev/hda2 1021 4982 31824765 f Win95 Ext'd (LBA)
/dev/hda4 * 1 1 0 0 Empty
Partition 4 does not end on cylinder boundary:
phys=(0, 0, 0) should be (0, 254, 63)
/dev/hda5 1021 4982 31824733+ b Win95 FAT32
*********
My grub.conf file:

# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /, eg.
# root (hd0,0)
# kernel /boot/vmlinuz-version ro root=/dev/hda1
# initrd /boot/initrd-version.img
#boot=/dev/hda
default=0
timeout=30
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
title Red Hat Linux (2.4.18-14)
root (hd0,0)
kernel /boot/vmlinuz-2.4.18-14 ro root=LABEL=/ hdc=ide-scsi
initrd /boot/initrd-2.4.18-14.img
title Main XP
rootnoverify (hd0,4)
chainloader +1
********
How should I edit it (grub.conf) in order to boot Windows XP successfully?

shanenin 09-21-2003 10:54 AM

I am a litlle confused with you output of fdisk -l. Do you have 2 harddrives?

soulfly 09-21-2003 11:07 AM

Linux and Windows XP are on separate partitions of the same hard disk; there is another hdd used for documents, for Win.

quatsch 09-21-2003 11:50 AM

If I'm seeing it correctly, you have windows on /dev/hda5 which is not a primary partition. AFAIK, Windows must be on a primary partition, preferrably on the first primiary partition, to be able to boot. You might have to reinstall it...

soulfly 09-22-2003 07:06 AM

You mean primary in sense like the linux partition is primary (hda1), and the WinXP is secondary (hda2 - extended to hda5) although the hard disk they're on is Primary Slave? You're saying XP should be on hda1? Isn't Linux supposed to be that? Are you sure there is absolutely no way I can work things out from this state?
On the other hand, I can't reinstall windows - I've got important stuff there. If I ran fixmbr and then formatted the partition linux is on, would XP boot anyway? Cuz there used to be Win98 on that (linux) partition, and so the pc used to be a dual boot of 98 and xp.

michaelk 09-22-2003 08:00 AM

Win98 needs to be on a primary partition but XP does not. Is 98 on hdd1?

Besides have partition problems on both disks was XP installed on hda1? So how many partitions did you have on hda1 before you installed linux?

And how did you install RH. Did you use a default auto partiton on empty space?

soulfly 09-22-2003 10:07 AM

No, 98 was where Linux is now. hdd1 (10GB) is for windows - documents etc.
hda1 (linux) and hda2 - hda5 (XP) are two partitions of another hard disk. It was so before & after installing linux. I didn't create partitions for swap and boot. I didn't use auto partition, just told it to format the partition where 98 used to be until then and install RH there.

quatsch 09-22-2003 10:20 AM

XP was always on a non-primary partition?

What actually happens when you try to boot XP? Any error messages?

One thing that bothers me about your output of fdisk is that you have /dev/hda4 which is
- marked primary and
- has no size and
- seems to overlap with /dev/hda1 (same start sector).
I don't know if this is relevant though or if this is normal for RH.

soulfly 09-23-2003 06:47 AM

Correction (sorry) - hda1-5 are on a hard disk set up as primary master. It's probably irrelevant though.
Yes, XP was on a partition marked "D:\" in windows, loading from a boot loader which was, hopefully I'm not wrong, on "C:\", where 98 was, and where linux is now. I believe that makes it a non-primary, right?
I've heard XP loader must be on a primary partition, so according to that I've kind of killed it - and, in case that is true, what are the options?
I've tried all the numbers in the rootnoverify line, and I either get the error "no such partition" or invalid device slected"...

soulfly 09-23-2003 06:50 AM

And, ah, there is no sign of that misterious hda4 in HW Browser... if it shouldn't exist (?) how can it be deleted?

I've also changed the thread title.

soulfly 09-23-2003 07:10 AM

I've just put the 'map (hd0) (hd1) / map (hd1) (hd0)' bit above the rootnoverify and rebooted. It's an error, but is says "NTLDR no found, press any key...". I know it practically means I can't boot into XP, but does it also mean I've finally pointed it to the right way?
So is formatting and reinstalling the only solution?

quatsch 09-23-2003 09:45 AM

seems like you're on the right direction. Maybe this is somewhat useful:

http://www.webopedia.com/TERM/N/NTLDR.html

soulfly 09-23-2003 01:38 PM

Do I have to format the linux partition to FAT, and then do the "sys c:" and "fixboot" thing?


All times are GMT -5. The time now is 06:40 AM.