Monday, January 2, 2017

Can't have 3 partitions on Macbook Pro 13'' Late 2011

The MBR for Windows partition was corrupted when I divided the disk into 3 partitions, two for Mac OS and Windows and one for data.

At first, I installed Windows 7 my Macbook Pro 13'' late 2011 and the problem i couldn't fix is the palmrest area was usually very warm; the heat is unbearable if you rest your hands on it for about half an hour or longer. I tried many ways such as installing Windows updates, using MacFan Control application, and setting the maximum processor power to 90%. But, the heat was still unbearable.

After that, I accidentally corrupted the file system on all hard drives when i tried to shrink a partition on Windows so I had to install it again but I installed Windows 8.1 this time. While setting up Windows, i got this error message "Windows cannot be installed on this disk. The selected disk has an MBR partition table. On EFI systems, Windows can only......". It's because disk of MBR style can't have many primary partitions. I'm not how many but my disk already had three. I followed this https://www.youtube.com/watch?v=pb6tECZP6WE fix but the whole hard drive has to be formatted again. At the installation screen, I pressed Shift + F10 then a command prompt opened and I typed the following commands.
> diskpart
> list disk
> select disk <number>
I had two disks, the hard drive of my machine and USB drive of Windows installation files. The zero number represented the hard drive of my machine.
> clean
The clean commands formatted the whole hard drive.
> convert gpt
> exit
You have to type exit command so that the change is saved.
It seemed like Windows 8 worked better on my Macbook Pro. The palmrest area was much cooler, almost like normal even though I have about 20 tabs of Chrome browser opening and I hadn't even tried the cooling methods i did on Windows 7.

I had three partitions for MacOS, Windows, and data (extFAT). Only Windows partition was bootable so i installed MacOS on another partition. After the installation completed, I couldn't boot into Windows anymore. The Windows partition had been corrupted. I don't know why but seemed like I couldn't have more than 2 primary partitions on the hard disk.

Then, I removed other partitions so i had only MacOS installed. I created another two partitions, NTFS and Mac Extended Journal (for data). Then, I installed Windows on the NTFS partition. The Windows file system didn't corrupt anymore. But, i couldn't see the partition of type Mac Extended Journal from within Windows; i could see only MacOS partition. In Drive Management, the Mac Extended Journal for storing data shown as unallocated space s i created a new partition on it using extFAT file format. Damn! I couldn't boot into Windows again. The master boot record corrupted again.

At last, I successfully solved the problem by reformatted the whole drive and created 3 partitions of types: Mac Extended Journal (for MacOS), NTFS (for Windows), NTFS (for data). The Windows partition didn't corrupted anymore and i could see all partitions from within Windows.



Sunday, December 25, 2016

Got prohibition sign trying to boot Mac OS X from USB drive

My first laptop is Macbook Pro 13'' late 2016 running OSX Lion v10.7. Today, I've just bought another Macbook Air 11'' June 2013 and it has MacOS Sierra installed. My problem is my eyes hurt after staring at the screen for about half an hour but it happens only for Mac OSX v10.8 and later. I can stare at screen for a whole day without any problem if the machine runs OSX Lion v10.7. i'm not sure about the cause of the problem but perhaps it's because OSX v10.8 and later were made for Retina display screen and my both macbooks are non-retina display.

Then, i tried to install OSX Lion on my new Macbook Air using bootable USB. I used Cabon Copy Cloner to clone the OSX Lion drive from my Macbook Pro to the USB drive. I tried to boot my Macbook Air from that bootable USB but i got the prohibition sign and nothing happened. I could boot successfully from that USB with my Macbook Pro.

After that, i thought it might be because the OSX version is too old for my Macbook Air so i used my Macbook Pro to create Mavericks bootable USB and then tried to boot my Macbook Air again from that USB but no luck.

Moreover, I even used CloneZilla to backup the OSX hard drive on the Macbook Pro and then restored it to the OSX hard drive on the Macbook Air, and I still got the prohibition sign booting from the hard drive of the Macbook Air.

Therefore, I assumed that the root cause is not the problem with the version of OSX. As the bootable USB made on my Macbook Pro worked only with that machine, I thought it might be the version of the OS or/and the machine that we used to create the bootable USB is the problem. Hence, I used my Macbook Air running MacOS Sierra to create the bootable USB from the Mavericks installation file (DMG) instead (using Disk Utilities application). Bingo! it worked.

Monday, December 5, 2016

My experience with creating database in MySQL

I'm using Mac OS X Lion v10.7 and writing MySQL script to generate tables for my assignment project, Library Management.

Creating table

create table member(
 id varchar(16) not null,
 first_name varchar(128) not null,
 last_name varchar(128) not null,
 sex enum('M', 'F') not null,
 date_created timestamp not null,
 date_updated timestamp not null,
 primary key (id)
) engine=innodb default charset=utf8;

create table book (
 id bigint not null,
 ddc varchar(45) not null,
 title varchar(255) not null,
 author varchar(128) not null,
 year_published smallint not null,
 primary key (id)
) engine=innodb default charset=utf8;

create table borrow (
 member_id varchar(16) not null,
 book_id bigint not null,
 date_borrowed timestamp not null,
 date_returned timestamp,
 primary key (member_id, book_id, date_borrowed),
 foreign key (member_id) references member(id),
 foreign key (book_id) references book(id)
) engine=innodb default charset=utf8;

- There are a set of integer data types: tinyint(-128 to 127), smallint(-32768 to 32767), mediumint(-8388608 to 8388607)int(-2147483648 to 2147483647), and bigint.
- The option "default charset=utf8" allows me to store characters in many languages such as Spanish.
- From MySQL v5.7 and up, innodb is the default storage engine. It can handle concurrent transactions while myisam cannot.




Entity Relationship Diagram Drawing Tool

I'm using Mac OS X Lion v10.7 and the program I'm using to draw ER diagram is Dia (or download it from here). It's open source and support all platforms (Windows, Mac, and Linux). For the current version of Mac OS X I'm using, it asked me to install additional program called XQuartz (or you can download it from here) and re-login before I could use Dia.

Alternatively, you can use this online tool https://www.draw.io/

Wednesday, November 30, 2016

How I download the old version of OSX

The old versions of OSX such as Lion v10.7 is available on AppStore but you have to purchase it. I download it free from here

Create Clonezilla Live Partition (not a whole USB drive)

I used Tuxboot from within Ubuntu to create Clonezilla Live USB drive. Then, I have an external hard disk drive with multiple partitions. I used Disk Utility in Mac OSX Lion to clone the Clonezilla Live USB drive to one of the partitions but it failed.

Then, I used Carbon Copy Cloner to clone the entire USB drive to the partition instead and it worked.

Sunday, November 27, 2016

Checking for Windows update takes forever

In Control Panel, I clicked the Check for Updates button and it took forever. According to https://www.youtube.com/watch?v=WFfc22x3I_s, there are 4 methods. I think the 4th method is the best but it might be affected by the previous methods too so you might need to do all the methods orderly.

1. Run Command Prompt as Adminstrator and execute the following command:
> ipconfig /flushdns

2. Download and install Windows Client Update based on your machine architecture (32 bits or 64 bits). Type the following command in the Comand Prompt to see it:
> wmic os get osarchitecture

3. Stop the windows update service by running the following command adn then download and install Windows Update Diagnostic
> net stop wuauserv

4. Install Windows update offline by downloading it from here http://download.wsusoffline.net/ and run it then:
- Under Windows tab, select "x64 Global (Multilingual updates)" checkbox
- For Options checkbox, select "Include Service Packs" and "Include Windows Defender definitions"
And then click Start button. It will start Command Prompt program and download the necessary updates.
- Go to the installation files again and then client directory and run UpdateInstaller.exe. When the program starts, check Automatic reboot and recall checkbox and click Start button.