Jump to content

Ext4 partition: Getting rid of Initialize, Ignore or Eject


5 posts in this topic

Recommended Posts

I just installed an extra IDE disk into my Hackintosh and dropped Ubuntu on it. It appears to be working fine, with one exception. Every time I boot OS X I get this message: The disk you inserted is not readable by this computer. I am then given the option to Initialize, Ignore or Eject. Ignoring or ejecting is all fine and well, but I know one day my finger will slip, and I'll hit Initialize. How do I get rid of this disaster waiting to happen?

 

My disk layout is a 640GB WD SATA drive attached to an Intel ICH9 SATA controller, with NEC DVD and a 120GB WD IDE drive on a VIA VT6421 IDE controller. The 640GB drive is split equally between OS X and Windows on an MBR formatted hard drive with GRUB as a bootloader. The 120GB is dedicated to an Ubuntu ext4 partition and a swap partition. Here's output from "diskutil list"

 

2011-02-23 21:33:25.633 diskutil[171:903] _CFGetHostUUIDString: unable to determine UUID for host. Error: 35

/dev/disk0

#: TYPE NAME SIZE IDENTIFIER

0: FDisk_partition_scheme *120.0 GB disk0

1: Linux 115.1 GB disk0s1

2: Linux_Swap 4.9 GB disk0s5

/dev/disk1

#: TYPE NAME SIZE IDENTIFIER

0: FDisk_partition_scheme *640.1 GB disk1

1: Windows_NTFS XP64 314.6 GB disk1s1

2: Windows_FAT_32 EXCHANGE 10.5 GB disk1s2

3: Apple_HFS Snow 315.1 GB disk1s3

Link to comment
Share on other sites

First, in my experience OS X ignores Linux partitions automatically. The fact that it's not doing so for you suggests that something may be wrong. You might want to check your partition type codes. You can do this in Linux using fdisk, as in:

 

sudo fdisk -lu

 

This will produce output similar to the following (which I've trimmed to just one drive for brevity):

 

Disk /dev/sdb: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x00022117

  Device Boot	  Start		 End	  Blocks   Id  System
/dev/sdb1   *		  63	  192779	   96358+  83  Linux
/dev/sdb2		 1012095   625137344   312062625   8e  Linux LVM
/dev/sdb3		  192780	 1012094	  409657+  82  Linux swap / Solaris

Partition table entries are not in disk order

 

The type codes appear under the "Id" column. In this case, they're 83 (Linux data), 8e (Linux LVM), and 82 (Linux swap). If you see something else, such as af (HFS/HFS+) or 07 (HPFS/NTFS), then that's wrong and it should be changed. You can do this with fdisk by launching it on the disk ("sudo fdisk /dev/sdb", for instance), using the "t" option to change the type code, and then using the "w" option to save the changes.

 

If your partition type codes are OK but OS X is still behaving as you report, you could try creating an /etc/fstab file that contains entries to ignore the partitions in question. This page describes the process. One caveat: I'm not sure what you should specify for the filesystem type code. You might try ntfs, and whatever you do, pass it a read-only ("ro") option, along with "noauto" (so "ro,noauto"). Instead of passing a UUID value, pass the device ID. The result might look like this:

 

/dev/disk0s1   /Volumes/Linux  ntfs  ro,noauto

Link to comment
Share on other sites

Thanks for the response. I have read one other post (sorry, don't have a link) that OS X does ignore Linux partitions on AHCI controllers, but I'm not sure if that's true or not. As it's an IDE disk, that's not an option for me. I've also had similar problems with dual boot Linux/OS X PowerPC machines. Here's the output of "sudo fdisk -lu"

 

Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders, total 234441648 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: 0x000d5f22

  Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048     7999487     3998720   82  Linux swap / Solaris
Partition 1 does not end on cylinder boundary.
/dev/sda2   *     7999488   234440703   113220608   83  Linux

Disk /dev/sdb: 640.1 GB, 640135028736 bytes
255 heads, 63 sectors/track, 77825 cylinders, total 1250263728 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: 0x1a831a83

  Device Boot      Start         End      Blocks   Id  System
/dev/sdb1              63   614405924   307202931    7  HPFS/NTFS
/dev/sdb2       614405925   634888799    10241437+   c  W95 FAT32 (LBA)
/dev/sdb3   *   634888800  1250258624   307684912+  af  HFS / HFS+

WARNING: GPT (GUID Partition Table) detected on '/dev/sdc'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sdc: 80.0 GB, 80025280000 bytes
255 heads, 63 sectors/track, 9729 cylinders, total 156299375 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: 0x00000000

  Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *           1   156299374    78149687   ee  GPT

 

I've recently added the 80GB GPT drive to have a backup boot drive. The problem appeared before hooking up the GPT drive, so I'm pretty sure that's not the problem.

 

As you can see, the partition codes on the 120GB appear to be correct. One thing I noticed after the fact was that diskutil complained about not being able to read the UUID on the 120GB drive. There's also a warning about the partition not ending on a cylinder boundary, though the Ubuntu partitioner was perfectly happy to create that layout. If you don't think either of these issues might be causing the problem, I'll go ahead and create a "bogus" fstab entry. I've edited plenty of Linux fstab tables, but I've never tried with OS X before...

Link to comment
Share on other sites

I found a better solution. I reformatted the ext4 partition to ext3 and re-installed Ubuntu 10.10 x64. I then loaded MacFuse and Fuse-ext2 on my SL install. I can now read (and possibly write, though I don't think I'll tempt fate) the Linux partition, and there's no more annoying/dangerous prompt at boot. Thanks for the reply!

Link to comment
Share on other sites

I'm glad you found a solution. I recommend you create /etc/fstab entries for your partition(s) to limit the access to read-only; as it is, OS X is probably mounting them read/write, which is inherently at least a little bit risky.

 

Concerning your query about the cylinder boundary issue, don't worry. In the early Medieval period (that is, the 1980s), hard disks were accessed using cylinder/head/sector (CHS) addressing, and for performance reasons, it made sense to begin partitions on cylinder boundaries. The performance issues of partition start points being on cylinder boundaries have been non-existent for years, though, and other vestiges of CHS addressing have been dropping in importance for years, as well. Today, by contrast, RAID arrays, SSDs, and Advanced Format drives all have different performance issues that make starting partitions on sectors numbered as multiples of 4KiB, 128KiB, or some other value. Thus, most modern partitioning tools start partitions on 1MiB boundaries (since that's a multiple of all the common values). This isn't a multiple of the old cylinder boundaries, and some tools (such as Linux fdisk) still complain about it. IMHO, they should stop doing it; these complaints just cause confusion.

Link to comment
Share on other sites

 Share

×
×
  • Create New...