Did you know LQ has a Linux Hardware Compatibility List?
Go Back > Blogs > Rearden888
User Name


Rate this Entry

Crunchbang Linux Install Vaio Pro 13

Posted 11-05-2013 at 02:00 AM by Rearden888

Got this laptop new to replace an older Lenovo Thinkpad X220. Mine is the Core i7 4500U with a 256 GB hard drive, but nothing here should be different in other versions besides drive partition sizes. It was kind of a bear to install, so I thought I'd post a write up here that might be useful to others.

Feel free to point out mistakes and improvements!

Lets start off with some background:

Hard drive comes partitioned a lot. Itís a GPT table, with two EFI partitions, one main windows partition, one Assist partition, and of recovery data partition. Hereís how mine was set up:
sda1: 260 MB EFI Partition (SONYSYS)
sda2: 1.44 GB Windows RE tools (Assist)
sda3: 260 MB EFI Partition (Normal startup boot)
sda4: 128MB MS reserved (not sure what this is)
sda5: 221 GB Main OS/data partition (normal windows install)
sda6: 15.2 GB OS Recovery partition

First off, lets talk about these partitions a little bit. The first two are supposed to be hidden, and are accessed when you press the little ďAssistĒ button above the keyboard. They allow access to the recovery features. sda3 is your normal day-to-day EFI boot partition. sda6 is the Windows image used to install a clean system back to sda5.

My goal was to install Linux onto sda5 without interfering with the rest of the system. I didnít care about the windows install that was already there, nor did I want to dual boot. I did want to preserve the ability to install windows back onto the machine at a later date if desired. This means Iíd need to minimize changes to the other partitions and use EFI.

First, I recommend booting in to windows and using the Vaio care software to build yourself some recovery media. I used an old 16GB flash drive I had laying around. Iím not sure if it can recreate the EFI partitions, but I did test rebuilding the main windows partition and it seemed to work fine.

After youíve built your recovery media, you should be all set to install CB.

1. Shut down the computer and press the ďAssistĒ button to boot into the recovery mode. Enter the BIOS and disable secure boot, change the boot type to legacy and switch the external device to first.

2. Plug your crunchbang USB flash drive prepared per the standard documentation. Make sure to use the USB port NOT marked with the ďLightning boltĒ.

3. Power up normally, you should get the crunchbang grub menu with options for live and install. Choose install, then press tab to modify the command line. Add libata.force=noncq to the command line. The drive in this machine DOES NOT like it if you donít have this option.

4. Go through the install normally, I chose to install to one big partition on sda5 as ext4. Skip installing the bootloader.

5. Once youíve finished the install, we need to reboot back into the Live session because we have to make some changes to sda3 in order to boot our new linux system. Now, this is where I ran into some trouble. Because this is such a new system, the kernel in the live environment doesnít have the drivers for the wireless card in this laptop. I had a USB network adapter, but it was also too new to have drivers in the old 3.2 kernel in the live environment. This forced me to go download the .debs required for the EFI installation. I used another computer I have that runs crunchbang to download efibootmgr, grub-efi-amd64-bin, and grub-efi-amd64, but you could conceivably do this in the live environment. It is important to use the crunchbang versions, since they are customized with crunchbang theming. Finally, another issue with this laptop which I encountered at this point was that the old kernel didnít enable the second USB port. I needed to use a USB hub in order to be able to both boot from a flash drive and mount one with the .debs on it.

6. Now we just need to build our EFI bootloader and install it into the EFI partition. First, we need to mount and chroot into our newly installed environment. I used the first portion of the steps in Ref 1 to mount and chroot into the environment.
sudo mkdir -p $TARGET
sudo mount /dev/sda5 $TARGET
sudo mount --bind /dev     $TARGET/dev
sudo mount --bind /dev/pts $TARGET/dev/pts
sudo mount --bind /proc    $TARGET/proc
sudo mount --bind /sys     $TARGET/sys
sudo cp /etc/resolv.conf $TARGET/etc/resolv.conf   # needed to have network in chroot
sudo chroot $TARGET /bin/bash
Now, if you have a USB network adapter, you can run:
sudo apt-get update
sudo apt-get install grub-efi-amd64
However, if youíre like me and you donít have one that works, use the following dpkg commands to install the required packages:
sudo dpkg -i efibootmgr...
sudo dpkg -i grub-efi-amd64-bin...
sudo dpkg -i grub-efi-amd64...
Also, since this is a Haswell laptop, it does best with a new kernel. Iíd build one ahead of time using the standard Debian make-kpkg process and I installed it at this point as well.

7. We also want to add that ata force parameter to all of our kernel entries, so modify the /etc/default/grub file and add the libata.force=noncq to the DEFAULT_CMDLINE parameter like ths:
GRUB_CMDLINE_LINUX_DEFAULT="libata.force=noncq quiet"
Now, youíre ready to run
sudo grub-install
sudo update-grub
This builds and installs grub to /boot. This also provides the EFI application file that we need to install into the EFI partition to boot our new install.

8. Mount your second EFI partition somewhere (in my case, I mounted /dev/sda3 in /media/sda3).

9. This laptop uses the Insyde H20 EFI system, which, per Ref 2, may not conform to the UEFI standard. I didnít want to screw around with testing whether this particular version was standards compliant, now did I want to mess around with installing and running and EFI shell, which wasnít necessary since I didnít want to dual boot. I just followed the instructions in one of the replies to Ref 2 and replaced /media/sda3/EFI/Microsoft/boot/bootmgfw.efi with grub.efi, and kept the old MS bootloader as bootmgrfw.efi.old.

10. Now shut down out of the live session, and boot back up into Assist. Go into the BIOS and change from Legacy to EFI and make the internal drive first priority. You can disable external device boot, supposedly it speeds up booting. Leave secure boot off.

11. Once I did that, everything booted up nicely on itís own. The laptop will boot using the old stable 3.2 kernel, but nothing really works right. I *highly* recommend using at least a 3.11 kernel, and now that 3.12 has been released, that is probably best since it includes some fixes for the microphone specific to this laptop as well as general Haswell performance improvements. It also seemed to enable my second USB port.

Posted in Uncategorized
Views 3044 Comments 0
« Prev     Main     Next »
Total Comments 0




All times are GMT -5. The time now is 11:32 PM.

Main Menu

Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration