Wednesday 13 November 2013

OS X 10.9 (Mavericks) Problems with USB SD card adaptors and a fix

UPDATE - This improves the problem but you get I/O errors when trying to write large amounts of data to the SD card.

One thing that I have noticed with OS X 10.9 is that USB SD card adaptors have stopped working properly. Generally the SD card will mount and then unmount itself. It will get stuck in a cycle of doing this, leaving notification dialog boxes stating that the disk has not ejected properly.

Investigating the issue I noticed that the version of IOUSBMassStorageClass.kext was 3.6.0 that was delivered with 10.9. The version of IOUSBMassStorageClass.kext that is delivered with the 10.8.5 is 3.5.1. The solution that I have found is to revert the IOUSBMassStorageClass.kext extension back to the 10.8.5 version. I find it suspicious that Mavericks has problems with other USB mass storage devices.

To update the IOUSBMassStorageClass.kext

First make a new folder /System/Library/Extensions-Disabled. Move the IOUSBMassStorageClass.kext version 3.6.0 from /System/Library/Extensions to /System/Library/Extensions-Disabled

Copy the IOUSBMassStorageClass.kext version 3.5.1 file to /System/Library/Extensions. Then, open the Terminal app (located in OS X under Applications->Utilities) and type:

cd /System/Library/Extensions

For those unfamiliar with command line, this just changes the directory that Terminal is working on to /System/Library/Extensions. Then type:


sudo chmod -R 755 IOUSBMassStorageClass.kext
sudo chown -R root:wheel IOUSBMassStorageClass.kext

This fixes the kext's permissions.

Then reboot. If everything went well, then hopefully the newly replaced kext will do the job. It  is a good idea to run disk utility and repair the permissions.




Sunday 21 April 2013

Create your own Fusion drive - Mac Pro - Error: 22: POSIX reports: Invalid argument - Fixed

I wanted to create a fusion drive because I had a 120GB disk that I had purchased and then realised it was too small for my home disk. I backed everything up by shuffling files from one drive to another using Carbon Copy Cloner - the best tool for doing these kind of things. This freed up a 1TB drive that I could use. I used the tutorial posted in MacTuts to do the work MacTuts Tutorial

Everything was ready and I ran the magic commands in the terminal on Mac and was stumped.

Check the disks on the system


unknown-00:25:00:f1:a7:2e:~ george$ diskutil list
/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *120.0 GB   disk0
   1:                        EFI                         209.7 MB   disk0s1
   2:                  Apple_HFS                         119.7 GB   disk0s2
/dev/disk1
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *1.0 TB     disk1
   1:                        EFI                         209.7 MB   disk1s1
   2:                  Apple_HFS MacOS 10.8              332.8 GB   disk1s2
   3:                 Apple_Boot Recovery HD             650.0 MB   disk1s3
   4:                  Apple_HFS MacOS 10.7              332.8 GB   disk1s4
   5:                 Apple_Boot Recovery HD             650.0 MB   disk1s5
   6:                  Apple_HFS MacOS 10.6              319.8 GB   disk1s6
   7:       Microsoft Basic Data TEMP                    12.3 GB    disk1s7
/dev/disk2
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *640.1 GB   disk2
   1:                        EFI                         209.7 MB   disk2s1
   2:                  Apple_HFS                         639.8 GB   disk2s2
/dev/disk3
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *2.0 TB     disk3
   1:                        EFI                         209.7 MB   disk3s1
   2:                  Apple_HFS Data                    1.0 TB     disk3s2
   3:                  Apple_HFS MacOS 10.8 - New        299.5 GB   disk3s3
   4:                 Apple_Boot Recovery HD             784.2 MB   disk3s4
   5:                  Apple_HFS MacOS 10.7 - New        299.5 GB   disk3s5
   6:                 Apple_Boot Recovery HD             784.2 MB   disk3s6
   7:                  Apple_HFS MacOS 10.6 - New        393.5 GB   disk3s7


Now run the command


unknown-00:25:00:f1:a7:2e:~ george$ diskutil corestorage create logvol /dev/disk0 /dev/disk1
Started CoreStorage operation
Unmounting disk0
Repartitioning disk0
Unmounting disk
Creating the partition map
Rediscovering disk0
Error: 22: POSIX reports: Invalid argument

No matter what I tried it kept failing. The secret to getting this to work was to specify the partition that should be used. This was hidden away in a post in the xclr8yourmac web site xlr8yourmac Fusion Drive Discussion.

The answer is to use the disk partition disk0s2 and disk1s2.

unknown-00:25:00:f1:a7:2e:~ george$ diskutil corestorage create logvol /dev/disk0s2 /dev/disk1s2
Started CoreStorage operation
Unmounting disk0s2
Touching partition type on disk0s2
Adding disk0s2 to Logical Volume Group
Unmounting disk1s2
Touching partition type on disk1s2
Adding disk1s2 to Logical Volume Group
Creating Core Storage Logical Volume Group
Switching disk0s2 to Core Storage
Switching disk1s2 to Core Storage
Waiting for Logical Volume Group to appear
Discovered new Logical Volume Group "1D2196F9-F64F-44C9-81EB-6E8EADEC7C9C"
Core Storage LVG UUID: 1D2196F9-F64F-44C9-81EB-6E8EADEC7C9C
Finished CoreStorage operation

It works! You can then follow the rest of the normal instructions.

unknown-00:25:00:f1:a7:2e:~ george$ diskutil corestorage createVolume 1D2196F9-F64F-44C9-81EB-6E8EADEC7C9C jhfs+ "MacOS 10.8" 100%
Started CoreStorage operation
Waiting for Logical Volume to appear
Formatting file system for Logical Volume
Initialized /dev/rdisk5 as a 1 TB HFS Plus volume with a 90112k journal
Mounting disk
Core Storage LV UUID: DB4C7761-25C1-4AA7-91DC-95BD19DD248D
Core Storage disk: disk5
Finished CoreStorage operation

In theory I now have one fusion drive as disk5. I just need to test it out and see if it improves things.

unknown-00:25:00:f1:a7:2e:~ george$ diskutil corestorage list
CoreStorage logical volume groups (1 found)
|
+-- Logical Volume Group 1D2196F9-F64F-44C9-81EB-6E8EADEC7C9C
    =========================================================
    Name:         logvol
    Status:       Online
    Size:         1118901059584 B (1.1 TB)
    Free Space:   73728 B (73.7 KB)
    |
    +-< Physical Volume 0E9BE62C-3A63-464A-9511-2B0C6952B4B6
    |   ----------------------------------------------------
    |   Index:    0
    |   Disk:     disk0s2
    |   Status:   Online
    |   Size:     119690149888 B (119.7 GB)
    |
    +-< Physical Volume 4713D499-C59A-452A-8996-4916C6D5D6E8
    |   ----------------------------------------------------
    |   Index:    1
    |   Disk:     disk1s2
    |   Status:   Online
    |   Size:     999210909696 B (999.2 GB)
    |
    +-> Logical Volume Family ABF926BE-F2ED-432F-99F4-542191127279
        ----------------------------------------------------------
        Encryption Status:       Unlocked
        Encryption Type:         None
        Conversion Status:       NoConversion
        Conversion Direction:    -none-
        Has Encrypted Extents:   No
        Fully Secure:            No
        Passphrase Required:     No
        |
        +-> Logical Volume DB4C7761-25C1-4AA7-91DC-95BD19DD248D
            ---------------------------------------------------
            Disk:               disk5
            Status:             Online
            Size (Total):       1110397812736 B (1.1 TB)
            Size (Converted):   -none-
            Revertible:         No
            LV Name:            MacOS 10.8
            Volume Name:        MacOS 10.8
            Content Hint:       Apple_HFS


Tuesday 26 March 2013

Fun with RHEL 6 kickstart

Why when you want to do something in a hurry do you find that build scripts suddenly stop working? Today I have spent my time trying to resolve issues with repositories and kickstart. The script that I had working for RHEL 5 to build a custom DVD no-longer worked.

RHEL 5 custom DVD creation

To create a custom RHEL 5 DVD do the following.
  • Insert the latest RHEL 5 DVD into the drive of a RHEL 5 Linux machine and copy the contents across to your build directory.
mkdir -p /data/iso-build
cd /data/iso-build
cp -R /media/CDROM/* ./
cp -R /media/CDROM/.[a-zA-Z]* ./
  • You can then edit the ks.cfg and do all sorts of things to customise the install. I won't detail this here.
  • The following is my quick and dirty build script to create the a new .iso file.
createrepo -g /data/iso-build/Server/repodata/comps-rhel6-Server.xml /data/iso-build/Server/
mkisofs -r -J -T -V "RHEL5 32" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o /data/RHEL5-custom.iso /data/iso-build

RHEL 6 custom DVD creation

To create a custom RHEL 6 DVD do the following.
  • Insert the latest RHEL 6 DVD into the drive of a RHEL 5 Linux machine and copy the contents across to your build directory.
mkdir -p /data/iso-build
cd /data/iso-build
cp -R /media/CDROM/* ./
cp -R /media/CDROM/.[a-zA-Z]* ./
  • You can then edit the ks.cfg and do all sorts of things to customise the install. I won't detail this here.
  • The following is my quick and dirty build script to create the a new .iso file
createrepo -s sha -g /data/iso-build/Server/repodata/comps-rhel6-Server.xml /data/iso-build/Server/
cp -Rf /data/iso-build/Server/repodata /data/iso-build/
mkisofs -r -J -T -V "RHEL6 32" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o /data/RHEL6-custom.iso /data/iso-build
  • There are two main differences. One I have to create the files in create repo with SHA1 not SHA256 which is the new default. Two I now have to copy the repodata directory to the top level from the Server directory. This seems to be needed otherwise anaconda has difficulty finding the yum repository. If the repodata directory doesn't also exist under the Server directory, then anaconda has difficulty finding the rpm files.