Find the answer to your Linux question:
Page 2 of 3 FirstFirst 1 2 3 LastLast
Results 11 to 20 of 22
Originally Posted by ClarenceDold But where do you get "fdisk" that works with WinXP NTFS? download Windows 98 Bootable Floppy from www.bootdisk.com . boot up from floppy and execute Code: ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #11
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729

    Quote Originally Posted by ClarenceDold
    But where do you get "fdisk" that works with WinXP NTFS?
    download Windows 98 Bootable Floppy from www.bootdisk.com. boot up from floppy and execute
    Code:
    fdisk /mbr
    can you explain your problem a bit more? do you wanna clear MBR only or whole disk?





    casper
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  2. #12
    Just Joined!
    Join Date
    Nov 2006
    Posts
    8
    Quote Originally Posted by devils_casper
    download Windows 98 Bootable Floppy from www.bootdisk.com. boot up from floppy and execute
    Code:
    fdisk /mbr
    can you explain your problem a bit more? do you wanna clear MBR only or whole disk?
    casper
    I only wanted to put the MBR back to a Windows state and keep my original Windows XP boot disk as it was.
    I succeeded in that by using the Windows Recovery disk. I found a piece of Win98 advice that said "fdisk /mbr, several times". That must have been important in my case. It took two tries of WinXP Recovery console fixmbr fixboot.

    I put Grub on the MBR of my USB external disk.
    Now I can boot from my external disk by selecting it to boot first in my BIOS.
    If I put GRUB on the internal disk, I get a fatal error if the external Linux USB drive isn't there, and then I can't boot Windows.

    Maybe I should set if to first boot from USB, and let Grub select a boot of Linux or windows, with Windows being on my untouched (restored) original internal drive.

    If the external drive is not there, then the internal drive would have the original Windows-only MBR, and it would boot.



    What I really want to do:


    I want the multi-boot in my C:\boot.ini, using Windows MBR on the internal drive.

    This system is not where I want Linux. I want the external drive on a system that won't boot from USB. I hope that putting the boot files on c:\ will allow me to boot the other system into Linux by moving my external drive to the other system.

    file: c:\boot.ini
    [boot loader]
    timeout=3
    default=multi(0)disk(0)rdisk(0)partition(1)\WINDOW S
    [operating systems]
    multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Micro soft Windows XP Home Edition" /noexecute=optin /fastdetect
    C:\CMDCONS\BOOTSECT.DAT="Microsoft Windows Recovery Console" /cmdcons
    C:\grub.mbr="Redhat Enterprise Linux"

    Where C:\grub.mbr was pulled from my Linux disk using
    dd if=/dev/sda of=grub.mbr bs=512 count=1
    This doesn't work. It leaves me at a screen of "GRUB " repeated, filling the screen, if I select the Linux boot from the MBR list.

    Should this "grub.mbr" identical to /boot/grub/stage1?
    It's not, on my system.

    I need the drivers --preload initrd.img, and I'm not sure that I am getting that. I don't know what the "grub.mbr" contains that tells it to look on the external drive. The external drive is accessible from Windows as a raw device, so maybe grub.mbr is okay.

    Maybe grub.mbr contains pointers to hd0 that should be hd1.

  3. #13
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    Best solution for this kind of setup is BootPart.

    1. Download BootPart and unzip it in C: Drive of Windows.

    2. Go to the root of the drive C: and look for the file boot.ini, Right-click on it and change properties removing the read-only check mark. Open boot.ini in Notepad and save it as boot-safe.ini

    3. Type 'bootpart' to see a list of the partitions, as shown in the example below:

    C:\>bootpart
    Code:
    0 : C:* type=7 (HPFS/NTFS), size = 1741824 KB
    1 : D:  type=b (Win95 Fat32), size = 1407136 KB
    2 : E:* type=83 (Linux native), size = 16600 KB
    3 : E: type=5 (Extended), size = 3136392 KB
    4 : E: type=83 (Linux native), size = 3070336 KB
    in above example, I have Windows XP in partition 0 and Linux /boot in partition 2.

    4. At the C: prompt type bootpart 2 bootsect.lnx Linux to modify boot.ini and create the Linux boot record file.

    The 2 in the above bootpart command line corresponds to the partition 2, which in the example has GRUB installed. Change it accordingly to match the Linux boot partition in your case.

    5. Check the changes made to boot.ini using bootpart list, as shown in the example below:

    C:\>bootpart list
    Code:
    0 : C:\bootsect.lnx="Fedora Core 6"
    1 : multi(0)disk(0)rdisk(0)partition(2)\WINNT="Windows XP"
    By runnning "bootpart REMOVE <number>"
    where number is an entry number, you can remove the entry from C:\BOOT.INI

    When you reboot your machine, you will see an entry to boot in Linux in the XP/2000 boot dialog . When all is working, be sure to change the properties of boot.ini to read-only.
    Last edited by devils casper; 12-24-2008 at 06:03 AM.
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  4. #14
    Just Joined!
    Join Date
    Nov 2006
    Posts
    8
    Quote Originally Posted by devils_casper
    best solution for this kind of setup is
    BootPart
    casper
    Winner!

    I installed that. I wound up with a 512 byte image that I thought should be identical to the "dd" I had done before, but it isn't. It is actually some code.

    So I rebooted, and selected my new "Linux" entry. No Joy.
    Unable to mount the root partition.
    But I noticed it was trying to open a partition of "type 0x7", which was the type of my NTFS WinXP boot partition.

    I adjusted my grub.conf to

    default=0
    timeout=5
    title 0: Red Hat Enterprise Linux ES drive 0
    root (hd0,0)
    kernel /boot/vmlinuz-2.6.9-5.EL ro root=/dev/sda1 rhgb quiet
    initrd /boot/initrd.img
    title 1: Red Hat Enterprise Linux ES drive 1
    root (hd1,0)
    kernel /boot/vmlinuz-2.6.9-5.EL ro root=/dev/sda1 rhgb quiet
    initrd /boot/initrd.img
    title 2: Windows XP
    map (hd0) (hd1)
    map (hd1) (hd0)
    rootnoverify (hd1,0)
    chainloader +1

    If I boot the external drive via the BIOS menu, it is hd0. If I boot the internal disk and use the BootPart menu, it is hd1.

    Try again... select 1 ... Boot! Success!


    When I saw the "dd" method, that sounded like a winner, but not quite, apparently.
    dd Bootloader


    Thanks for the recommendation for this one. I had seen a few, but I thought the dd would work.



    Now I'll try moving the external drive, and this bootpart stuff to the system that won't boot the external drive directly.

  5. #15
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    i am glad it worked !
    bootpart also uses 'dd' command in backend but it copies data from 'first sector of partition' not from 'MBR'. you can copy image file through 'dd' command and setup boot.ini file manually. direct 'dd' to copy data from /dev/sda1 not from MBR ( /dev/sda )
    Code:
    dd if=/dev/sda1 of=grub.mbr bs=512 count=1





    casper
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  6. #16
    Just Joined!
    Join Date
    Nov 2006
    Posts
    8
    Quote Originally Posted by devils_casper
    i am glad it worked !
    bootpart also uses 'dd' command in backend but it copies data from 'first sector of partition' not from 'MBR'. you can copy image file through 'dd' command and setup boot.ini file manually. direct 'dd' to copy data from /dev/sda1 not from MBR ( /dev/sda )
    Code:
    dd if=/dev/sda1 of=grub.mbr bs=512 count=1
    casper
    I did try that.
    I used the dd against sda and sda1, and ran bootpart.
    I compared all three, and found that they were different. I examined each with strings, hd, and od, to see if they were substantially the same, with maybe just an offset change. The bootpart 512 byte file contains some strings about the author and the web site.

    Then I set up a boot.ini with
    multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Micro soft Windows XP Home Edition"
    C:\bootsect.lnx="Redhat Enterprise Linux - USB"
    c:\grub.sda="Redhat mbr"
    c:\grub.sda1="Redhat root"
    and tried each. Only the Bootpart worked, and only if I used the modified grub.conf that allowed for the change in drive letter.


    Further down on the page http://gentoo-wiki.com/HOWTO_Dual_Bo...NTLDR)_and_why
    I see that the trick might only work with LILO, or if I use Grub, because of my hd0 verses hd1 issue, I might need to make a one byte change in the dd-derived grub.mbr. It says I could use mbr with a "d" option, but that would require booting with Linux on hd1, which I can only do if I use the bootpart partition to get there.

    The end of this seems to be that I might be able to craft what I need with dd LILO, or Grub and a hex editor, or I could just send a postcard to Gilles Vollant thanking him for his bootpart program

  7. #17
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    Quote Originally Posted by ClarenceDold
    I see that the trick might only work with LILO, or if I use Grub, because of my hd0 verses hd1 issue, I might need to make a one byte change in the dd-derived grub.mbr. It says I could use mbr with a "d" option, but that would require booting with Linux on hd1, which I can only do if I use the bootpart partition to get there.
    did you try mapping the disks? its usually used for hacking windows boot loader and i didn't try it for Linux yet. may be it works for Linux too.

    Quote Originally Posted by ClarenceDold
    I could just send a postcard to Gilles Vollant thanking him for his bootpart program
    haha ! indeed bootpart is a very good utility. it saved a lot of my time and hairs...





    casper
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  8. #18
    Just Joined!
    Join Date
    Nov 2006
    Posts
    8
    Quote Originally Posted by devils_casper
    did you try mapping the disks? its usually used for hacking windows boot loader and i didn't try it for Linux yet. may be it works for Linux too.
    casper
    I don't think that mapping would work, because I don't think the stage1 loader is looking on the right disk, so it would never find the grub.conf.

    I did try to make the one byte change to the dd version, using the binary editor bvi. That still gave the same problem, displayed a single GRUB and lockup.



    I also tried moving the external USB to my laptop that won't boot from USB, along with the bootsect.lnx to the c:\ drive. That doesn't boot. I get a message from BootPart "Cannot load from harddisk". At that point, using just BIOS, maybe the external volume isn't there at all.

    Once I boot into Windows, I can see it. I have a vfat partition that I am using to hold the files that I download and modify, and I can see them from Linux or Windows, so I know the drive is reachable.


    I'm going to try "Making a GRUB bootable CD-ROM" next, for the laptop.

    It would appear that if I put stage2 on my hard drive, and know the offset to the file, I could build the bootpart file with the offset embedded in it.

    That is really my goal, to somehow get my laptop, with C: occupying all of my internal disk, and no USB boot in the BIOs, to allow a dual-boot to Linux on an external drive.

    At this point, it may have been easier to repartition the drive and put /boot on the internal disk.

  9. #19
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    did you try Smart Boot Manager?








    casper
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  10. #20
    Just Joined!
    Join Date
    Oct 2006
    Location
    FL
    Posts
    4
    Quote Originally Posted by ClarenceDold
    It would be _very_ handy if GRUB would make a copy of the MBR that you could put back if you wanted to. I don't know if that would be as simple as a dd of the first 512 bytes or not.
    For the GRUB, couldn't you edit the source code and just submit the new version to redhat?

Page 2 of 3 FirstFirst 1 2 3 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •