1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: GRUB and MBR: help needed with mounting clones

Discussion in 'Linux and Unix' started by raamindasu, Apr 5, 2010.

Thread Status:
Not open for further replies.
Advertisement
  1. raamindasu

    raamindasu Thread Starter

    Joined:
    Aug 24, 2007
    Messages:
    12
    specs: i7 920 // 2x2gig DDR3 1333Tri // DX58SO mobo // Thermaltake850 psu // ATI4870 gpu // 2x1T SG, 1x320g WD hdds // 3 OS: Vista64 & KK9.10 & LL10.04b1

    first off, i am hoping to run a GRUB bootloader from MBR. Now, I have been struggling with my computer crashing randomly in bothy vista and karmic koala ubuntu (linux) for about three weeks now and only after two serious days of fighting have I been able to put together a real diagnosis and post. any help is greatly appreciated (i am posting here instead of Linux b/c i think there is a lot of Windows problems that may be causing the faults):

    My computer was screaming about problems with reallocated sector errors in ubuntu (thanks windows for not saying or doing a thing until it was waaay too late). I cloned 1 vista and 1 karmic partition off the failing hard drive to my second hard drive. (it performed a file for file clone, rather than an image). [note: for the Vista partition I had to run chkdsk /r to get it in shape for cloning and it would fail around 150k/180k indices on stage 2, but through some luck booting into vista it started a chkdsk /r off the bat and repaired it before it subsequently crashed.]

    I tried wiping and zero erasing the bad hard drive, and have followed up with RMA’ing Seagate because it appears that there is a platter going bad. Anyway, at this point I have one 1T Seagate (dead), one 1T Seagate (healthy), and 1 320gig WD (healthy but older).

    I was hoping that I could at least redo the MBR & boot record in order to get the computer to boot into GRUB and give me access to my two OS partitions. This failed. I am not sure how to manage this manually as trying to setup GRUB from a liveCD didn’t get me anywhere even after regenerating the device.map and grub.conf because I still couldn’t root any hard drives. [There was 1 267gig Vista partition, 1 88gig 9.04 Ubuntu partition, and 1 370gig media/apps partition. The files from the media/apps partition (about 80 gig) are also backed up on my second hard drive (the 320 gig WD).]

    Basically it seems the current issue is getting a boot sequence in place that mounts the OSs in my system. To try to automagickally flush my MBR and boot sector I installed the beta 1 of 10.04 Ubuntu to a partition on the 320gig WD (the second hard drive). During setup it recognized both of the other OS's and imported their settings. On finish and reboot, however, I got a non-responsive black screen without even a boot error. Then, I used the program Smart Boot Manager to find out if I could at least boot the new Ubuntu partition on its own after hiding the other two; subsequently I tried every variation on boot sequence and availability I could. All met with failed boots.
     
  2. TerryNet

    TerryNet Moderator

    Joined:
    Mar 23, 2005
    Messages:
    79,941
    First Name:
    Terry
    I am not aware that you can get a bootable operating system this way. Do you know that you can, or are you just hoping?

    There are people who know imaging or cloning and booting in general on all the OS forums, but since you are using GRUB I'll move you to Unix/Linux. You can get moved back to Vista at any time by clicking on Report and making the request (or just yell at me :) ).

    I don't understand why the new Ubuntu install will not boot. A beta isn't necessarily the best choice when you need no more problems, but it should at least boot. Can you be more specific about how it fails?
     
  3. saikee

    saikee

    Joined:
    Jun 11, 2004
    Messages:
    3,888
    If you have bad sectors in the hard disk you are far better cloning the whole drive. The bad sectors are then transferred as holes in the new drive. If the holes are in the non-system files then you still have a operable system.

    The alternative is to install a new system in the good hard disk.

    To migrate operating systems in a hard disk to another one check this out. My 1TB has 57 partitions and most of them are filled with MS systems and Linux. The method is bomb proof and watertight and will work if you can shrink the 1TB partitions small enough to the new hard disk if it is smaller.

    Your way of transferring the files is alright but since the boot sector is not part of the filing system it will not get transferred. The boot sector of every operating system can be regenerated if you the steps. This thread has most of the information you need. Basically you need a Vista or Win7 installation DVD to restore the Vista/Win7 boot loader. As for Linux any Live CD can do it but if you have used Grub2 and Ext4 filing system in your Ubuntu then you need to dig out that CD to restore Grub2. My link has the steps.
     
  4. jiml8

    jiml8 Guest

    Joined:
    Jul 2, 2005
    Messages:
    2,634
    You won't get a bootable system by copying files; you have to reinstall grub.

    From a Linux Live CD command shell enter the command "grub"

    When grub starts, enter the command "find /boot/grub/menu.lst". You may also choose to find any other file that you know will be present on your boot drive and on no other drive.

    grub will respond with something like (hd0,0) where the first entry is the hard drive number as grub knows it, and the second entry is the partition number.

    You then enter the command "setup hd0" or whatever hd it is that grub has given you for the identified boot device. This will reinstall grub properly and make that drive bootable.

    From linux, "man grub" for more information, or from within grub "help" for more information.
     
  5. jiml8

    jiml8 Guest

    Joined:
    Jul 2, 2005
    Messages:
    2,634
    Haven't seen you for awhile, saikee. How's it going?

    Of course, I haven't been around this board for a long time, but you used to hang around another board that I frequent, and you stopped coming by.
     
  6. saikee

    saikee

    Joined:
    Jun 11, 2004
    Messages:
    3,888
    jiml8,

    I do check out this forum regularly and post replies if I think I could be of assistance.

    I believe Ubuntu starting with Ver 9.04 is using Grub2 as standard and the legacy Grub booting instructions no longer work.

    I have just replaced my free Win7-64 with a paid version as the free period ran out. That installation overwrote my Grub2 in the MBR. I just managed to boot my Ubuntu 9.10 up with a Grub2 floppy using these command (my MBR was controlled by Ubuntu 9.10 in sda16 known to Grub2 as (hd0,16))
    Code:
    set root=(hd0,16)
    configfile /boot/grub/grub.cfg
    After Ubuntu 9.10 booted up I restored Grub2 in the MBR by command. You will note the Grub2 commands are slightly different to Legacy Grub (or Grub1).
    Code:
    grub-install /dev/sda
    That was about 5 minutes ago and I am using the Ubuntu to do this reply. My reply to #3 post was done with the newly installed Win7.
     
  7. raamindasu

    raamindasu Thread Starter

    Joined:
    Aug 24, 2007
    Messages:
    12
    thanks for the replies. i tried to manually regenerate the GRUB install on my MBR but when i try to use root in the GRUB sub-prompt it fails to "parse drive number" (if i recall the error correctly). using the ubuntu livecd, i tried this for about 2 hours sunday i moved on to trying out the fresh install of Lucid. as i recall when i tried to find menu.lst it couldnt be located (tried when both drives were mounted).

    after reading the saikee link/how-to i am beginning to wonder if i backed up the right way with an appropriate program. i am going to try to manually build up grub again tonight.
     
  8. saikee

    saikee

    Joined:
    Jun 11, 2004
    Messages:
    3,888
    If you have /boot/grub/grub.cfg then the Linux is using Grub2.

    This thread has a few pointers for booting Grub2 manually.
     
  9. raamindasu

    raamindasu Thread Starter

    Joined:
    Aug 24, 2007
    Messages:
    12
    tuesday night i installed a fresh WD 1T hdd (SATA). upon installing this guy my 320 no longer shows up and the partition information on the 'healthy' seagate 1T is missing, instead i have a bunch of partitions with 'unknown types.' i did a complete tear down and rebuild to check for any physical problems. noticed nothing wrong, gave up for the night (Lost was on).

    woke up at 630am to start rebuilding before work. got all the components back together. made a few tweaks to my cable management to improve air flow around hard drives (that new WD Caviar Black runs HOT). installed ubuntu 9.10 on the WD hdd (a 40 gig part. at the end with a separate swap part.). before leaving i started a cylinder by cylinder check for partition information using testdisk on the (was 'healthy') seagate 1T backup drive.

    the most frustrating thing about the whole thing is not knowing how to phrase the various problems, or how to begin to think of solutions to unknown pathologies. also, during the new install of the WD 1T hdd, i grabbed my OEM vista dvd and popped it in the drive to see where it would get me. it got me to just after the green loading bar to where there was a mouse and some colors and it would just hang there. (i tried with just the new drive and it was having probs, which might be AHCI related, might not.)

    got home last night, checked on testdisk and it recovered my missing partitions. i re-wrote them to the drive. rebooted, hoping to get the fresh ubu install, however, i ended up at the GRUB-Restore> prompt. GRUB CLI makes me panic. the "-restore>" part is even worse because it limits the number of commands available. so i ran ismod /normal.mod or whatever its called to try to get GRUB into normal.mode. fail. however, i ran LS and it found all my disks and partitions.

    so i tried to root the new ubu partition (hd2,1) as the /boot, but apparently that function wasnt working from GRUB-Restore>. oh well. a friend is coming over tonight to help with the hacking. i am going to try a LiveCD install/config of GRUB so that i can have fuller access.

    once i get the GRUB menu up, i am going to try to follow your DD method as recommended, the only question i had was in the BS (blocksize) parameter. how can i tell what will be ideal for transfer?

    i had previously tweeted that every other time i had broken my pc, i had learned something in fixing it. this time was different was my caveat, i just wanted it fixed. somehow, i have come back from that desperate precipice. i am happy again learning from where i perceive my situation to be, its not too bad and i should be able to get it hacked back together with a little patience. nice.

    G-R> , we have a date with destiny tonight.
     
  10. saikee

    saikee

    Joined:
    Jun 11, 2004
    Messages:
    3,888
    The block size parameter in dd is up to the user's own choice.

    If none is specified dd defaults to bs=512 bytes which is the smallest it can do. If you want just one byte the disk controller will still read one block of 512 bytes and it is up to the operating system to strip out the bit you want.

    The bs=32256 is one complete track as modern LBA hard disks have 63 sectors and each sector is 512 bytes so 63x512=32256. It is about the optimum I have found out by trial and error. Using smaller block sizes will cause more records to be transferred and so the progress is slower. Increasing the block size doesn't help much as system memory will not be big enough to hold everything in core.
     
  11. raamindasu

    raamindasu Thread Starter

    Joined:
    Aug 24, 2007
    Messages:
    12
    Thanks Saikee and jiml8 and Terrynet:

    for anyone that gets into trouble like i listed above, i was able to get my mbr pulled back together (my cardinal problem) with grub via live-cd using the following guide:

    http://grub.enbug.org/Grub2LiveCdInstallGuide

    afterward, i targeted the unnecessary partitions with gparted and erased (should have done prior to rebuilding grub but oh well), unmounted all and remounted all and restarted and didnt end up with any corruption (still need to clean up menu list). [fyi: (sudo apt-get install) testdisk was a great resource for recovery if you mess around in gparted too much.] with respect to getting the images/partitions to do anything i have been unable to get GRUB to boot into windows, even for the sake of repair. GRUB recognizes the windows loader, and the structure appears to be ok, but if i choose the Vista loader it goes black and does nothing else.

    however, and this may not be related, my BIOS post time has gone from 3 to about 15-20 seconds, and OS boot from GRUB menu went from about 8 to 30 seconds. Also i am running into an error trying to install vista from my OEM DVD; it gets to the green (kernel) loading bar part of the menu, then hangs indefinitely (for at least 25 minutes). i thought this may have to do with bios an ide/ahci driver loading issue but in ide mode it still isnt respnding.

    im still holding out hope of getting my vista partition working again (9-button mouse hardware incompatibility in wine QQ), and then running the DD method. however, i dont know if i would just be nesting a corrupt image/partition into a DD.
     
  12. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Similar Threads - Solved GRUB help
  1. thenoobie2020
    Replies:
    2
    Views:
    436
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/914870

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice