grub-install fails on drive that previously had ufs2 installed

Bug #1360971 reported by Matthew A. Olson on 2014-08-25
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Linux Mint

Bug Description

I attempted to install Linux Mint 17 'Qiana' (with Cinnamon, 64-bit) on a hard drive that previously contained a FreeBSD 10.0 installation. My intention was to use the entire disk for the new installation. I manually partitioned the hard drive with fdisk before the installation; here is the output for the drive in question for 'fdisk -l':

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0009c6ac

   Device Boot Start End Blocks Id System
/dev/sdb1 * 2048 209717247 104857600 83 Linux
/dev/sdb2 209717248 1887438847 838860800 83 Linux
/dev/sdb3 1887438848 1953525167 33043160 82 Linux swap / Solaris

I then used the manual graphical installer and selected the root, home and swap partitions for the installation. The install went fine until grub installation, which iirc was a general "fatal error." Then I chrooted into the new installation and tried to install grub manually with 'grub-install /dev/sdb', which failed with the following error:

Installing for i386-pc platform.
grub-install: error: hostdisk//dev/sda appears to contain a ufs2 filesystem which isn't known to reserve space for DOS-style boot. Installing GRUB there could result in FILESYSTEM DESTRUCTION if valuable data is overwritten by grub-setup (--skip-fs-probe disables this check, use at your own risk).

At my own risk I tried again, passing the --skip-fs-probe switch:

Installing for i386-pc platform.
grub-install: warning: Attempting to install GRUB to a disk with multiple partition labels. This is not supported yet..
grub-install: warning: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and their use is discouraged..
grub-install: error: will not proceed with blocklists.

Then I tried clearing the MBR with 'dd if=/dev/zero of=/dev/sdb bs=512 count=1' and repeated the above steps, which didn't work and produced the same errors.

Then I tried clearing the first several blocks with 'dd if=/dev/zero of=/dev/sdb bs=512 count=4' and repeated the above steps, which still didn't work and still produced the same errors.

Then I entered 'dd if=/dev/zero of=/dev/sdb', brewed a cup of coffee, and then came back and stopped dd, which zeroed out the first 10GB or so of the disk, and this solved the problem.

In summary, the manual installer doesn't work on a disk with a previous ufs installation and one solution is to clear somewhere between 4 and 19531250 blocks at the beginning of the disk. This may be "by design," but it took me a long time to work through it, so maybe some more helpful error messages are in order.

[This is 100% repro]

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers