Find the answer to your Linux question:
Results 1 to 9 of 9
Like Tree1Likes
  • 1 Post By mailforbiz
Hi all I have a Windows 7 and Ubuntu dual boot configuration on my Dell Latitude (there is also the Dell Recovery partition which I'm leaving intact for now for ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Oct 2011
    Posts
    3

    Win Ubuntu dual-boot : need to format the Windows partiton


    Hi all

    I have a Windows 7 and Ubuntu dual boot configuration on my Dell Latitude (there is also the Dell Recovery partition which I'm leaving intact for now for warranty reasons). For a variety of reasons, I have decided to reinstall my Windows 7 install and I want to format the partition when I do so.

    Partition 1: Windows 7 main
    Partition 2: Window 7 Data
    Partition 3-5: Ubuntu 10.4 (separate /,/home/ and swap)
    Drive 6: Dell Recovery partition

    Will I have problem reinstalling grub or using boot-repair with LiveCD should work? I have used boot-repair to recover grub earlier but I didn't format the Windows partition in that case so I am not sure it'll work. If that method doesn't work, what do I need to do - backup the MBR somehow?

    Thanks in advance!
    HT

  2. #2
    Linux Guru
    Join Date
    Oct 2007
    Location
    Tucson AZ
    Posts
    3,190
    I'd suggest you boot Ubuntu and get your drive/partition information which you can do from a terminal with: sudo fdisk -l(lower Case Letter L in the command) to post here.

    If you want to simply format what you refer to as the "main" windows partition, the only problem you will have after word is reinstalling Grub which should not be that difficult. Without knowing what the partitions are labelled in Ubuntu it's going to be difficult to be more specific.

  3. #3
    Just Joined!
    Join Date
    Oct 2011
    Posts
    3
    Yancek, thanks for the response.

    Here is the partition info in detail (fdisk -l).

    /dev/sda1 HPFS/NTFS Windows main (Boot partition)
    /dev/sda2 HPFS/NTFS Windows data
    /dev/sda3 HPFS/NTFS Dell Recovery
    /dev/sda4 Extended
    /dev/sda5 Linux /
    /dev/sda6 Linux /home
    /dev/sda7 Linux swap
    /dev/sda8 Linux /tmp

    I have used boot-repair before to get grub back after reinstalling windows on /dev/sda1. But in that instance I didn't format /dev/sda1 and so my question is will boot-repair work even with format of that partition and reinstall? Just want to confirm before I start messing.

    Thanks,
    HT

    PS: In case you're finicky about the exact output of fdisk, it is:
    /dev/sda1 * 1 13544 108784640 7 HPFS/NTFS
    /dev/sda2 13544 23742 81920000 7 HPFS/NTFS
    /dev/sda3 37129 38914 14337024 7 HPFS/NTFS
    /dev/sda4 23742 35305 92877825 5 Extended
    /dev/sda5 23742 28618 39165952 83 Linux
    /dev/sda6 28618 34697 48827392 83 Linux
    /dev/sda7 34697 35184 3905536 82 Linux swap / Solaris
    /dev/sda8 35184 35305 975872 83 Linux

  4. #4
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    If you do not change partition structure then boot-repair will definitely work. There are a lot of other ways to re-install GRUB2 and I don't think you will have any problem in doing that. Just re-install Windows OS in first partition of Hard disk (/dev/sda1), boot up from Ubuntu LiveCD, mount /dev/sda5 and execute update-grub command.
    Last edited by devils casper; 10-24-2011 at 06:03 AM. Reason: typo
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  5. #5
    Linux User ptkobe's Avatar
    Join Date
    Feb 2008
    Location
    Torres Vedras, PT
    Posts
    276
    Quote Originally Posted by devils casper View Post
    ... boot up from Ubuntu LiveCD, mount /dev/sda5 and execute grub-update command.
    I think you mean
    # grub-install --root-directory=/mount_dir /dev/sda
    not grub-update. Right?

  6. #6
    Just Joined!
    Join Date
    Oct 2011
    Posts
    3
    Folks,

    Just wanted to confirm the reformat/reinstall of Win 7 went flawlessly. I just booted back into Ubuntu LiveCD afterwards, installed boot-repair using apt-get (need to add pp repository first) and just chose the default option of boot-repair and voila! - was back into grub. Was as painless as it can be.

    Since the above was so easy and recommended, I went through that route instead of grub-install/grub-update.

    Thanks for all your responses!

    HT
    ptkobe likes this.

  7. #7
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    Windows OS re-install doesn't un-install GRUB from Ubuntu. It just removes GRUB from MBR only. grub-update command re-install GRUB in MBR and boot-repair command execute the same command in background.
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  8. #8
    Linux User ptkobe's Avatar
    Join Date
    Feb 2008
    Location
    Torres Vedras, PT
    Posts
    276
    devils, I must say I'm not convinced Thought update-grub (not grub-update, of course) only creates grub.cfg, but as I'm not sure and HT solved the problem, I'll try to check it next time I need to reinstall the loader.
    Thanks, best regards
    Luis

  9. #9
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    It was a typo and I have corrected it. Thanx !

    update-grub command regenerates grub.cfg file and grub-install command re-installs GRUB. If user has added a new Hard disk having OS, update-grub command will detect it and add its entry in regenerated GRUB Menu.
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

Posting Permissions

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