I somewhat naively thought that installing Linux on a Desktop computer was simpler than on a laptop but it seems to be less and less true these days.

The box is a Lenovo Erazer X510 "gaming PC" that has a 3.5 GHz Intel Core i7-4770K Processor with NVIDIA GeForce GTX 760 graphic card. It came with Windows 8.1 preinstalled but I accepted the migration to Windows 10 straight away.

The problem

The machine came with two 2 Tb disks mounted in Lenovo's Fake RAID mode. Contrary to what the name suggests it does not provide addiditional redudancy being an RAID 0 array that just creates a single large virtual disk from two disks.

The downside of this is that the filesystem is non standard, being spread over both disks and the Fake RAID support in Linux doesn't appear to be very developped.

Failing to install Debian using dmraid

After having done all recommended things in the BIOS (disabling Secure Boot, CMS and Lenovo's OS Specific settings which, among other things, makes sure that Windows is always booted first) as well as in Windows (turning off fast startup mode) I tried to do what is written in the Debian fakeraid howto using dmraid. The first part (install up to step 5) worked but the rest did not: I observed exactly what is reported here that /dev/mapper contains only the RAID0 device and none of the partitions.

Out of curiosity, I did try the mdadm way adding

mdadm=true

in the install kernel command line but there I could not even partition the disk.

Getting rid of RAID and going back to AHCI mode in Windows

I felt that this was a lost of time, especially given the fact that having two separate disks is indeed the perfect combination for a dual boot Windows/Linux system and decided to switch to AHCI mode in Windows.

I did try everything that can be found on Windows forums (booting in safe mode, adding AHCI to the registry) but nothing worked, with the computer refusing to boot. The problem is that the RAID partitionning scheme seems to be incompatible with the usual one and the system simply didn't find the boot sector when started in AHCI mode. Maybe all of this works when you have a single disk in RAID mode but it didn't in my case.

I contacted Lenovo, who said that I should either reinstall the system using One key recovery or buy recovery media. One key recovery did not work at all because it uses some of the (many) hidden partitions installed by Lenovo on the disk. Even it you make a USB recovery image of your system, it needs to load the software on the disk which is not found anymore when you turn to AHCI mode in the BIOS. The recovery media (for the original Windows 8.1) costs about 40 € (delivery included) and I could not register in Lenovo's online service shop.

I decided to install a pristine copy of Windows 10 which turned out to be very easy using an USB stick and worked fine as it does not require any product key (apparently Microsoft stores your hardward details when you activate Windows, some sites also claim that the product key is inserted directly in the UEFI BIOS). Note that Windows refused to install on the first disk (complaining about GPT) untill I deleted all artitions and created a new empty one. In doing so I did loose the preinstalled stuff by Lenovo and in particular the One key recovery software. This being said, it seems like Windows 10 has the option to create recovery media as well. Some of the original drivers can be found from Lenovo's support site but for the graphic card, I used direclty the NVIDIA site.

Installing linux on the second hard disk

With all of this, I thought that installing Debian would now be easy but there was still a hidden trace of the RAID mode that prevented me from doing a straightforward installation.

Getting rid of the dmraid configuration

The problem was that the installer did not see the second hard drive (despite the fact that fdisk -l in the shell did show the disk.

To solve this, I had to remove previous dmraid information using a Debian live CD.

Here, I had to find a workaround for the Erazer X510 mouse issue by [blacklisting]](http://askubuntu.com/questions/110341/how-to-blacklist-kernel-modules) the psmouse module:

In the live CD, press TAB for advanced options and add

psmouse.blacklist=yes

to the end of the Grub command line (note that it is also possible to use the console mode of the live CD, the username is user and the password live).

To remove the dmraid information as explained above, one first needs to install dmraid which is missing from the live CD using:

sudo apt-get install dmraid

Installing Debian

And after all this, I could in the end install Debian from the USB stick...

Everything worked fine, but in the end as I wanted to be sure that grub was installed on the second disk and not the first one (the message of the installer in the end is somewhat ambiguous regarding this), I skipped the install of grub. Thus, I had to boot on the live section of the CD and to manually install grub.

Last post-install tweak was to change the default boot order as not everyone in the family appreciates Linux as I do. Using the grub-set-default script didn't work for me. I thus added the option

GRUB_DISABLE_OS_PROBER=true

in /etc/default/grub to omit the entry auto-inserted by the Debian install system (with corresponding script in /etc/grub.d/30_os-prober). Then I added a script /etc/grub.d/09_windows (the Linux entry is /etc/grub.d/10_linux, so if you want something that will be inserted before, it has to start with a number less than 10) with content:

#!/bin/sh
exec tail -n +3 $0
menuentry 'Windows 10' --class windows --class os {
  insmod ntfs
  insmod ntldr
  search --no-floppy --fs-uuid --set=root 8072D07472D07080
  ntldr /bootmgr
}

which is suggested on several sites as a simplified and more modern version of the entry added by the os-prober script. After this grub-mkconfig and update-grub and your are done.

I finally had to install the NVIDIA proprietary drivers which are not available by default in Debian (I am not sure this is really better than the nouveau driver which is configured in Debian by default but there are people here who are very much concerned about FPS...) The downside of this was that the console was started in a very poor resolution mode, which I had to fix by editing /etc/default/grub