Results 1 to 10 of 17

Thread: Sector 32 FlexNet Problem -- Grub

Hybrid View

  1. #1
    Join Date
    Nov 2008
    Beans
    Hidden!

    Sector 32 FlexNet Problem -- Grub

    A few months ago, a friend of mine had an MS-Windows PC that was riddled with viruses, and he asked me to help him out with it.

    So I shrunk his main MS-Windows partition and I created a partition for Ubuntu.

    When Grub was installing to the MBR, it said something about Sector 32 being in use by FlexNet, but it didn't say that this was a fatal error.

    After I installed Grub, I rebooted the PC, but I wasn't able to get Ubuntu to boot up. I eventually decided to explore the Sector 32 problem to see if that was the cause.

    It seems a lot of people encounter this problem but I haven't seen one solution for it on the web other than to "wipe your hard disk". Total nonsense.

    So I'm gonna try put together a solution in this thread. Let's take a look at the problem:

    A hard disk is made up of sectors. A sector on a modern hard disk is 512 bytes. The first sector is called Sector 0, and it stores the Master Boot Record. The MBR consists of:
    * 440 bytes for bootable code (such as Grub)
    * 4 bytes for the disk signature
    * 2 bytes of nulls
    * 64 bytes for the partition table
    * 2 bytes for the MBR signature

    The partition table contains the list of partitions, saying what sector they start at and what sector they finish on.

    You might expect the 1st partition to start at Sector 1, but actually it tends to start at Sector 63 on a lot of computers. (The 1st partition tends to start at Sector 63 because there's 63 sectors in a cylinder, and MS-DOS wanted every partition to start at a cylinder boundary). So that means there's 62 unused sectors between the MBR and the 1st partition.

    (To find out where your own first partition starts, do fdisk -lu /dev/sda. On modern PC's this could be all sorts of numbers because of the way recovery partitions are laid out. By the way make sure that fdisk says that the sector size is "512 bytes"... because emm... I don't know what to say if it doesn't!).

    It so happens that more than one program likes to make use of those 62 free sectors between the MBR and the 1st partition.

    Grub has 440 bytes available to it in the MBR to store its bootable code, but it wants more space than that, so it uses the space between the MBR and the 1st partition. But Grub isn't the only program that wants to use that space, a thing called FlexNet does too. FlexNet is some sort of software license manager, and according to the warning issued by Grub, it likes to store data in Sector 32.

    When you try to install Grub over FlexNet, Grub refuses to overwrite Sector 32 if it sees FlexNet data in it. It would be great if you could just tell Grub to overwrite Sector 32, but it provides no such facility. For me, this caused a problem and Ubuntu wouldn't boot up for me.

    So what's the solution to get Grub working? You don't need to go wiping your entire hard disk, you just need to wipe the area between the MBR and the 1st partition.

    EXTREME CAUTION ADVISED: Wiping the storage area between your MBR and the 1st partition is an inherently dangerous activity. Doing so may result in serious injury and even death. Programs which make use of this storage area, such as FlexNet, may cease to function. You willingly accept the serious risks involved. You accept as your own responsiblity any harm that comes about as a result of following this guide, even if the guide contains errors or oversights.

    First, make a backup of the first 63 sectors of your hard disk (i.e. the MBR along with the 62 free sectors):

    Code:
    sudo dd if=/dev/sda of=~/first_63_sectors bs=512 count=63


    Trust me, back this up. No really. Do. Back it up. Seriously. You don't want to lose your partition table.
    Plus it's handy to have it backed up just in case you actually need that FlexNet data in future for whatever reason.

    Next, erase Sector 1 through Sector 62 (i.e the 62 free sectors):

    Code:
    sudo dd if=/dev/zero of=/dev/sda bs=512 count=62 seek=1
    That should do it, now Sector 1 through Sector 62 should be full of zeroes. Do "grub-install" again and see what happens.

    I'm not sure if FlexNet stores data in sectors other than Sector 32, but that's not a problem since we've just wiped everything between the MBR and the 1st partition.

    If you want to target one individual sector to erase, then you can erase Sector 32 as follows:

    Code:
    sudo dd if=/dev/zero of=/dev/sda bs=512 count=1 seek=32
    After I erased the FlexNet data and re-installed Grub, the PC booted up fine.

    If anyone sees any error in this post then please post here ASAP -- I'd hate for someone to lose data because of an error made in this guide.

    Last edited by Virchanza; January 6th, 2011 at 07:24 PM.

  2. #2
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Sector 32 FlexNet Problem -- Grub

    It is not just Flexnet which may be part of many different windows programs. Colin Watson from the grub2 team was looking for disk signatures as the windows software kept overwriting grub2. They obviously now have a workaround for flexnet, but may not for all software. Just be aware of other windows programs also.

    http://linux.slashdot.org/story/10/0...B-2-Unbootable
    http://www.chiark.greenend.org.uk/ucgi/~cjwatson/blosxom/debian/2010-08-28-windows-applications-making-grub2-unbootable.html
    In Windows 7, had to remove Windows 7 DataSafe.
    HP ProtectTools, Dell Recovery, flexnet and a few others write into MBR meierfra.
    https://bugs.launchpad.net/ubuntu/+s...b2/+bug/441941
    https://bugs.edge.launchpad.net/ubun...1?comments=all

    Some software that may use Flexnet, just so you do not lose it unless you have no need anymore for it.
    Adobe Photoshop, CAD/CAM, Rosetta Stone, Matlab others
    Last edited by oldfred; January 6th, 2011 at 08:16 PM. Reason: Some software using flexnet in windows
    For more info on UEFI boot install & repair - Regularly Updated :
    http://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  3. #3
    Join Date
    Feb 2007
    Location
    Folsom, CA
    Beans
    59
    Distro
    Ubuntu

    Re: Sector 32 FlexNet Problem -- Grub

    I am trying to set up a triple boot Win7 x64, Ubuntu x64, XP x32 setup. 7 and Ubuntu are up and running. While setting up Grub 2 I got the message about FlexNet. XP installer crashes with the 0x0000007B BSOD. I'm wondering if the XP installer thinks FlexNet is a boot sector virus and thus halts.

    I really thinking about trying those commands you listed above to see if my theory is correct. The one thing I am not sure on is how to restore the sectors if worse comes for worse. Just to be sure, the command to restore the sectors would be "sudo dd if=~/first_63_sectors of=/dev/sda bs=512 count=63" correct?

  4. #4
    Join Date
    Feb 2007
    Location
    Folsom, CA
    Beans
    59
    Distro
    Ubuntu

    Re: Sector 32 FlexNet Problem -- Grub

    Well, tried it anyway. BTW the third command (the one that erases only sector 32) works just fine. Grub reinstalled with no errors.

    My hunch was wrong about the XP installer though That issue is off topic, however. If someone reading this thinks they know the answer, msg me and I'll start a new thread elsewhere.

  5. #5
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Sector 32 FlexNet Problem -- Grub

    Do you have a primary partition formated NTFS for XP?

    To get each MS to have its own boot loader make a primary partition and set its boot flag on, then install the 2nd product in it. Multibooters, Pictures here worth 1000+ words
    http://www.multibooters.co.uk/multiboot.html
    A user who installed two windows & it worked to boot from grub directly
    http://ubuntuforums.org/showthread.php?t=1271600
    Another user who disconnected and used a second drive
    http://ubuntuforums.org/showthread.php?t=1334346
    For more info on UEFI boot install & repair - Regularly Updated :
    http://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  6. #6
    Join Date
    Aug 2008
    Beans
    7

    Re: Sector 32 FlexNet Problem -- Grub

    Thanks for your completed and explained procedure!

  7. #7
    Join Date
    Nov 2008
    Location
    Buenos Aires, Argentina
    Beans
    105
    Distro
    Ubuntu 16.04 Xenial Xerus

    Red face Re: Sector 32 FlexNet Problem -- Grub

    Quote Originally Posted by Virchanza View Post
    A few months ago, a friend of mine had an MS-Windows PC that was riddled with viruses, and he asked me to help him out with it.

    So I shrunk his main MS-Windows partition and I created a partition for Ubuntu.

    When Grub was installing to the MBR, it said something about Sector 32 being in use by FlexNet, but it didn't say that this was a fatal error.

    After I installed Grub, I rebooted the PC, but I wasn't able to get Ubuntu to boot up. I eventually decided to explore the Sector 32 problem to see if that was the cause.

    It seems a lot of people encounter this problem but I haven't seen one solution for it on the web other than to "wipe your hard disk". Total nonsense.

    So I'm gonna try put together a solution in this thread. Let's take a look at the problem:

    A hard disk is made up of sectors. A sector on a modern hard disk is 512 bytes. The first sector is called Sector 0, and it stores the Master Boot Record. The MBR consists of:
    * 440 bytes for bootable code (such as Grub)
    * 4 bytes for the disk signature
    * 2 bytes of nulls
    * 64 bytes for the partition table
    * 2 bytes for the MBR signature

    The partition table contains the list of partitions, saying what sector they start at and what sector they finish on.

    You might expect the 1st partition to start at Sector 1, but actually it tends to start at Sector 63 on a lot of computers. (The 1st partition tends to start at Sector 63 because there's 63 sectors in a cylinder, and MS-DOS wanted every partition to start at a cylinder boundary). So that means there's 62 unused sectors between the MBR and the 1st partition.

    (To find out where your own first partition starts, do fdisk -lu /dev/sda. On modern PC's this could be all sorts of numbers because of the way recovery partitions are laid out. By the way make sure that fdisk says that the sector size is "512 bytes"... because emm... I don't know what to say if it doesn't!).

    It so happens that more than one program likes to make use of those 62 free sectors between the MBR and the 1st partition.

    Grub has 440 bytes available to it in the MBR to store its bootable code, but it wants more space than that, so it uses the space between the MBR and the 1st partition. But Grub isn't the only program that wants to use that space, a thing called FlexNet does too. FlexNet is some sort of software license manager, and according to the warning issued by Grub, it likes to store data in Sector 32.

    When you try to install Grub over FlexNet, Grub refuses to overwrite Sector 32 if it sees FlexNet data in it. It would be great if you could just tell Grub to overwrite Sector 32, but it provides no such facility. For me, this caused a problem and Ubuntu wouldn't boot up for me.

    So what's the solution to get Grub working? You don't need to go wiping your entire hard disk, you just need to wipe the area between the MBR and the 1st partition.

    EXTREME CAUTION ADVISED: Wiping the storage area between your MBR and the 1st partition is an inherently dangerous activity. Doing so may result in serious injury and even death. Programs which make use of this storage area, such as FlexNet, may cease to function. You willingly accept the serious risks involved. You accept as your own responsiblity any harm that comes about as a result of following this guide, even if the guide contains errors or oversights.

    First, make a backup of the first 63 sectors of your hard disk (i.e. the MBR along with the 62 free sectors):

    Code:
    sudo dd if=/dev/sda of=~/first_63_sectors bs=512 count=63


    Trust me, back this up. No really. Do. Back it up. Seriously. You don't want to lose your partition table.
    Plus it's handy to have it backed up just in case you actually need that FlexNet data in future for whatever reason.

    Next, erase Sector 1 through Sector 62 (i.e the 62 free sectors):

    Code:
    sudo dd if=/dev/zero of=/dev/sda bs=512 count=62 seek=1
    That should do it, now Sector 1 through Sector 62 should be full of zeroes. Do "grub-install" again and see what happens.

    I'm not sure if FlexNet stores data in sectors other than Sector 32, but that's not a problem since we've just wiped everything between the MBR and the 1st partition.

    If you want to target one individual sector to erase, then you can erase Sector 32 as follows:

    Code:
    sudo dd if=/dev/zero of=/dev/sda bs=512 count=1 seek=32
    After I erased the FlexNet data and re-installed Grub, the PC booted up fine.

    If anyone sees any error in this post then please post here ASAP -- I'd hate for someone to lose data because of an error made in this guide.

    Hi,

    In my case, the Flexnet-generated problem seems to be in sector 33.
    Code:
    Dispositivo Inicio    Comienzo      Fin      Bloques  Id  Sistema
    /dev/sda1   *        2048   152158207    76078080   83  Linux
    /dev/sda2       152160254   156301311     2070529    5  Extendida
    /dev/sda5       152160256   156301311     2070528   82  Linux swap / Solaris
    pablo@pablo-HP-Compaq-dc7700-Small-Form-Factor:~$ sudo grub-install /dev/sda
    /usr/sbin/grub-setup: aviso: Sector 33 is already in use by FlexNet; avoiding it.  This software may cause boot or other problems in future.  Please ask its authors not to store data in the boot track.
    Installation finished. No error reported.
    I'm trying to follow Virchanza's how-to, but when I do
    sudo dd if=/dev/sda of=~/first_63_sectors bs=512 count=63
    the outcome is
    Code:
    sudo dd if=/dev/sda of=~/first_63_sectors bs=512 count=63
    63+0 registros leídos
    63+0 registros escritos
    32256 bytes (32 kB) copiados, 0,0120631 s, 2,7 MB/s
    so I'm not sure what's the highly recommended backup I should perform here. Could please anybody tell me how to go on from here?
    Thanks for your patience.

  8. #8
    Join Date
    Jan 2008
    Location
    France
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Arrow Re: Sector 32 FlexNet Problem -- Grub

    Hola Pablo,

    don't worry, there is no problem in the command output you indicate (it created a backup of your MBR in your Home folder). Put this backup on a USB key by security.
    Then erase the FlexNet and reinstall GRUB, either by the command lines indicated in Post#1, or graphically via the "FlexNet" option of Boot-Repair.

  9. #9
    Join Date
    Nov 2008
    Location
    Buenos Aires, Argentina
    Beans
    105
    Distro
    Ubuntu 16.04 Xenial Xerus

    Wink Re: Sector 32 FlexNet Problem -- Grub

    Quote Originally Posted by YannBuntu View Post
    Hola Pablo,

    don't worry, there is no problem in the command output you indicate (it created a backup of your MBR in your Home folder). Put this backup on a USB key by security.
    Then erase the FlexNet and reinstall GRUB, either by the command lines indicated in Post#1, or graphically via the "FlexNet" option of Boot-Repair.

    Bonjour, Yannbuntu. And hello forum!
    Thanks for that. It worked like a charm. I'll be reporting the whole experience in another post (from which I was referred to here), so that other people in the same situation can make use of it. For those interested, that thread is here http://ubuntuforums.org/showthread.php?t=1976158.

    à bientôt
    Thanks for your patience.

  10. #10
    Join Date
    Dec 2010
    Beans
    7

    Re: Sector 32 FlexNet Problem -- Grub

    Virchanza's solution worked perfectly for me. My GRUB was working fine to begin with but I didn't like the FlexNet remnants being leftover from these reused drives (which used to have windows installed on them).

    And, yes, if you're dual-booting windows you might want to leave FlexNet alone because you could break the windows/adobe/rescue/etc software that originally wrote to this sector (worst case). Best case is that when you boot into windows the software will just write its "turds" back into sector 32 (or whatever sector) and you'll have to do this all over again. So you should really only bother with wiping it out if you're actually having issues with grub working, if not, just leave it alone.

    Also, I only wiped the single sector 32 instead of the entire 1 through 62. Worked fine.

Bookmarks

Posting Permissions

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